--- loncom/interface/multidownload.pl 2007/04/30 18:22:39 1.22 +++ loncom/interface/multidownload.pl 2007/04/30 22:47:28 1.23 @@ -2,7 +2,7 @@ # CGI-script to allow download of all essay submissions of # multiple students. # -# $Id: multidownload.pl,v 1.22 2007/04/30 18:22:39 banghart Exp $ +# $Id: multidownload.pl,v 1.23 2007/04/30 22:47:28 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,7 +74,7 @@ if (&Apache::lonnet::allowed('vgr',$scop my $partlist = $res->parts(); my ($zipout) = ($symb =~ /^.*\/(.+)\.problem$/); $zipout =~ s/\s/_/g; - $zipout .= ".zip"; + $zipout .= "$identifier.zip"; my $courseid = $env{'request.course.id'}; my @stuchecked = split(/\n/,$env{'cgi.'.$identifier.'.students'}); my @parts = split(/\n/,$env{'cgi.'.$identifier.'.parts'}); @@ -125,9 +125,15 @@ if (&Apache::lonnet::allowed('vgr',$scop } &mkpath($doc_zip_root."/zipout/$unique_user",0,0700); - my $statement = "cd $doc_zip_root/zipdir/$unique_user/$unique_path\n"; - $statement .= "zip -r $doc_zip_root/zipout/$unique_user/$zipout * > /dev/null"; - system($statement); + my $statement; + if (! -e "$doc_zip_root/zipout/$unique_user/$zipout") { + $statement = "cd $doc_zip_root/zipdir/$unique_user/$unique_path\n"; + $statement .= "zip -r $doc_zip_root/zipout/$unique_user/$zipout * > /dev/null"; + system($statement); + } else { + # should happen only if user reloads page + &Apache::lonnet::logthis("$zipout is already there"); + } $statement = "rm -rf $doc_zip_root/zipdir/$unique_user/$unique_path"; system($statement); print(''.