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

raeburn raeburn at source.lon-capa.org
Sat Jan 21 14:52:29 EST 2017


raeburn		Sat Jan 21 19:52:29 2017 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - For resources already checked into a slot (now past its end time),
    check for use of unique time periods in used slot, when checking for other
    reservable (future) slots.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.551 loncom/homework/structuretags.pm:1.552
--- loncom/homework/structuretags.pm:1.551	Fri Dec  9 20:12:09 2016
+++ loncom/homework/structuretags.pm	Sat Jan 21 19:52:24 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.551 2016/12/09 20:12:09 damieng Exp $
+# $Id: structuretags.pm,v 1.552 2017/01/21 19:52:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1539,10 +1539,6 @@
             my ($timelimit) = split(/_/,$interval[0]);
             &Apache::lonnet::set_first_access($interval[1],$timelimit);
         }
-
-        ($status,$accessmsg,$slot_name,$slot,$ipused) =
-            &Apache::lonhomework::check_slot_access('0','problem');
-        push (@Apache::inputtags::status,$status);
     }
 
     if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex'
@@ -1550,7 +1546,8 @@
 	($result,$form_tag_start,$probpartlist) =
 	    &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval,
 			$name);
-    } elsif (($target eq 'grade') && ($Apache::lonhomework::type eq 'randomizetry')) {
+    } elsif ((($target eq 'grade') && ($Apache::lonhomework::type eq 'randomizetry')) ||
+             ($target eq 'answer')) {
         my ($symb)= &Apache::lonnet::whichuser();
         my $navmap = Apache::lonnavmaps::navmap->new();
         if (ref($navmap)) {
@@ -1561,6 +1558,15 @@
         }
     }
 
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
+        $target eq 'tex') {
+
+        my ($symb)= &Apache::lonnet::whichuser();
+        ($status,$accessmsg,$slot_name,$slot,$ipused) =
+            &Apache::lonhomework::check_slot_access('0','problem',$symb,$probpartlist);
+        push (@Apache::inputtags::status,$status);
+    }
+
     if ($target eq 'tex' and $env{'request.symb'} =~ m/\.page_/) {$result='';}
 
     if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); }




More information about the LON-CAPA-cvs mailing list