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

raeburn raeburn at source.lon-capa.org
Wed Aug 7 22:12:52 EDT 2013


raeburn		Thu Aug  8 02:12:52 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    - Backport 1.1143.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.42 loncom/interface/loncommon.pm:1.1075.2.43
--- loncom/interface/loncommon.pm:1.1075.2.42	Sat Aug  3 22:32:01 2013
+++ loncom/interface/loncommon.pm	Thu Aug  8 02:12:52 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.42 2013/08/03 22:32:01 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.43 2013/08/08 02:12:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -14565,6 +14565,30 @@
     return $title;
 }
 
+sub recurse_supplemental {
+    my ($cnum,$cdom,$suppmap,$numfiles,$errors) = @_;
+    if ($suppmap) {
+        my ($errtext,$fatal) = &LONCAPA::map::mapread('/uploaded/'.$cdom.'/'.$cnum.'/'.$suppmap);
+        if ($fatal) {
+            $errors ++;
+        } else {
+            if ($#LONCAPA::map::resources > 0) {
+                foreach my $res (@LONCAPA::map::resources) {
+                    my ($title,$src,$ext,$type,$status)=split(/\:/,$res);
+                    if (($src ne '') && ($status eq 'res')) {
+                        if ($src =~ m{^\Q/uploaded/$cdom/$cnum/\E(supplemental_/d+\.sequence)$}) {
+                            $numfiles = &recurse_supplemental($cnum,$cdom,$1,$numfiles);
+                        } else {
+                            $numfiles ++;
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return ($numfiles,$errors);
+}
+
 sub symb_to_docspath {
     my ($symb) = @_;
     return unless ($symb);




More information about the LON-CAPA-cvs mailing list