--- loncom/homework/inputtags.pm 2003/02/07 22:03:21 1.84 +++ loncom/homework/inputtags.pm 2003/03/17 21:33:33 1.85 @@ -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.85 2003/03/17 21:33:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -388,7 +388,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 +396,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; }