--- loncom/homework/lonhomework.pm 2003/04/30 21:27:57 1.120 +++ loncom/homework/lonhomework.pm 2003/05/08 15:33:15 1.121 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.120 2003/04/30 21:27:57 albertel Exp $ +# $Id: lonhomework.pm,v 1.121 2003/05/08 15:33:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,6 +50,7 @@ use Apache::essayresponse(); use Apache::externalresponse(); use Apache::rankresponse(); use Apache::matchresponse(); +use Apache::chemresponse(); use Apache::Constants qw(:common); use HTML::Entities(); use Apache::loncommon(); @@ -207,12 +208,15 @@ sub check_access { $datemsg = "was due on $lastdate, and answers will be available on $date"; } if ($status eq 'CAN_ANSWER') { - #check #tries + #check #tries, and if correct. my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); if ( $tries eq '' ) { $tries = '0'; } if ( $maxtries eq '' ) { $maxtries = '2'; } if ($tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } + if($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/) { + $status = 'CANNOT_ANSWER'; + } } if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') &&