--- loncom/homework/inputtags.pm 2003/05/08 15:33:15 1.100 +++ loncom/homework/inputtags.pm 2003/05/23 07:04:44 1.102 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.100 2003/05/08 15:33:15 albertel Exp $ +# $Id: inputtags.pm,v 1.102 2003/05/23 07:04:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -251,7 +251,9 @@ sub finalizeawards { if ($result eq '' ) { foreach $award (@_) { if ($award eq 'NO_RESPONSE') {$result='NO_RESPONSE'; last;} } } - + if ($result eq '' ) { + foreach $award (@_) { if ($award eq 'TOO_LONG') {$result='TOO_LONG'; last;}} + } if ($result eq '' ) { foreach $award (@_) { if ($award eq 'UNIT_FAIL' || @@ -336,6 +338,12 @@ sub decideoutput { } elsif ($award eq 'MISSING_ANSWER') { $message = 'Some parts were not submitted'; $button = 1; + } elsif ($award eq 'ERROR') { + $message = 'An error occured while trying to grade answer.'; + $button = 1; + } elsif ($award eq 'TOO_LONG') { + $message = "The submitted answer was too long."; + $button=1; } elsif ($award eq 'WANTED_NUMERIC') { $message = "This question expects a numeric answer"; $button=1; @@ -404,7 +412,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) { @@ -456,13 +465,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.