--- loncom/homework/grades.pm 2006/03/02 21:50:30 1.326
+++ loncom/homework/grades.pm 2006/03/07 02:50:15 1.328
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.326 2006/03/02 21:50:30 albertel Exp $
+# $Id: grades.pm,v 1.328 2006/03/07 02:50:15 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2274,7 +2274,7 @@ sub saveHandGrade {
my $solvedstatus = $record{'resource.'.$new_part.'.solved'};
if ($aggtries > 0) {
- &decrement($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus);
+ &decrement_aggs($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus);
$aggregateflag = 1;
}
} elsif ($dropMenu eq '') {
@@ -2316,14 +2316,21 @@ sub saveHandGrade {
my ($partlist,$handgrade,$responseType) = &response_type($symb);
foreach my $part_resp (sort(keys(%$handgrade))) {
my ($part_id, $resp_id) = split(/_/,$part_resp);
- &Apache::lonnet::logthis('form.'.$newflg.'_'.$part_resp.'_returndoc1');
- &Apache::lonnet::logthis("new part is $new_part and partid is $part_id");
if (($env{'form.'.$newflg.'_'.$part_resp.'_returndoc1'}) && ($new_part == $part_id)) {
# if multiple files are uploaded names will be 'returndoc2','returndoc3'
my $file_counter = 1;
while ($env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter}) {
my $fname=$env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter.'.filename'};
$newrecord{"resource.$new_part.$resp_id.handback"} = $env{'form.returndocorig'.$file_counter};
+ # set the filename to match the submitted file name
+ $env{'form.'.$newflg.'_'.$part_resp.'_returndoc1.filename'} = $env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter};
+ my $result=&Apache::lonnet::userfileupload($newflg.'_'.$part_resp.'_returndoc'.$file_counter,'',
+ 'portfolio',undef,undef,undef,$stuname,$domain);
+ if ($result !~ m|^/uploaded/|) {
+ $request->print(' An errror occured ('.$result.
+ ') while trying to upload '.&display_file().'
');
+ # $request->print(&done('Back'));
+ }
$request->print("
".$fname." will be the uploaded file name");
$request->print("Will upload document".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter});
$file_counter++;