version 1.250, 2005/03/03 05:57:26
|
version 1.251, 2005/03/30 21:11:44
|
Line 2113 sub saveHandGrade {
|
Line 2113 sub saveHandGrade {
|
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
if (!&canmodify($usec)) { return('not_allowed'); } |
if (!&canmodify($usec)) { return('not_allowed'); } |
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname); |
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname); |
|
my @parts_graded; |
my %newrecord = (); |
my %newrecord = (); |
my ($pts,$wgt) = ('',''); |
my ($pts,$wgt) = ('',''); |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
Line 2147 sub saveHandGrade {
|
Line 2148 sub saveHandGrade {
|
if ($partial eq $record{'resource.'.$_.'.awarded'}) { |
if ($partial eq $record{'resource.'.$_.'.awarded'}) { |
#do not update score for part if not changed. |
#do not update score for part if not changed. |
next; |
next; |
|
} else { |
|
push @parts_graded, $_; |
} |
} |
if ($record{'resource.'.$_.'.awarded'} ne $partial) { |
if ($record{'resource.'.$_.'.awarded'} ne $partial) { |
$newrecord{'resource.'.$_.'.awarded'} = $partial; |
$newrecord{'resource.'.$_.'.awarded'} = $partial; |
Line 2170 sub saveHandGrade {
|
Line 2173 sub saveHandGrade {
|
} |
} |
} |
} |
if (scalar(keys(%newrecord)) > 0) { |
if (scalar(keys(%newrecord)) > 0) { |
|
&version_portfiles(\%record, \@parts_graded, $ENV{'request.course.id'}, $symb, $domain, $stuname); |
&Apache::lonnet::cstore(\%newrecord,$symb, |
&Apache::lonnet::cstore(\%newrecord,$symb, |
$ENV{'request.course.id'},$domain,$stuname); |
$ENV{'request.course.id'},$domain,$stuname); |
} |
} |
return '',$pts,$wgt; |
return '',$pts,$wgt; |
} |
} |
|
|
|
# ----------- Handles creating versions for portfolio files as answers |
|
sub version_portfiles { |
|
my ($record, $parts_graded, $courseid, $symb, $domain, $stuname) = @_; |
|
my $parts = join '|', @$parts_graded; |
|
foreach my $key (sort keys %$record) { |
|
if ($key =~ /^resource\.($parts)\./ && $key =~ /\.portfiles$/) { |
|
&Apache::lonnet::logthis('found key portfiles '.$key); |
|
&Apache::lonnet::logthis('found value portfiles '.$$record{$key}); |
|
} |
|
} |
|
|
|
|
|
} |
|
|
#-------------------------------------------------------------------------------------- |
#-------------------------------------------------------------------------------------- |
# |
# |
#-------------------------- Next few routines handles grading by section or whole class |
#-------------------------- Next few routines handles grading by section or whole class |