[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm structuretags.pm /interface lonmenu.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Mon Sep 14 09:45:37 EDT 2015


raeburn		Mon Sep 14 13:45:37 2015 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
    /loncom/homework	structuretags.pm lonhomework.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Bug 6763. If interval ("Time-Limit") parameter has "_done" appended to
    the time limit in seconds, the "done" button will be displayed.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.436 loncom/interface/lonmenu.pm:1.437
--- loncom/interface/lonmenu.pm:1.436	Fri Jul 17 19:11:06 2015
+++ loncom/interface/lonmenu.pm	Mon Sep 14 13:45:01 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.436 2015/07/17 19:11:06 raeburn Exp $
+# $Id: lonmenu.pm,v 1.437 2015/09/14 13:45:01 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2286,10 +2286,12 @@
         }
         my $duedate = &Apache::lonnet::EXT("resource.0.duedate");
         my @interval=&Apache::lonnet::EXT("resource.0.interval");
+        my ($timelimit,$usesdone);
         if (@interval > 1) {
+            ($timelimit,$usesdone) = split(/_/,$interval[0]); 
             my $first_access=&Apache::lonnet::get_first_access($interval[1]);
             if ($first_access > 0) {
-                if ($first_access+$interval[0] > time) {
+                if ($first_access+$timelimit > time) {
                     $hastimeleft = 1;
                 }
             }
@@ -2303,7 +2305,9 @@
                 $currdisp = 'inline';
                 $collapse = '► ';
                 if ((@interval > 1) && ($hastimeleft)) {
-                    $donebutton = &done_button_js($interval[1]);
+                    if ($usesdone eq 'done') {
+                        $donebutton = &done_button_js($interval[1]);
+                    }
                 }
             } else {
                 $currdisp = 'none';
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.538 loncom/homework/structuretags.pm:1.539
--- loncom/homework/structuretags.pm:1.538	Thu Jun 18 20:18:54 2015
+++ loncom/homework/structuretags.pm	Mon Sep 14 13:45:19 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.538 2015/06/18 20:18:54 musolffc Exp $
+# $Id: structuretags.pm,v 1.539 2015/09/14 13:45:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1518,7 +1518,8 @@
         $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 ($timelimit) = split(/_/,$interval[0]);
+            &Apache::lonnet::set_first_access($interval[1],$timelimit);
         }
 
         ($status,$accessmsg,$slot_name,$slot) =
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.356 loncom/homework/lonhomework.pm:1.357
--- loncom/homework/lonhomework.pm:1.356	Fri Jul 17 19:11:09 2015
+++ loncom/homework/lonhomework.pm	Mon Sep 14 13:45:19 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.356 2015/07/17 19:11:09 raeburn Exp $
+# $Id: lonhomework.pm,v 1.357 2015/09/14 13:45:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1368,7 +1368,8 @@
             my $now = time;
             my $first_access=&Apache::lonnet::get_first_access($interval[1],$symb);
             if ($first_access > 0) {
-                if ($first_access+$interval[0] > $now) {
+                my ($timelimit) = split(/_/,$interval[0]);
+                if ($first_access+$timelimit > $now) {
                     my $done_time = $now - $first_access;
                     my $snum = 1;
                     if ($interval[1] eq 'map') {
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1291 loncom/lonnet/perl/lonnet.pm:1.1292
--- loncom/lonnet/perl/lonnet.pm:1.1291	Mon Aug 10 15:18:21 2015
+++ loncom/lonnet/perl/lonnet.pm	Mon Sep 14 13:45:36 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1291 2015/08/10 15:18:21 raeburn Exp $
+# $Id: lonnet.pm,v 1.1292 2015/09/14 13:45:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7386,7 +7386,8 @@
                             }
                         }
                     }
-                    if ($interval[0] =~ /^\d+$/) {
+                    if ($interval[0] =~ /^\d+/) {
+                        my ($timelimit) = split(/_/,$interval[0]);
                         my $first_access;
                         if ($type eq 'resource') {
                             $first_access=&get_first_access($interval[1],$item);
@@ -7396,7 +7397,7 @@
                             $first_access=&get_first_access($interval[1]);
                         }
                         if ($first_access) {
-                            my $timesup = $first_access+$interval[0];
+                            my $timesup = $first_access+$timelimit;
                             if ($timesup > $now) {
                                 my $activeblock;
                                 foreach my $res (@to_test) {




More information about the LON-CAPA-cvs mailing list