--- loncom/interface/multidownload.pl 2007/04/26 18:30:38 1.9
+++ loncom/interface/multidownload.pl 2007/04/26 19:13:26 1.10
@@ -2,7 +2,7 @@
# CGI-script to allow download of all essay submissions of
# multiple students.
#
-# $Id: multidownload.pl,v 1.9 2007/04/26 18:30:38 banghart Exp $
+# $Id: multidownload.pl,v 1.10 2007/04/26 19:13:26 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -70,6 +70,9 @@ if ($env{'request.course.sec'}) {
}
if (&Apache::lonnet::allowed('vgr',$scope) eq 'F') {
my $symb = $env{'cgi.'.$identifier.'.symb'};
+ $symb =~ /^.*\/(.+)\.problem$/;
+ my $zipout = $1.".zip";
+ $zipout =~ s/\s/_/g;
my $courseid = $env{'request.course.id'};
my @stuchecked = split(/\n/,$env{'cgi.'.$identifier.'.students'});
my @parts = split(/\n/,$env{'cgi.'.$identifier.'.parts'});
@@ -106,11 +109,11 @@ if (&Apache::lonnet::allowed('vgr',$scop
}
mkdir($doc_zip_root."/zipout/$uname$udom",0700);
my $statement = "cd $doc_zip_root/zipdir/$uname$udom/$unique_path\n";
- $statement .= "zip -r $doc_zip_root/zipout/$uname$udom/output.zip * > /dev/null";
+ $statement .= "zip -r $doc_zip_root/zipout/$uname$udom/$zipout * > /dev/null";
system($statement);
$statement = "rm -rf $doc_zip_root/zipdir/$uname$udom/$unique_path";
system($statement);
- print('Click to download
');
+ print('Click to download
');
} else {
print('You are not authorized to download student submissions.');
}