--- loncom/homework/structuretags.pm 2001/08/17 14:24:29 1.55
+++ loncom/homework/structuretags.pm 2001/08/20 19:27:26 1.64
@@ -2,7 +2,7 @@
# definition of tags that give a structure to a document
# 2/19 Guy
# 6/26/2001 fixed extra web display at end of tags
-# 8/17 Gerd Kortemeyer
+# 8/17,8/18,8/20 Gerd Kortemeyer
package Apache::structuretags;
@@ -82,6 +82,7 @@ sub start_problem {
&Apache::lonxml::debug("Using default type, problem, :$uri:");
}
}
+
#adeed vars to the scripting enviroment
my $expression='$external::part='.$Apache::inputtags::part.';';
&Apache::run::run($expression,$safeeval);
@@ -92,6 +93,16 @@ sub start_problem {
my ($result,$head_tag_start,$body_tag_start)=
&page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
+ if ($Apache::lonhomework::type eq 'exam') {
+ if ($target eq 'web') {
+ my $token=$Apache::lonhomework::history{"resource.0.outtoken"};
+ if (($ENV{'form.doescheckout'}) && (!$token)) {
+ $token=&Apache::lonxml::maketoken();
+ $Apache::lonhomework::history{"resource.0.outtoken"}=$token;
+ }
+ $body_tag_start.=&Apache::lonxml::printtokenheader($target,$token);
+ }
+ }
if ($target eq 'web' || $target eq 'grade') {
($status,$accessmsg) = &Apache::lonhomework::check_access('0');
push (@Apache::inputtags::status,$status);
@@ -109,7 +120,20 @@ sub start_problem {
if ($status eq 'CLOSED') {
$msg.='The problem '.$accessmsg;
} elsif ($status eq 'UNCHECKEDOUT') {
- $msg.='The resource needs to be checked out';
+ $msg.=(<The resource needs to be checked out
+As a resource gets checked out, a unique timestamped ID is given to it, and a
+permanent record is left in the system.
+
+Checking out resources is subject to course policies, and may exclude future
+credit even if done erroneously.
+
+
+ENDCHECKOUT
}
return $result.$msg.'
';
}