version 1.269, 2005/06/03 18:23:19
|
version 1.270, 2005/06/04 02:56:44
|
Line 1352 sub gradeBox {
|
Line 1352 sub gradeBox {
|
my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n"; |
my $result='<input type="hidden" name="WGT'.$counter.'_'.$partid.'" value="'.$wgt.'" />'."\n"; |
|
|
my $display_part=&get_display_part($partid,undef,$symb); |
my $display_part=&get_display_part($partid,undef,$symb); |
my @partids = ("$partid"); |
|
my %last_resets = (); |
my %last_resets = &get_last_resets($symb,$env{'request.course.id'}, |
&get_last_resets($symb,$env{'request.course.id'},\%last_resets,\@partids); |
[$partid]); |
my $aggtries; |
my $aggtries = $$record{'resource.'.$partid.'.tries'}; |
if ($last_resets{$partid}) { |
if ($last_resets{$partid}) { |
$aggtries = &get_num_tries($record,$last_resets{$partid},$partid); |
$aggtries = &get_num_tries($record,$last_resets{$partid},$partid); |
} else { |
|
$aggtries = $$record{'resource.'.$partid.'.tries'}; |
|
} |
} |
|
|
$result.='<table border="0"><tr><td>'. |
$result.='<table border="0"><tr><td>'. |
'<b>Part: </b>'.$display_part.' <b>Points: </b></td><td>'."\n"; |
'<b>Part: </b>'.$display_part.' <b>Points: </b></td><td>'."\n"; |
|
|
Line 2156 sub saveHandGrade {
|
Line 2155 sub saveHandGrade {
|
} |
} |
$newrecord{'resource.'.$new_part.'.regrader'}= |
$newrecord{'resource.'.$new_part.'.regrader'}= |
"$env{'user.name'}:$env{'user.domain'}"; |
"$env{'user.name'}:$env{'user.domain'}"; |
my @partids = ("$new_part"); |
my $totaltries = $record{'resource.'.$part.'.tries'}; |
my %last_resets = (); |
|
&get_last_resets($symb,$env{'request.course.id'},\%last_resets,\@partids); |
my %last_resets = &get_last_resets($symb,$env{'request.course.id'}, |
my ($totaltries,$aggtries,$solvedstatus); |
[$new_part]); |
$totaltries = $record{'resource.'.$part.'.tries'}; |
my $aggtries =$totaltries; |
if ($last_resets{$new_part}) { |
if ($last_resets{$new_part}) { |
$aggtries = &get_num_tries(\%record,$last_resets{$new_part},$new_part); |
$aggtries = &get_num_tries(\%record,$last_resets{$new_part}, |
} else { |
$new_part); |
$aggtries = $totaltries; |
|
} |
} |
$solvedstatus = $record{'resource.'.$new_part.'.solved'}; |
|
|
my $solvedstatus = $record{'resource.'.$new_part.'.solved'}; |
if ($aggtries > 0) { |
if ($aggtries > 0) { |
&decrement($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus); |
&decrement($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus); |
$aggregateflag = 1; |
$aggregateflag = 1; |
Line 2270 sub decrement_aggs {
|
Line 2269 sub decrement_aggs {
|
|
|
# ----------- Determine timestamps for last reset of aggregate totals for parts |
# ----------- Determine timestamps for last reset of aggregate totals for parts |
sub get_last_resets { |
sub get_last_resets { |
my ($symb,$courseid,$last_resets,$partids) =@_; |
my ($symb,$courseid,$partids) =@_; |
|
my %last_resets; |
my $cdom = $env{'course.'.$courseid.'.domain'}; |
my $cdom = $env{'course.'.$courseid.'.domain'}; |
my $cname = $env{'course.'.$courseid.'.num'}; |
my $cname = $env{'course.'.$courseid.'.num'}; |
my %resethash = &Apache::lonnet::restore($symb,'nohist_resourcetracker',$cdom,$cname); |
my %resethash = &Apache::lonnet::restore($symb,'nohist_resourcetracker', |
|
$cdom,$cname); |
if ($resethash{'version'}) { |
if ($resethash{'version'}) { |
foreach my $part (@{$partids}) { |
foreach my $part (@{$partids}) { |
$$last_resets{$part} = ''; |
$last_resets{$part} = ''; |
for (my $version=$resethash{'version'};$version>=1;$version--) { |
for (my $version=$resethash{'version'};$version>=1;$version--) { |
if (exists($resethash{$version.':'.$part."\0".'prev_attempts'})) { |
if (exists($resethash{$version.':'.$part."\0".'prev_attempts'})) { |
$$last_resets{$part} = $resethash{$version.':timestamp'}; |
$last_resets{$part} = $resethash{$version.':timestamp'}; |
last; |
last; |
} |
} |
} |
} |
} |
} |
} |
} |
return; |
return %last_resets; |
} |
} |
|
|
# ----------- Handles creating versions for portfolio files as answers |
# ----------- Handles creating versions for portfolio files as answers |
Line 2630 sub viewgrades {
|
Line 2631 sub viewgrades {
|
} |
} |
$result.='</tr>'; |
$result.='</tr>'; |
|
|
# retrieve last reset information |
my %last_resets = |
my %last_resets = (); |
&get_last_resets($symb,$env{'request.course.id'},\@partids); |
&get_last_resets($symb,$env{'request.course.id'},\%last_resets,\@partids); |
|
|
|
#get info for each student |
#get info for each student |
#list all the students - with points and grade status |
#list all the students - with points and grade status |
Line 2675 sub viewstudentgrade {
|
Line 2675 sub viewstudentgrade {
|
$result.='<td align="middle">'; |
$result.='<td align="middle">'; |
my ($aggtries,$totaltries); |
my ($aggtries,$totaltries); |
unless (exists($aggregates{$part})) { |
unless (exists($aggregates{$part})) { |
$totaltries = $record{'resource.'.$part.'.tries'}; |
$totaltries = $record{'resource.'.$part.'.tries'}; |
|
|
|
$aggtries = $totaltries; |
if ($$last_resets{$part}) { |
if ($$last_resets{$part}) { |
$aggtries = &get_num_tries(\%record,$$last_resets{$part},$part); |
$aggtries = &get_num_tries(\%record,$$last_resets{$part}, |
} else { |
$part); |
$aggtries = $totaltries; |
} |
} |
|
$result.='<input type="hidden" name="'. |
$result.='<input type="hidden" name="'. |
'GD_'.$student.'_'.$part.'_aggtries" value="'.$aggtries.'" />'."\n"; |
'GD_'.$student.'_'.$part.'_aggtries" value="'.$aggtries.'" />'."\n"; |
$result.='<input type="hidden" name="'. |
$result.='<input type="hidden" name="'. |