Diff for /loncom/homework/hint.pm between versions 1.9 and 1.11

version 1.9, 2001/03/31 00:35:17 version 1.11, 2001/04/10 22:06:59
Line 15  sub start_hintgroup { Line 15  sub start_hintgroup {
   my $skiptoend='0';    my $skiptoend='0';
   my $result;    my $result;
       
   if ($target eq 'web' || $target eq 'grade') {    if ($target eq 'web') {
     my $id=$Apache::inputtags::part;      my $id=$Apache::inputtags::part;
     my $numtries=$Apache::lonhomework::history{"resource.$id.tries"};      my $numtries=$Apache::lonhomework::history{"resource.$id.tries"};
     if ( $numtries eq '') { $numtries = 0; }      if ( $numtries eq '') { $numtries = 0; }
     my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");      my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");
     if ( $hinttries eq '') { $hinttries = 1; }      if ( $hinttries eq '') { $hinttries = 1; }
     &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");      &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");
     if ( $numtries <= $hinttries ) {      if ( $numtries < $hinttries ) {
       $skiptoend='1';         $skiptoend='1';
     } else {      } else {
       if ($target eq 'web') {$result='<table bgcolor="#dddddd"><tr><td>';}        if ($target eq 'web') {$result='<table bgcolor="#dddddd"><tr><td>';}
     }      }
Line 39  sub end_hintgroup { Line 39  sub end_hintgroup {
   my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;
   my $result;    my $result;
   
   if ($target ne 'meta' || $target ne 'grade') {    if ($target eq 'web') {
     my $id=$Apache::inputtags::part;      my $id=$Apache::inputtags::part;
     my $numtries=$Apache::lonhomework::history{"resource.$id.tries"};      my $numtries=$Apache::lonhomework::history{"resource.$id.tries"};
     if ( $numtries eq '') { $numtries = 0; }      if ( $numtries eq '') { $numtries = 0; }
     my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");      my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");
     if ( $hinttries eq '') { $hinttries = 1; }      if ( $hinttries eq '') { $hinttries = 1; }
     &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");      &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");
     if ( $numtries >= $hinttries ) {      if ( $numtries => $hinttries ) {
       if ($target eq 'web') {$result='</td></tr></table>';}        if ($target eq 'web') {$result='</td></tr></table>';}
     }      }
   }    }
Line 56  sub end_hintgroup { Line 56  sub end_hintgroup {
   
 sub start_numericalhint {  sub start_numericalhint {
   #do everything in end, so intervening <responseparams> work    #do everything in end, so intervening <responseparams> work
     return '';
 }  }
   
 sub end_numericalhint {  sub end_numericalhint {
   my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;
   my $result;    my $result;
   if ($target ne 'meta' && $target ne 'grade') {    if ($target eq 'web') {
     my $args ='';      my $args ='';
     $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);      $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
     if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }      if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
Line 110  sub start_hintpart { Line 111  sub start_hintpart {
 }  }
   
 sub end_hintpart {  sub end_hintpart {
     return '';
 }  }
   
 1;  1;

Removed from v.1.9  
changed lines
  Added in v.1.11


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>