Diff for /loncom/homework/inputtags.pm between versions 1.15 and 1.19

version 1.15, 2000/12/12 14:54:10 version 1.19, 2000/12/21 18:13:33
Line 16  sub initialize_inputtags { Line 16  sub initialize_inputtags {
   @Apache::inputtags::responselist=();    @Apache::inputtags::responselist=();
   @Apache::inputtags::answergroup=();    @Apache::inputtags::answergroup=();
   $Apache::inputtags::part='';    $Apache::inputtags::part='';
     @Apache::inputtags::status=();
   %Apache::inputtags::params=();    %Apache::inputtags::params=();
 }  }
   
Line 249  sub gradestatus { Line 250  sub gradestatus {
   my ($id) = @_;    my ($id) = @_;
   my $showbutton = 1;    my $showbutton = 1;
   my $message = '';    my $message = '';
   my $award = $Apache::lonhomework::history{"resource.$id.award"};  
   &Apache::lonxml::debug("Found Award |$award|");  
   if ( $award ne '' ) {  
     &Apache::lonxml::debug('Getting message');  
     ($showbutton,$message) = &decideoutput($award);  
   }  
   my $button='';  
   my $tries = $Apache::lonhomework::history{"resource.$id.tries"};  
   my $maxtries = $Apache::lonhomework::history{"resource.$id.maxtries"};  
   if ( $tries eq '' ) { $tries = '0'; }  
   if ( $maxtries eq '' ) { $maxtries = '2'; }   
   my $trystr='';    my $trystr='';
   if ( $showbutton ) {    my $button='';
     $trystr = "<br></br>Tries $tries/$maxtries";    
   }    my $status = $Apache::inputtags::status['-1'];
   if ( $tries >= $maxtries ) { $showbutton = 0; }    &Apache::lonxml::debug("gradestatus has :$status:");
   if ( $showbutton ) {     if ( $status eq 'CAN_ANSWER' || $status eq 'SHOW_ANSWER' ) {  
     $button = '<input type="submit" name="submit" value="Submit All Answers"><br></br>';      my $award = $Apache::lonhomework::history{"resource.$id.award"};
       &Apache::lonxml::debug("Found Award |$award|");
       if ( $award ne '' ) {
         &Apache::lonxml::debug('Getting message');
         ($showbutton,$message) = &decideoutput($award);
       }
       my $tries = $Apache::lonhomework::history{"resource.$id.tries"};
       my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries");
       &Apache::lonxml::debug("got maxtries of :$maxtries:");
       if ( $tries eq '' ) { $tries = '0'; }
       if ( $maxtries eq '' ) { $maxtries = '2'; } 
       if ( $showbutton ) {
         $trystr = "<br></br>Tries $tries/$maxtries";
       }
       if ( $tries >= $maxtries ) { $showbutton = 0; }
       if ( $status eq 'SHOW_ANSWER' ) { $showbutton = 0; }
       if ( $showbutton ) { 
         $button = '<input type="submit" name="submit" value="Submit All Answers"><br></br>';
       }
   }    }
   return $button.$message.$trystr;    return $button.$message.$trystr;
 }  }

Removed from v.1.15  
changed lines
  Added in v.1.19


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