--- loncom/homework/lonhomework.pm 2004/02/16 17:20:39 1.165 +++ loncom/homework/lonhomework.pm 2004/03/09 20:37:58 1.171 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.165 2004/02/16 17:20:39 albertel Exp $ +# $Id: lonhomework.pm,v 1.171 2004/03/09 20:37:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,6 +47,7 @@ use Apache::externalresponse(); use Apache::rankresponse(); use Apache::matchresponse(); use Apache::chemresponse(); +use Apache::drawimage(); use Apache::Constants qw(:common); use HTML::Entities(); use Apache::loncommon(); @@ -201,12 +202,16 @@ sub check_access { my $passed; if ($ENV{'request.state'} eq "construct") { - if (defined($ENV{'form.problemstatus'})) { + if ($ENV{'form.problemstate'}) { if ($ENV{'form.problemstate'} =~ /^CANNOT_ANSWER/) { - return ('CANNOT_ANSWER','is in this state by royal decree.'); + if ( ! ($ENV{'form.problemstate'} eq 'CANNOT_ANSWER_correct' && + lc($Apache::lonhomework::problemstatus) eq 'no')) { + return ('CANNOT_ANSWER', + &mt('is in this state by royal decree.')); + } } else { return ($ENV{'form.problemstate'}, - 'is in this state by royal decree.'); + &mt('is in this state by royal decree.')); } } &Apache::lonxml::debug("in construction ignoring dates"); @@ -394,29 +399,29 @@ sub handle_save_or_undo { if ((!$error) && (!copy($filebak,$file))) { $error=1; } if ((!$error) && (!move($filetmp,$filebak))) { $error=1; } if (!$error) { - $request->print("
".&mt("Undid changes, Switched")." $filebak ".&mt("and")." $file
"); + &Apache::lonxml::info("".&mt("Undid changes, Switched")." $filebak ".&mt("and")." $file
"); } else { - $request->print("".&mt("Unable to undo, unable to switch")." $filebak ".&mt("and")." $file
"); + &Apache::lonxml::info("".&mt("Unable to undo, unable to switch")." $filebak ".&mt("and")." $file
"); $error=1; } } else { my $fs=Apache::File->new(">$filebak"); if (defined($fs)) { print $fs $$problem; - $request->print("".&mt("Making Backup to"). - " $filebak