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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 13 Feb 2006 22:11:55 -0000


banghart		Mon Feb 13 17:11:55 2006 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Add response id to info about handback files.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.311 loncom/homework/grades.pm:1.312
--- loncom/homework/grades.pm:1.311	Tue Feb  7 09:18:18 2006
+++ loncom/homework/grades.pm	Mon Feb 13 17:11:51 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.311 2006/02/07 14:18:18 banghart Exp $
+# $Id: grades.pm,v 1.312 2006/02/13 22:11:51 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1814,6 +1814,7 @@
 				$lastsubonly.='<br /><a href="'.$file.'" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>';
 				$lastsubonly.=' Return commented document to student. <input type="file" name="part'.$partid.'_returndoc';
 				$lastsubonly.=$file_counter.'" />'."\n";
+				$lastsubonly.='<input type="hidden" name="respid" value="'.$respid.'" />';
 				$lastsubonly.='<input type="hidden" name="returndocorig'.$file_counter.'" value="'.$file.'" />';
 
 			    }
@@ -2224,7 +2225,6 @@
     my @parts = split(/:/,$env{'form.partlist'.$newflg});
     foreach my $new_part (@parts) {
 	#collaborator may vary for different parts
-	$request->print('form.part'.$new_part.'_returndoc1');
 	if ($submitter && $new_part ne $part) { next; }
 	my $dropMenu = $env{'form.GD_SEL'.$newflg.'_'.$new_part};
 	if ($dropMenu eq 'excused') {
@@ -2305,9 +2305,10 @@
     #	        	 'portfolio'.$env{'form.currentpath'});
     
             my $file_counter = 1;
+            my $respid = $env{'form.respid'};
             while ($env{'form.part'.$new_part.'_returndoc'.$file_counter}) {
                 my $fname=$env{'form.returndoc'.$file_counter.'.filename'};
-                $newrecord{'resource.'.$new_part.'.handback'} = $env{'form.returndocorig'.$file_counter};
+                $newrecord{"resource.$new_part.$respid.handback"} = $env{'form.returndocorig'.$file_counter};
                 $request->print("<br />".$fname." will be the uploaded file name");
                 $request->print("<font color=\"red\">Will upload document</font>".$env{'form.returndocorig'.$file_counter});
                 $file_counter++;