--- loncom/homework/response.pm 2011/11/14 03:08:01 1.227 +++ loncom/homework/response.pm 2011/11/29 13:24:38 1.228 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.227 2011/11/14 03:08:01 raeburn Exp $ +# $Id: response.pm,v 1.228 2011/11/29 13:24:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -53,6 +53,7 @@ package Apache::response; use strict; use Apache::lonlocal; use Apache::lonnet; +use Apache::inputtags(); use Apache::lonmaxima(); use Apache::lonr(); @@ -1181,11 +1182,17 @@ sub whichorder { sub show_answer { my $part = $Apache::inputtags::part; - my $award = $Apache::lonhomework::history{"resource.$part.awarded"}; + my $award = $Apache::lonhomework::history{"resource.$part.solved"}; my $status = $Apache::inputtags::status[-1]; - return ( ($award ==1 - && &Apache::lonhomework::show_problem_status()) - || $status eq "SHOW_ANSWER"); + my $canshow = 0; + if ($award =~ /^correct/) { + if ((&Apache::inputtags::grading_is_nonlenient($part)) || + ($Apache::lonhomework::history{"resource.$part.awarded"} == 1)) { + $canshow = 1; + } + } + return (($canshow && &Apache::lonhomework::show_problem_status()) + || $status eq "SHOW_ANSWER"); } sub analyze_store_foilgroup {