--- loncom/homework/lonhomework.pm 2007/11/13 23:26:08 1.284 +++ loncom/homework/lonhomework.pm 2007/11/17 02:51:29 1.285 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.284 2007/11/13 23:26:08 albertel Exp $ +# $Id: lonhomework.pm,v 1.285 2007/11/17 02:51:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -494,6 +494,10 @@ sub check_access { $Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) { $status = 'CANNOT_ANSWER'; } + if ($status eq 'CANNOT_ANSWER' + && &show_answer_problem_status()) { + $status = 'SHOW_ANSWER'; + } } if ($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER') { my $interval=&Apache::lonnet::EXT("resource.$id.interval"); @@ -883,6 +887,7 @@ sub analyze { sub show_problem_status { return ($show_problem_status eq 'yes' + || $show_problem_status eq 'answer' || $show_problem_status eq ''); } @@ -893,6 +898,10 @@ sub analyze { sub show_no_problem_status { return ($show_problem_status eq 'no_feedback_ever'); } + + sub show_answer_problem_status { + return ($show_problem_status eq 'answer'); + } } sub editxmlmode {