Diff for /loncom/homework/inputtags.pm between versions 1.98 and 1.102

version 1.98, 2003/05/06 15:31:45 version 1.102, 2003/05/23 07:04:44
Line 160  sub start_textline { Line 160  sub start_textline {
   my $result = "";    my $result = "";
   if ($target eq 'web') {    if ($target eq 'web') {
     $Apache::lonxml::evaluate--;      $Apache::lonxml::evaluate--;
       my $partid=$Apache::inputtags::part;
       my $id=$Apache::inputtags::response[-1];
     if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {      if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
       my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);        my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
       my $maxlength;        my $maxlength;
       if ($size eq '') { $size=20; } else {        if ($size eq '') { $size=20; } else {
  if ($size < 20) { $maxlength=$size; }   if ($size < 20) { $maxlength=$size; }
       }        }
       my $partid=$Apache::inputtags::part;  
       my $id=$Apache::inputtags::response[-1];  
       my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"});        my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"});
       if ($Apache::lonhomework::type ne 'exam') {        if ($Apache::lonhomework::type ne 'exam') {
         $result= '<input type="text" name="HWVAL_'.$id.'" value="'.          $result= '<input type="text" name="HWVAL_'.$id.'" value="'.
Line 251  sub finalizeawards { Line 251  sub finalizeawards {
   if ($result eq '' ) {    if ($result eq '' ) {
     foreach $award (@_) { if ($award eq 'NO_RESPONSE') {$result='NO_RESPONSE'; last;} }      foreach $award (@_) { if ($award eq 'NO_RESPONSE') {$result='NO_RESPONSE'; last;} }
   }    }
     if ($result eq '' ) {
       foreach $award (@_) { if ($award eq 'TOO_LONG') {$result='TOO_LONG'; last;}}
     }
   if ($result eq '' ) {    if ($result eq '' ) {
     foreach $award (@_) {       foreach $award (@_) { 
       if ($award eq 'UNIT_FAIL' ||        if ($award eq 'UNIT_FAIL' ||
Line 336  sub decideoutput { Line 338  sub decideoutput {
   } elsif ($award eq 'MISSING_ANSWER') {    } elsif ($award eq 'MISSING_ANSWER') {
       $message = 'Some parts were not submitted';        $message = 'Some parts were not submitted';
       $button = 1;        $button = 1;
     } elsif ($award eq 'ERROR') {
         $message = 'An error occured while trying to grade answer.';
         $button = 1;
     } elsif ($award eq 'TOO_LONG') {
         $message = "The submitted answer was too long.";
         $button=1;
   } elsif ($award eq 'WANTED_NUMERIC') {    } elsif ($award eq 'WANTED_NUMERIC') {
       $message = "This question expects a numeric answer";        $message = "This question expects a numeric answer";
       $button=1;        $button=1;
Line 404  sub setgradedata { Line 412  sub setgradedata {
     $Apache::lonhomework::results{"resource.$id.afterduedate"}=$award;      $Apache::lonhomework::results{"resource.$id.afterduedate"}=$award;
     return '';      return '';
   } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} !~    } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} !~
        /^correct/ || $Apache::lonhomework::scantronmode) {         /^correct/ || $Apache::lonhomework::scantronmode ||
       lc($Apache::lonhomework::problemstatus) eq 'no') {
     #handle assignment of tries and solved status      #handle assignment of tries and solved status
     my $solvemsg;      my $solvemsg;
     if ($Apache::lonhomework::scantronmode) {      if ($Apache::lonhomework::scantronmode) {
Line 456  sub setgradedata { Line 465  sub setgradedata {
     } else {      } else {
       $Apache::lonhomework::results{"resource.$id.solved"} =        $Apache::lonhomework::results{"resource.$id.solved"} =
  'incorrect_attempted';   'incorrect_attempted';
         if (lc($Apache::lonhomework::problemstatus) eq 'no') {
     $Apache::lonhomework::results{"resource.$id.tries"} =
         $Apache::lonhomework::history{"resource.$id.tries"} + 1;
         }
     }      }
   
     # check if this was a previous submission if it was delete the      # check if this was a previous submission if it was delete the
     # unneeded data and update the previously_used attribute      # unneeded data and update the previously_used attribute
     if ( $previously_used eq 'PREVIOUSLY_USED') {      if ( $previously_used eq 'PREVIOUSLY_USED') {
       delete($Apache::lonhomework::results{"resource.$id.tries"});   if (lc($Apache::lonhomework::problemstatus) ne 'no') {
       $Apache::lonhomework::results{"resource.$id.previous"} = '1';      delete($Apache::lonhomework::results{"resource.$id.tries"});
       $Apache::lonhomework::results{"resource.$id.previous"} = '1';
    }
     } elsif ( $previously_used eq 'PREVIOUSLY_LAST') {      } elsif ( $previously_used eq 'PREVIOUSLY_LAST') {
       #delete all data as they student didn't do anything, but save        #delete all data as they student didn't do anything, but save
       #the list of collaborators.        #the list of collaborators.

Removed from v.1.98  
changed lines
  Added in v.1.102


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