version 1.327, 2006/03/03 21:50:44
|
version 1.328, 2006/03/07 02:50:15
|
Line 2316 sub saveHandGrade {
|
Line 2316 sub saveHandGrade {
|
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
foreach my $part_resp (sort(keys(%$handgrade))) { |
foreach my $part_resp (sort(keys(%$handgrade))) { |
my ($part_id, $resp_id) = split(/_/,$part_resp); |
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 (($env{'form.'.$newflg.'_'.$part_resp.'_returndoc1'}) && ($new_part == $part_id)) { |
# if multiple files are uploaded names will be 'returndoc2','returndoc3' |
# if multiple files are uploaded names will be 'returndoc2','returndoc3' |
my $file_counter = 1; |
my $file_counter = 1; |
while ($env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter}) { |
while ($env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter}) { |
my $fname=$env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter.'.filename'}; |
my $fname=$env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter.'.filename'}; |
$newrecord{"resource.$new_part.$resp_id.handback"} = $env{'form.returndocorig'.$file_counter}; |
$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('<font color="red"> An errror occured ('.$result. |
|
') while trying to upload '.&display_file().'</font><br />'); |
|
# $request->print(&done('Back')); |
|
} |
$request->print("<br />".$fname." will be the uploaded file name"); |
$request->print("<br />".$fname." will be the uploaded file name"); |
$request->print("<font color=\"red\">Will upload document</font>".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |
$request->print("<font color=\"red\">Will upload document</font>".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |
$file_counter++; |
$file_counter++; |