--- loncom/homework/structuretags.pm 2007/10/31 17:40:01 1.409
+++ 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.409 2007/10/31 17:40:01 albertel Exp $
+# $Id: structuretags.pm,v 1.414 2007/11/20 17:53:22 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -324,8 +324,22 @@ sub problem_edit_header {
}
sub problem_edit_footer {
- return '
- '.
+ return '
+
+'.
+
&Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()).
"\n\n".&Apache::loncommon::end_page();
}
@@ -606,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 {
@@ -723,7 +756,7 @@ sub start_problem {
if ($target ne 'analyze') {
$Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');
if (($env{'request.state'} eq 'construct') &&
- defined($env{'form.problemtype'})) {
+ $env{'form.problemtype'} =~ /\S/) {
$Apache::lonhomework::type=$env{'form.problemtype'};
}
&Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:");
@@ -784,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);