--- loncom/homework/inputtags.pm 2011/03/05 23:00:45 1.281 +++ loncom/homework/inputtags.pm 2011/03/07 19:42:21 1.282 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.281 2011/03/05 23:00:45 raeburn Exp $ +# $Id: inputtags.pm,v 1.282 2011/03/07 19:42:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -801,7 +801,7 @@ sub finalizeawards { } sub decideoutput { - my ($award,$awarded,$awardmsg,$solved,$previous,$target)=@_; + my ($award,$awarded,$awardmsg,$solved,$previous,$target,$nocorrect)=@_; my $message=''; my $button=0; @@ -819,8 +819,14 @@ sub decideoutput { my $part = $Apache::inputtags::part; my $tohandgrade = &Apache::lonnet::EXT("resource.$part.handgrade"); my $handgrade = ('yes' eq lc($tohandgrade)); +# +# Should "Computer's Answer" be displayed? +# Should not be displayed if still answerable, +# if the problem is handgraded, +# or if the problem does not give a correct answer +# - my $computer = ($handgrade)? '' + my $computer = ($handgrade || $nocorrect)? '' : " ".&mt("Computer's answer now shown above."); &Apache::lonxml::debug("handgrade has :$handgrade:"); @@ -1361,8 +1367,8 @@ sub grade { } sub get_grade_messages { - my ($id,$prefix,$target,$status) = @_; - + my ($id,$prefix,$target,$status,$nocorrect) = @_; +# nocorrect suppresses "Computer's answer now shown above" my ($message,$latemessage,$trystr,$previousmsg); my $showbutton = 1; @@ -1376,7 +1382,7 @@ sub get_grade_messages { &Apache::lonxml::debug('Getting message'); ($showbutton,my $css_class,$message,$previousmsg) = &decideoutput($award,$awarded,$awardmsg,$solved,$previous, - $target); + $target,(($status eq 'CAN_ANSWER') || $nocorrect)); if ($target eq 'tex') { $message='\vskip 2 mm '.$message.' '; } else {