--- loncom/homework/inputtags.pm 2003/02/07 22:03:21 1.84 +++ loncom/homework/inputtags.pm 2003/04/02 19:51:24 1.86 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.84 2003/02/07 22:03:21 albertel Exp $ +# $Id: inputtags.pm,v 1.86 2003/04/02 19:51:24 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -336,6 +336,7 @@ sub decideoutput { $message = "Unknown message: $award"; $button=1; } + if ($Apache::lonhomework::type eq 'exam') {$message='';$previousmsg='';} return ($button,$message,$previousmsg); } @@ -388,7 +389,7 @@ sub setgradedata { foreach my $key (keys(%Apache::lonhomework::results)) { if (($key =~ /^resource\.$id\./) && ($key !~ /\.collaborators$/)) { &Apache::lonxml::debug("Removing $key"); - delete($Apache::lonhomework::results{$key}); + delete($Apache::lonhomework::results{$key}); } } #and since they didn't do anything we were never here @@ -396,6 +397,17 @@ sub setgradedata { } else { $Apache::lonhomework::results{"resource.$id.previous"} = '0'; } + } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} =~ + /^correct/ ) { + #delete all data as they student already has it correct + foreach my $key (keys(%Apache::lonhomework::results)) { + 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 + return ''; } $Apache::lonhomework::results{"resource.$id.award"} = $award; }