--- loncom/homework/response.pm 2003/08/20 14:05:40 1.84 +++ loncom/homework/response.pm 2003/09/22 20:49:01 1.85 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.84 2003/08/20 14:05:40 sakharuk Exp $ +# $Id: response.pm,v 1.85 2003/09/22 20:49:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -556,6 +556,14 @@ sub whichorder { return @whichopt; } +sub show_answer { + my $part = $Apache::inputtags::part; + my $award = $Apache::lonhomework::history{"resource.$part.solved"}; + my $status = $Apache::inputtags::status[-1]; + return ( ($award =~ /^correct/ + && lc($Apache::lonhomework::problemstatus) ne 'no') + || $status eq "SHOW_ANSWER"); +} 1; __END__