--- loncom/homework/inputtags.pm 2003/09/17 20:51:15 1.115 +++ loncom/homework/inputtags.pm 2003/09/23 15:59:53 1.119 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.115 2003/09/17 20:51:15 www Exp $ +# $Id: inputtags.pm,v 1.119 2003/09/23 15:59:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -455,7 +455,8 @@ sub decideoutput { $message = &mt("Unknown message").": $award"; $button=1; } - if (lc($Apache::lonhomework::problemstatus) eq 'no') { + if (lc($Apache::lonhomework::problemstatus) eq 'no' && + $Apache::inputtags::status[-1] ne 'SHOW_ANSWER') { $message = &mt("Answer Submitted"); $bgcolor=$possiblecolors{'correct'}; $button=1; @@ -517,6 +518,9 @@ sub setgradedata { } elsif ( $award eq 'INCORRECT' ) { $Apache::lonhomework::results{"resource.$id.tries"} = $Apache::lonhomework::history{"resource.$id.tries"} + 1; + if (lc($Apache::lonhomework::problemstatus) eq 'no') { + $Apache::lonhomework::results{"resource.$id.awarded"} = 0; + } $Apache::lonhomework::results{"resource.$id.solved"} = 'incorrect_attempted' } elsif ( $award eq 'SUBMITTED' ) { @@ -536,6 +540,7 @@ sub setgradedata { if (lc($Apache::lonhomework::problemstatus) eq 'no') { $Apache::lonhomework::results{"resource.$id.tries"} = $Apache::lonhomework::history{"resource.$id.tries"} + 1; + $Apache::lonhomework::results{"resource.$id.awarded"} = 0; } } @@ -643,18 +648,18 @@ sub gradestatus { if ( $showbutton ) { if ($target eq 'tex') { if ($ENV{'request.state'} ne "construct" && $Apache::lonhomework::type ne 'exam') { - $trystr = ' {\vskip 1 mm \small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 2 mm '; + $trystr = ' {\vskip 1 mm \small \textit{'.&mt('Tries').'} '.$tries.'/'.$maxtries.'} \vskip 2 mm '; } else { $trystr = '\vskip 0 mm '; } } else { - $trystr = "Tries $tries/$maxtries"; + $trystr = "".&mt('Tries')." $tries/$maxtries"; } } if ( $status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {$showbutton = 0;} if ( $showbutton ) { if ($target ne 'tex') { - $button = '
'; + $button = '
'; } } if ($Apache::lonhomework::history{"resource.$id.afterduedate"}) {