--- loncom/homework/structuretags.pm 2007/11/13 23:33:01 1.413 +++ loncom/homework/structuretags.pm 2007/11/20 17:53:22 1.414 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.413 2007/11/13 23:33:01 albertel Exp $ +# $Id: structuretags.pm,v 1.414 2007/11/20 17:53:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -620,17 +620,36 @@ ENDCHECKOUT sub firstaccess_msg { my ($time,$symb)=@_; - my ($map)=&Apache::lonnet::decode_symb($symb); - my $foldertitle=&Apache::lonnet::gettitle($map); - &Apache::lonxml::debug("map is $map title is $foldertitle"); - my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); - return (<The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle". +ENDCHECKOUT + } elsif ($interval[1] eq 'course') { + my $course = $env{'course.'.$env{'request.course.id'}.'.description'}; + $result .= (<The resources in "$course" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources in "$course". +ENDCHECKOUT + } else { + my $title=&Apache::lonnet::gettitle($symb); + $result .= (<This resource "$title" is open for a limited time. Once you click the 'Show Resource' button below you have $time to complete this resource "$title". +ENDCHECKOUT + + } + my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); + $result .= (< ENDCHECKOUT + return $result; } sub init_problem_globals { @@ -798,7 +817,8 @@ sub start_problem { $result.=&Apache::lonxml::printtokenheader($target,$token); } if ($env{'form.markaccess'}) { - &Apache::lonnet::set_first_access('map'); + my @interval=&Apache::lonnet::EXT("resource.0.interval"); + &Apache::lonnet::set_first_access($interval[1]); } #handle rand seed in construction space my $rndseed=&setup_rndseed($safeeval);