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

raeburn raeburn at source.lon-capa.org
Thu Nov 1 15:39:29 EDT 2018


raeburn		Thu Nov  1 19:39:29 2018 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	structuretags.pm 
  Log:
  - For 2.11
    Backport 1.561 (modified).
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.512.2.15 loncom/homework/structuretags.pm:1.512.2.16
--- loncom/homework/structuretags.pm:1.512.2.15	Fri Sep 14 23:09:43 2018
+++ loncom/homework/structuretags.pm	Thu Nov  1 19:39:28 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.512.2.15 2018/09/14 23:09:43 raeburn Exp $
+# $Id: structuretags.pm,v 1.512.2.16 2018/11/01 19:39:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1526,13 +1526,16 @@
     my $resource_due;
 
     my $name= &get_resource_name($parstack,$safeeval);
-    my ($result,$form_tag_start,$slot_name,$slot,$probpartlist);
+    my ($result,$form_tag_start,$slot_name,$slot,$probpartlist,$firstaccres);
 
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
         $target eq 'tex') {
         if ($env{'form.markaccess'}) {
             my @interval=&Apache::lonnet::EXT("resource.0.interval");
-            &Apache::lonnet::set_first_access($interval[1],$interval[0]);
+            my $is_set = &Apache::lonnet::set_first_access($interval[1],$interval[0]);
+            unless (($is_set eq 'ok') || ($is_set eq 'already_set')) {
+                $firstaccres = $is_set;
+            }
         }
 
         ($status,$accessmsg,$slot_name,$slot) =
@@ -1646,6 +1649,10 @@
 		} elsif ($status eq 'UNCHECKEDOUT') {
 		    $msg.=&checkout_msg();
 		} elsif ($status eq 'NOT_YET_VIEWED') {
+                    if ($firstaccres) {
+                        $msg .= '<p class="LC_error">'.
+                                &mt('A problem occurred when trying to start the timer.').'</p>';
+                    }
 		    $msg.=&firstaccess_msg($accessmsg,$symb);
 		} elsif ($status eq 'NOT_IN_A_SLOT') {
 		    $msg.=&Apache::bridgetask::add_request_another_attempt_button("Sign up for time to work");




More information about the LON-CAPA-cvs mailing list