version 1.321, 2006/02/27 20:32:38
|
version 1.322, 2006/02/27 21:23:52
|
Line 1413 SUBJAVASCRIPT
|
Line 1413 SUBJAVASCRIPT
|
|
|
#--- displays the grading box, used in essay type problem and grading by page/sequence |
#--- displays the grading box, used in essay type problem and grading by page/sequence |
sub gradeBox { |
sub gradeBox { |
my ($request,$symb,$uname,$udom,$counter,$partid,$record,$respid) = @_; |
my ($request,$symb,$uname,$udom,$counter,$partid,$record) = @_; |
my $checkIcon = '<img src="'.$request->dir_config('lonIconsURL'). |
my $checkIcon = '<img src="'.$request->dir_config('lonIconsURL'). |
'/check.gif" height="16" border="0" />'; |
'/check.gif" height="16" border="0" />'; |
my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb,$udom,$uname); |
my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb,$udom,$uname); |
Line 1423 sub gradeBox {
|
Line 1423 sub gradeBox {
|
my $score = ($$record{'resource.'.$partid.'.awarded'} eq '' ? |
my $score = ($$record{'resource.'.$partid.'.awarded'} eq '' ? |
'' : &compute_points($$record{'resource.'.$partid.'.awarded'},$wgt)); |
'' : &compute_points($$record{'resource.'.$partid.'.awarded'},$wgt)); |
my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n"; |
my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n"; |
$result.='<br />'.$partid.' - '.$respid.'<br />'; |
|
my $display_part=&get_display_part($partid,undef,$symb); |
my $display_part=&get_display_part($partid,undef,$symb); |
my %last_resets = &get_last_resets($symb,$env{'request.course.id'}, |
my %last_resets = &get_last_resets($symb,$env{'request.course.id'}, |
[$partid]); |
[$partid]); |
Line 1472 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.=&handbackBox($uname,$udom,$counter,$partid,$record,$respid); |
$result.=&handback_box($uname,$udom,$counter,$partid,$record); |
return $result; |
return $result; |
} |
} |
sub handbackBox { |
|
my ($uname,$udom,$counter,$partid,$record,$respid) = @_; |
sub handback_box { |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,$record); |
my ($uname,$udom,$counter,$partid,$record) = @_; |
my $result; |
my $result; |
if (@$files) { |
foreach my $respid (undef) { |
my $file_counter = 1; |
my $prefix = $counter.'_'.$partid.'_'.$respid.'_'; |
|
my $files=&get_submitted_files($udom,$uname,$partid,$respid,$record); |
|
next if (!@$files); |
|
my $file_counter = 1; |
foreach my $file (@$files) { |
foreach my $file (@$files) { |
$file =~ /.+\/(.+$)/; |
my ($file_disp) = ($file =~ m|.+/(.+)$|); |
my $file_disp = $1; |
$result.=&mt('Return commented version of [_1] to student.', |
$result.=' Return commented version of <span class="filename">'.$file_disp.' </span>to student. <input type="file" name="'.$partid.'_'.$respid.'_returndoc'; |
'<span class="filename">'.$file_disp.'</span>'); |
$result.=$file_counter.'" />'."\n"; |
$result.='<input type="file" name="'.$prefix.'_returndoc'.$file_counter.'" />'."\n"; |
$result.='<input type="hidden" name="'.$partid.'_'.$respid.'_origdoc'.$file_counter.'" value="'.$file.'" /><br />'; |
$result.='<input type="hidden" name="'.$prefix.'_origdoc'.$file_counter.'" value="'.$file.'" /><br />'; |
$file_counter++; |
$file_counter++; |
} |
} |
} |
} |
return $result; |
return $result; |
} |
} |
Line 1916 KEYWORDS
|
Line 1918 KEYWORDS
|
my %seen = (); |
my %seen = (); |
my @partlist; |
my @partlist; |
my @gradePartRespid; |
my @gradePartRespid; |
for my $part_resp(sort keys(%$handgrade)) { |
for my $part_resp (sort(keys(%$handgrade))) { |
my ($partid,$respid) = split(/_/, $part_resp); |
my ($partid,$respid) = split(/_/, $part_resp); |
#next if ($seen{$partid} > 0); |
next if ($seen{$partid} > 0); |
if ($seen{$partid} > 0) { |
|
$request->print(&handbackBox($uname,$udom,$counter,$partid,\%record,$respid)); |
|
next; |
|
} |
|
$seen{$partid}++; |
$seen{$partid}++; |
next if ($$handgrade{$part_resp} =~ /:no$/ && $env{'form.lastSub'} =~ /^(hdgrade)$/); |
next if ($$handgrade{$part_resp} =~ /:no$/ && $env{'form.lastSub'} =~ /^(hdgrade)$/); |
push @partlist,$partid; |
push @partlist,$partid; |
push @gradePartRespid,$partid.'.'.$respid; |
push @gradePartRespid,$partid.'.'.$respid; |
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record,$respid)); |
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); |
} |
} |
$result='<input type="hidden" name="partlist'.$counter. |
$result='<input type="hidden" name="partlist'.$counter. |
'" value="'.(join ":",@partlist).'" />'."\n"; |
'" value="'.(join ":",@partlist).'" />'."\n"; |
Line 2322 sub saveHandGrade {
|
Line 2320 sub saveHandGrade {
|
my $portfolio_root = &Apache::loncommon::propath($domain, |
my $portfolio_root = &Apache::loncommon::propath($domain, |
$stuname). |
$stuname). |
'/userfiles/portfolio'; |
'/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)) { |
if ($env{'form.'.$part_resp.'_returndoc1'} && ($new_part eq $part_id)) { |
# if multiple files are uploaded names will be 'returndoc2','returndoc3' |
# if multiple files are uploaded names will be 'returndoc2','returndoc3' |
Line 2373 sub saveHandGrade {
|
Line 2371 sub saveHandGrade {
|
} |
} |
return ('',$pts,$wgt); |
return ('',$pts,$wgt); |
} |
} |
|
|
sub get_submitted_files { |
sub get_submitted_files { |
my ($udom,$uname,$partid,$respid,$record) = @_; |
my ($udom,$uname,$partid,$respid,$record) = @_; |
my @files; |
my @files; |
Line 2387 sub get_submitted_files {
|
Line 2386 sub get_submitted_files {
|
} |
} |
return (\@files); |
return (\@files); |
} |
} |
|
|
# ----------- Provides number of tries since last reset. |
# ----------- Provides number of tries since last reset. |
sub get_num_tries { |
sub get_num_tries { |
my ($record,$last_reset,$part) = @_; |
my ($record,$last_reset,$part) = @_; |