[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Sun Jun 25 21:34:33 EDT 2017


raeburn		Mon Jun 26 01:34:33 2017 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - For blocking events triggered by activating timer, need to check if
    activity is among those for which blocking is in effect.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1280 loncom/interface/loncommon.pm:1.1281
--- loncom/interface/loncommon.pm:1.1280	Tue May 23 03:07:36 2017
+++ loncom/interface/loncommon.pm	Mon Jun 26 01:34:32 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1280 2017/05/23 03:07:36 raeburn Exp $
+# $Id: loncommon.pm,v 1.1281 2017/06/26 01:34:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5187,13 +5187,19 @@
                 my $end = $start + $env{'course.'.$cdom.'_'.$cnum.'.timerinterval.'.$timersymb}; 
                 if ($start && $end) {
                     if (($start <= time) && ($end >= time)) {
-                        unless (grep(/^\Q$block\E$/, at blockers)) {
-                            push(@blockers,$block);
-                            $triggered{$block} = {
-                                                   start => $start,
-                                                   end   => $end,
-                                                   type  => $type,
-                                                 };
+                        if (ref($commblocks{$block}) eq 'HASH') {
+                            if (ref($commblocks{$block}{'blocks'}) eq 'HASH') {
+                                if ($commblocks{$block}{'blocks'}{$activity} eq 'on') {
+                                    unless(grep(/^\Q$block\E$/, at blockers)) {
+                                        push(@blockers,$block);
+                                        $triggered{$block} = {
+                                                               start => $start,
+                                                               end   => $end,
+                                                               type  => $type,
+                                                             };
+                                    }
+                                }
+                            }
                         }
                     }
                 }




More information about the LON-CAPA-cvs mailing list