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

raeburn raeburn at source.lon-capa.org
Tue Apr 14 23:28:20 EDT 2015


raeburn		Wed Apr 15 03:28:20 2015 EDT

  Modified files:              
    /loncom/interface	lonblockingmenu.pm 
  Log:
  - Sanity checking -- delete hash items with "empty" keys.  
  
  
Index: loncom/interface/lonblockingmenu.pm
diff -u loncom/interface/lonblockingmenu.pm:1.13 loncom/interface/lonblockingmenu.pm:1.14
--- loncom/interface/lonblockingmenu.pm:1.13	Thu Jun 12 00:33:41 2014
+++ loncom/interface/lonblockingmenu.pm	Wed Apr 15 03:28:19 2015
@@ -2,7 +2,7 @@
 # Routines for configuring blocking of access to collaborative functions, 
 # and specific resources during an exam
 #
-# $Id: lonblockingmenu.pm,v 1.13 2014/06/12 00:33:41 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.14 2015/04/15 03:28:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -913,6 +913,9 @@
                     if (ref($symb_ref) eq 'HASH') {
                         my %resources = map { $symb_ref->{$_} => 1; } 
                                             (split(/,/,$env{'form.docs_resources_'.$item}));
+                        if (exists($resources{''})) {
+                            delete($resources{''});
+                        }
                         $blocklist->{$type}->{resources} = \%resources;
                         if (keys(%resources) > 0) {
                             $blockdocs = 1;
@@ -924,6 +927,9 @@
                     if (ref($map_ref) eq 'HASH') {
                         my %maps = map { $map_ref->{$_} => 1; }                             
                                        (split(/,/,$env{'form.docs_maps_'.$item}));
+                        if (exists($maps{''})) {
+                            delete($maps{''});
+                        }
                         $blocklist->{$type}->{maps} = \%maps;
                         if (keys(%maps) > 0) {
                             $blockdocs = 1;




More information about the LON-CAPA-cvs mailing list