[LON-CAPA-cvs] cvs: loncom /homework grades.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Sun, 15 Apr 2007 18:25:57 -0000


banghart		Sun Apr 15 14:25:57 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Add download all submitted documents link for essay grading.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.393 loncom/homework/grades.pm:1.394
--- loncom/homework/grades.pm:1.393	Wed Mar 14 19:39:39 2007
+++ loncom/homework/grades.pm	Sun Apr 15 14:25:56 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.393 2007/03/14 23:39:39 albertel Exp $
+# $Id: grades.pm,v 1.394 2007/04/15 18:25:56 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1626,7 +1626,27 @@
     $result.='</td></tr></table><br />';
     return $result;
 }
-
+sub download_all_link {
+    my ($r,$symb) = @_;
+    my $courseid=$env{'request.course.id'};
+    my @stuchecked = &Apache::loncommon::get_env_multiple('form.stuinfo');
+    my $parts;
+    my $total      = scalar(@stuchecked)-1;
+    my $all_students;
+    foreach my $stu_info (@stuchecked) {
+        $all_students .= $stu_info."\n";
+    }
+    foreach my $part (&Apache::loncommon::get_env_multiple('form.vPart')) {
+        $parts .= $part."\n";
+    }
+    my $identifier = &Apache::loncommon::get_cgi_id();
+    &Apache::lonnet::appenv('cgi.'.$identifier.'.students' => $all_students,
+                            'cgi.'.$identifier.'.symb' => $symb,
+                            'cgi.'.$identifier.'.parts' => $parts,
+                            'cgi.'.$identifier.'.courseid' => $courseid);
+    $r->print('<a href="/cgi-bin/multidownload.pl?'.$identifier.'">Download All Submitted Documents</a>');
+    return
+}
 # --------------------------- show submissions of a student, option to grade 
 sub submission {
     my ($request,$counter,$total) = @_;
@@ -1661,7 +1681,7 @@
 	&sub_page_kw_js($request) if ($env{'form.handgrade'} eq 'yes');
 	$env{'form.probTitle'} = $env{'form.probTitle'} eq '' ? 
 	    &Apache::lonnet::gettitle($symb) : $env{'form.probTitle'};
-
+	&download_all_link($request,$symb);
 	$request->print('<h3>&nbsp;<font color="#339933">Submission Record</font></h3>'."\n".
 			'<font size=+1>&nbsp;<b>Resource: </b>'.$env{'form.probTitle'}.'</font>'."\n");
 
@@ -6130,6 +6150,10 @@
 	}
     } else {
 	&init_perm();
+	&Apache::lonnet::logthis("command is $command");
+	foreach my $key (keys %perm) {
+	    &Apache::lonnet::logthis("key is $key");
+	}
 	if ($command eq 'submission' && $perm{'vgr'}) {
 	    ($env{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
 	} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {