version 1.163, 2004/02/13 21:21:30
|
version 1.165, 2004/02/16 17:20:39
|
Line 201 sub check_access {
|
Line 201 sub check_access {
|
my $passed; |
my $passed; |
|
|
if ($ENV{'request.state'} eq "construct") { |
if ($ENV{'request.state'} eq "construct") { |
|
if (defined($ENV{'form.problemstatus'})) { |
|
if ($ENV{'form.problemstate'} =~ /^CANNOT_ANSWER/) { |
|
return ('CANNOT_ANSWER','is in this state by royal decree.'); |
|
} else { |
|
return ($ENV{'form.problemstate'}, |
|
'is in this state by royal decree.'); |
|
} |
|
} |
&Apache::lonxml::debug("in construction ignoring dates"); |
&Apache::lonxml::debug("in construction ignoring dates"); |
$status='CAN_ANSWER'; |
$status='CAN_ANSWER'; |
$datemsg=&mt('is in under construction'); |
$datemsg=&mt('is in under construction'); |
Line 267 sub check_access {
|
Line 275 sub check_access {
|
my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; |
my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; |
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); |
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); |
if ( $tries eq '' ) { $tries = '0'; } |
if ( $tries eq '' ) { $tries = '0'; } |
if ( $maxtries eq '' ) { $maxtries = '2'; } |
if ( $maxtries eq '' && |
if ($tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
$ENV{'request.state'} ne 'construct') { $maxtries = '2'; } |
|
if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
# if (correct and show prob status) or excused then CANNOT_ANSWER |
# if (correct and show prob status) or excused then CANNOT_ANSWER |
if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/ |
if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/ |
&& |
&& |