version 1.322, 2006/02/27 21:23:52
|
version 1.323, 2006/02/28 02:47:30
|
Line 1471 sub gradeBox {
|
Line 1471 sub gradeBox {
|
'<input type="hidden" name="aggtries'.$counter.'_'.$partid.'" value="'. |
'<input type="hidden" name="aggtries'.$counter.'_'.$partid.'" value="'. |
$aggtries.'" />'."\n"; |
$aggtries.'" />'."\n"; |
$result.='</td></tr></table>'."\n"; |
$result.='</td></tr></table>'."\n"; |
$result.=&handback_box($uname,$udom,$counter,$partid,$record); |
$result.=&handback_box($symb,$uname,$udom,$counter,$partid,$record); |
return $result; |
return $result; |
} |
} |
|
|
sub handback_box { |
sub handback_box { |
my ($uname,$udom,$counter,$partid,$record) = @_; |
my ($symb,$uname,$udom,$counter,$partid,$record) = @_; |
|
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($symb); |
|
my ($partlist,$handgrade,$responseType) = &response_type($url,$symb); |
|
my (@respids); |
|
foreach my $part_resp (sort(keys(%$handgrade))) { |
|
my ($part,$resp) = split(/_/,$part_resp); |
|
if ($part eq $partid) { |
|
push @respids,$resp; |
|
} |
|
} |
my $result; |
my $result; |
foreach my $respid (undef) { |
foreach my $respid (@respids) { |
my $prefix = $counter.'_'.$partid.'_'.$respid.'_'; |
my $prefix = $counter.'_'.$partid.'_'.$respid.'_'; |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,$record); |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,$record); |
next if (!@$files); |
next if (!@$files); |
Line 1487 sub handback_box {
|
Line 1496 sub handback_box {
|
my ($file_disp) = ($file =~ m|.+/(.+)$|); |
my ($file_disp) = ($file =~ m|.+/(.+)$|); |
$result.=&mt('Return commented version of [_1] to student.', |
$result.=&mt('Return commented version of [_1] to student.', |
'<span class="filename">'.$file_disp.'</span>'); |
'<span class="filename">'.$file_disp.'</span>'); |
$result.='<input type="file" name="'.$prefix.'_returndoc'.$file_counter.'" />'."\n"; |
$result.='<input type="file" name="'.$prefix.'returndoc'.$file_counter.'" />'."\n"; |
$result.='<input type="hidden" name="'.$prefix.'_origdoc'.$file_counter.'" value="'.$file.'" /><br />'; |
$result.='<input type="hidden" name="'.$prefix.'origdoc'.$file_counter.'" value="'.$file.'" /><br />'; |
$file_counter++; |
$file_counter++; |
} |
} |
} |
} |
Line 2317 sub saveHandGrade {
|
Line 2326 sub saveHandGrade {
|
"$env{'user.name'}:$env{'user.domain'}"; |
"$env{'user.name'}:$env{'user.domain'}"; |
} |
} |
my ($partlist,$handgrade,$responseType) = &response_type($url,$symb); |
my ($partlist,$handgrade,$responseType) = &response_type($url,$symb); |
my $portfolio_root = &Apache::loncommon::propath($domain, |
|
$stuname). |
|
'/userfiles/portfolio'; |
|
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); |
if ($env{'form.'.$part_resp.'_returndoc1'} && ($new_part eq $part_id)) { |
&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' |
# if multiple files are uploaded names will be 'returndoc2','returndoc3' |
my $file_counter = 1; |
my $file_counter = 1; |
while ($env{'form.'.$part_resp.'_returndoc'.$file_counter}) { |
while ($env{'form.'.$newflg.'_'.$part_resp.'_returndoc'.$file_counter}) { |
my $fname=$env{'form.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}; |
$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.returndocorig'.$file_counter}); |
$request->print("<font color=\"red\">Will upload document</font>".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |
$file_counter++; |
$file_counter++; |
} |
} |
} |
} |