[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 28 May 2004 19:26:05 -0000


albertel		Fri May 28 15:26:05 2004 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - updating the warning messages according to Felicia suggestions
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.252 loncom/homework/structuretags.pm:1.253
--- loncom/homework/structuretags.pm:1.252	Thu May 27 18:25:16 2004
+++ loncom/homework/structuretags.pm	Fri May 28 15:26:05 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.252 2004/05/27 22:25:16 albertel Exp $
+# $Id: structuretags.pm,v 1.253 2004/05/28 19:26:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -335,9 +335,12 @@
 }
 
 sub firstaccess_msg {
-    my ($time)=@_;
+    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");
     return (<<ENDCHECKOUT);
-<h2>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.</h2>
+<h2>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".</h2>
 <form name="markaccess" method="POST" action="$ENV{'request.uri'}">
 <input type="hidden" name="markaccess" value="yes" />
 <input type="button" name="accessbutton" value="Show Resource" onClick="javascript:if (confirm('Start Timer?')) { document.markaccess.submit(); }" />
@@ -501,7 +504,7 @@
 		my $msg=$body_tag_start;
 		if ($status eq 'UNAVAILABLE') {
 		    $msg.='<h1>'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</h1>';
-		} else {
+		} elsif ($status ne 'NOT_YET_VIEWED') {
 		    $msg.='<h1>'.&mt('Not open to be viewed').'</h1>';
 		}
 		if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') {
@@ -509,7 +512,7 @@
 		} elsif ($status eq 'UNCHECKEDOUT') {
 		    $msg.=&checkout_msg;
 		} elsif ($status eq 'NOT_YET_VIEWED') {
-		    $msg.=&firstaccess_msg($accessmsg);
+		    $msg.=&firstaccess_msg($accessmsg,$symb);
 		}
 		$result.=$msg.'<br />';
 	    } elsif ($target eq 'tex') {