--- loncom/homework/structuretags.pm 2003/10/09 21:49:24 1.215 +++ loncom/homework/structuretags.pm 2003/10/13 21:09:47 1.216 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.215 2003/10/09 21:49:24 albertel Exp $ +# $Id: structuretags.pm,v 1.216 2003/10/13 21:09:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -400,7 +400,8 @@ sub start_problem { if (( $status eq 'CLOSED' ) || ( $status eq 'UNCHECKEDOUT') || ( $status eq 'BANNED') || - ( $status eq 'UNAVAILABLE')) { + ( $status eq 'UNAVAILABLE') || + ( $status eq 'INVALID_ACCESS')) { my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser); if ( $target eq "web" ) { $result.= $head_tag_start.''; @@ -410,7 +411,7 @@ sub start_problem { } else { $result.='

'.&mt('Not open to be viewed').'

'; } - if ($status eq 'CLOSED') { + if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { $msg.='The problem '.$accessmsg; } elsif ($status eq 'UNCHECKEDOUT') { $msg.=&checkout_msg; @@ -442,7 +443,8 @@ sub start_problem { } } } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' - || $status eq 'CLOSED' || $status eq 'UNAVALAILABLE') { + || $status eq 'CLOSED' || $status eq 'UNAVALAILABLE' || + $status eq 'INVALID_ACCESS') { $result.=$head_tag_start. "$name\n$body_tag_start\n"; } @@ -539,7 +541,7 @@ sub end_problem { $result.="\n"; } } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || - $status eq 'UNCHECKEDOUT' ) { + $status eq 'UNCHECKEDOUT' || $status eq 'INVALID_ACCESS') { if ($target ne 'tex' && $ENV{'form.answer_output_mode'} ne 'tex') { $result.="\n"; @@ -955,7 +957,11 @@ sub start_part { my $expression='$external::datestatus="'.$status.'";'; $expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$id.solved"}.'";'; &Apache::run::run($expression,$safeeval); - if ( $status eq 'CLOSED' ) { + if (( $status eq 'CLOSED' ) || + ( $status eq 'UNCHECKEDOUT') || + ( $status eq 'BANNED') || + ( $status eq 'UNAVAILABLE') || + ( $status eq 'INVALID_ACCESS')) { my $bodytext=&Apache::lonxml::get_all_text("/part",$parser); if ( $target eq "web" ) { $result="
".&mt('Part is not open to be viewed. It')." $accessmsg
";