--- loncom/homework/inputtags.pm 2003/05/08 15:22:03 1.99 +++ loncom/homework/inputtags.pm 2003/05/09 22:24:05 1.101 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.99 2003/05/08 15:22:03 albertel Exp $ +# $Id: inputtags.pm,v 1.101 2003/05/09 22:24:05 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,9 +82,7 @@ sub start_textfield { my $resid=$Apache::inputtags::response[-1]; if ($target eq 'web') { $Apache::lonxml::evaluate--; - if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER' && - $Apache::lonhomework::history{"resource.$id.solved"} =~/^correct/ - ) { + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { my $partid=$Apache::inputtags::part; my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$resid.submission"}); my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval); @@ -164,9 +162,7 @@ sub start_textline { $Apache::lonxml::evaluate--; my $partid=$Apache::inputtags::part; my $id=$Apache::inputtags::response[-1]; - if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER' && - $Apache::lonhomework::history{"resource.$id.solved"} =~/^correct/ - ) { + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval); my $maxlength; if ($size eq '') { $size=20; } else { @@ -408,7 +404,8 @@ sub setgradedata { $Apache::lonhomework::results{"resource.$id.afterduedate"}=$award; return ''; } 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 my $solvemsg; if ($Apache::lonhomework::scantronmode) { @@ -460,13 +457,19 @@ sub setgradedata { } else { $Apache::lonhomework::results{"resource.$id.solved"} = '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 # unneeded data and update the previously_used attribute if ( $previously_used eq 'PREVIOUSLY_USED') { - delete($Apache::lonhomework::results{"resource.$id.tries"}); - $Apache::lonhomework::results{"resource.$id.previous"} = '1'; + if (lc($Apache::lonhomework::problemstatus) ne 'no') { + delete($Apache::lonhomework::results{"resource.$id.tries"}); + $Apache::lonhomework::results{"resource.$id.previous"} = '1'; + } } elsif ( $previously_used eq 'PREVIOUSLY_LAST') { #delete all data as they student didn't do anything, but save #the list of collaborators.