Diff for /loncom/homework/inputtags.pm between versions 1.85 and 1.87

version 1.85, 2003/03/17 21:33:33 version 1.87, 2003/04/07 20:52:58
Line 336  sub decideoutput { Line 336  sub decideoutput {
     $message = "Unknown message: $award";      $message = "Unknown message: $award";
     $button=1;      $button=1;
   }    }
     if ($Apache::lonhomework::type eq 'exam') {$message='';$previousmsg='';}
   return ($button,$message,$previousmsg);    return ($button,$message,$previousmsg);
 }  }
   
   sub remove_alldata {
       my ($id)=@_;
       foreach my $key (keys(%Apache::lonhomework::results)) {
    if (($key =~ /^resource\.\Q$id\E\./) && ($key !~ /\.collaborators$/)) {
       &Apache::lonxml::debug("Removing $key");
       delete($Apache::lonhomework::results{$key});
    }
       }
   }
   
 sub setgradedata {  sub setgradedata {
   my ($award,$id,$previously_used) = @_;    my ($award,$id,$previously_used) = @_;
   # if the student already has it correct, don't modify the status    # if the student already has it correct, don't modify the status
Line 371  sub setgradedata { Line 382  sub setgradedata {
     } elsif ( $award eq 'DRAFT' ) {      } elsif ( $award eq 'DRAFT' ) {
       $Apache::lonhomework::results{"resource.$id.solved"} = '';        $Apache::lonhomework::results{"resource.$id.solved"} = '';
     } elsif ( $award eq 'NO_RESPONSE' ) {      } elsif ( $award eq 'NO_RESPONSE' ) {
       return '';   #no real response so delete any data that got stored
    &removealldata($id);
    return '';
     } else {      } else {
       $Apache::lonhomework::results{"resource.$id.solved"} =        $Apache::lonhomework::results{"resource.$id.solved"} =
  'incorrect_attempted';   'incorrect_attempted';
Line 385  sub setgradedata { Line 398  sub setgradedata {
     } 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.
       foreach my $key (keys(%Apache::lonhomework::results)) {        &removealldata($id);
  if (($key =~ /^resource\.$id\./) && ($key !~ /\.collaborators$/)) {  
   &Apache::lonxml::debug("Removing $key");  
   delete($Apache::lonhomework::results{$key});  
  }  
       }  
       #and since they didn't do anything we were never here        #and since they didn't do anything we were never here
       return '';        return '';
     } else {      } else {
Line 399  sub setgradedata { Line 407  sub setgradedata {
   } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} =~    } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} =~
     /^correct/ ) {      /^correct/ ) {
       #delete all data as they student already has it correct        #delete all data as they student already has it correct
       foreach my $key (keys(%Apache::lonhomework::results)) {        &removealldata($id);
   if (($key =~ /^resource\.$id\./) && ($key !~ /\.collaborators$/)) {  
       &Apache::lonxml::debug("Removing $key");  
       delete($Apache::lonhomework::results{$key});  
   }  
       }  
       #and since they didn't do anything we were never here        #and since they didn't do anything we were never here
       return '';        return '';
   }    }

Removed from v.1.85  
changed lines
  Added in v.1.87


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