--- loncom/homework/structuretags.pm 2004/05/27 04:32:19 1.251 +++ loncom/homework/structuretags.pm 2004/05/27 22:25:16 1.252 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.251 2004/05/27 04:32:19 albertel Exp $ +# $Id: structuretags.pm,v 1.252 2004/05/27 22:25:16 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -334,6 +334,17 @@ sub checkout_msg { ENDCHECKOUT } +sub firstaccess_msg { + my ($time)=@_; + return (<This resource is open for a limited time, once you click the 'Show Resource' button below you have $time to complete all resources in this sequence. +
+ + +
+ENDCHECKOUT +} + sub init_problem_globals { my ($type)=@_; #initialize globals @@ -458,7 +469,9 @@ sub start_problem { } $body_tag_start.=&Apache::lonxml::printtokenheader($target,$token); } - + if ($ENV{'form.markaccess'}) { + &Apache::lonnet::set_first_access('map'); + } #handle rand seed in construction space my $rndseed=&setup_rndseed($safeeval); my ($symb)=&Apache::lonxml::whichuser(); @@ -478,6 +491,7 @@ sub start_problem { &Apache::lonxml::debug("Got $status"); if (( $status eq 'CLOSED' ) || ( $status eq 'UNCHECKEDOUT') || + ( $status eq 'NOT_YET_VIEWED') || ( $status eq 'BANNED') || ( $status eq 'UNAVAILABLE') || ( $status eq 'INVALID_ACCESS')) { @@ -494,6 +508,8 @@ sub start_problem { $msg.='The problem '.$accessmsg; } elsif ($status eq 'UNCHECKEDOUT') { $msg.=&checkout_msg; + } elsif ($status eq 'NOT_YET_VIEWED') { + $msg.=&firstaccess_msg($accessmsg); } $result.=$msg.'
'; } elsif ($target eq 'tex') { @@ -603,7 +619,7 @@ sub end_problem { } } elsif ( ($target eq 'web' || $target eq 'tex') && $Apache::inputtags::part eq '0' && - $status ne 'UNCHECKEDOUT') { + $status ne 'UNCHECKEDOUT' && $status ne 'NOT_YET_VIEWED') { # if part is zero, no s existed, so we need show the current # grading status my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part,$target); @@ -1037,6 +1053,7 @@ sub start_part { } if (( $status eq 'CLOSED' ) || ( $status eq 'UNCHECKEDOUT') || + ( $status eq 'NOT_YET_VIEWED') || ( $status eq 'BANNED') || ( $status eq 'UNAVAILABLE') || ( $status eq 'INVALID_ACCESS')) {