--- loncom/homework/lonhomework.pm 2004/02/13 21:27:22 1.164
+++ loncom/homework/lonhomework.pm 2004/04/16 19:10:27 1.173
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.164 2004/02/13 21:27:22 albertel Exp $
+# $Id: lonhomework.pm,v 1.173 2004/04/16 19:10:27 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,6 +202,18 @@ sub check_access {
my $passed;
if ($ENV{'request.state'} eq "construct") {
+ if ($ENV{'form.problemstate'}) {
+ if ($ENV{'form.problemstate'} =~ /^CANNOT_ANSWER/) {
+ 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'},
+ &mt('is in this state by royal decree.'));
+ }
+ }
&Apache::lonxml::debug("in construction ignoring dates");
$status='CAN_ANSWER';
$datemsg=&mt('is in under construction');
@@ -386,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("