[LON-CAPA-cvs] cvs: loncom /interface multidownload.pl

banghart lon-capa-cvs-allow@mail.lon-capa.org
Fri, 27 Apr 2007 22:16:23 -0000


banghart		Fri Apr 27 18:16:23 2007 EDT

  Modified files:              
    /loncom/interface	multidownload.pl 
  Log:
  	Do better.
  
  
Index: loncom/interface/multidownload.pl
diff -u loncom/interface/multidownload.pl:1.16 loncom/interface/multidownload.pl:1.17
--- loncom/interface/multidownload.pl:1.16	Fri Apr 27 18:07:19 2007
+++ loncom/interface/multidownload.pl	Fri Apr 27 18:16:22 2007
@@ -2,7 +2,7 @@
 # CGI-script to allow download of all essay submissions of 
 # multiple students.
 #
-# $Id: multidownload.pl,v 1.16 2007/04/27 22:07:19 banghart Exp $
+# $Id: multidownload.pl,v 1.17 2007/04/27 22:16:22 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -73,7 +73,7 @@
     
     my $navmap = Apache::lonnavmaps::navmap->new();
     my $res = $navmap->getBySymb($symb);
-
+    &Apache::lonnet::logthis("$navmap is navmap");
 
     my ($zipout) = ($symb =~ /^.*\/(.+)\.problem$/);
     $zipout =~ s/\s/_/g;
@@ -99,8 +99,7 @@
             &mkpath($doc_zip_root."/zipdir/$unique_user/$unique_path/$stuname/part$partid/resp$respid",0,0700);
             my $files = &Apache::grades::get_submitted_files($studom,$stuname,$partid,$respid,\%record);
             foreach my $file (@$files) {
-                $file =~ /(^.*\/)(.+$)/;
-                my $file_name_only = $2;
+                my ($file_name_only) = ($file =~ /^.*\/(.+$)/);
                 &Apache::lonnet::repcopy($file);
                 my $source = &Apache::lonnet::filelocation("",$file);
                 my $destination = "$doc_zip_root/zipdir/$unique_user/$unique_path/$stuname/part$partid/resp$respid/$file_name_only";