--- loncom/homework/grades.pm 2006/02/06 23:39:44 1.309
+++ loncom/homework/grades.pm 2006/02/07 13:38:16 1.310
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.309 2006/02/06 23:39:44 albertel Exp $
+# $Id: grades.pm,v 1.310 2006/02/07 13:38:16 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1812,7 +1812,8 @@ KEYWORDS
$file_counter ++;
&Apache::lonnet::allowuploaded('/adm/grades',$file);
$lastsubonly.='
'.$file.'';
- $lastsubonly.='Return commented document to student. '."\n";
+ $lastsubonly.=' Return commented document to student. '."\n";
$lastsubonly.='';
}
@@ -2029,32 +2030,21 @@ sub processHandGrade {
my @collabstrs=&Apache::loncommon::get_env_multiple("form.collaborator$ctr");
foreach my $collabstr (@collabstrs) {
my ($part,@collaborators) = split(/:/,$collabstr);
- foreach (@collaborators) {
+ foreach my $collaborator (@collaborators) {
my ($errorflag,$pts,$wgt) =
- &saveHandGrade($request,$url,$symb,$_,$udom,$ctr,
+ &saveHandGrade($request,$url,$symb,$collaborator,$udom,$ctr,
$env{'form.unamedom'.$ctr},$part);
if ($errorflag eq 'not_allowed') {
- $request->print("Not allowed to modify grades for $_:$udom");
+ $request->print("Not allowed to modify grades for $collaborator:$udom");
next;
} else {
if ($message ne '') {
- $msgstatus = &Apache::lonmsg::user_normal_msg($_,$udom,$env{'form.msgsub'},$message);
+ $msgstatus = &Apache::lonmsg::user_normal_msg($collaborator,$udom,$env{'form.msgsub'},$message);
}
-
}
}
}
}
- if ($env{'form.returndoc1'}) {
- # if multiple files are uploaded names will be 'returndoc2', 'returndoc3'
- my $file_counter = 1;
- while ($env{'form.returndoc'.$file_counter}) {
- my $fname=$env{'form.returndoc'.$file_counter.'.filename'};
- $request->print("
".$fname." will be the uploaded file name");
- $request->print("Will upload document".$env{'form.returndocorig'.$file_counter});
- $file_counter ++;
- }
- }
$ctr++;
}
}
@@ -2234,6 +2224,7 @@ sub saveHandGrade {
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') {
@@ -2302,6 +2293,25 @@ sub saveHandGrade {
$newrecord{'resource.'.$new_part.'.regrader'}=
"$env{'user.name'}:$env{'user.domain'}";
}
+ $request->print('form.part'.$new_part.'_returndoc1');
+ if ($env{'form.part'.$new_part.'_returndoc1'}) {
+ # if multiple files are uploaded names will be 'returndoc2', 'returndoc3'
+ my $portfolio_root = &Apache::loncommon::propath($domain,
+ $stuname).
+ '/userfiles/portfolio';
+ $request->print('
'.$portfolio_root.'
');
+ # my $result=&Apache::lonnet::userfileupload('uploaddoc','',
+ # 'portfolio'.$env{'form.currentpath'});
+
+ my $file_counter = 1;
+ while ($env{'form.'.$new_part.'_returndoc'.$file_counter}) {
+ my $fname=$env{'form.returndoc'.$file_counter.'.filename'};
+ $request->print("
".$fname." will be the uploaded file name");
+ $request->print("Will upload document".$env{'form.returndocorig'.$file_counter});
+ $file_counter++;
+ }
+ }
+
# unless problem has been graded, set flag to version the submitted files
unless ($record{'resource.'.$new_part.'.solved'} =~ /^correct_/ ||
$record{'resource.'.$new_part.'.solved'} eq 'incorrect_by_override' ||