version 1.260, 2005/04/07 22:48:06
|
version 1.262, 2005/04/08 20:12:58
|
Line 2109 sub processHandGrade {
|
Line 2109 sub processHandGrade {
|
#---- Save the score and award for each student, if changed |
#---- Save the score and award for each student, if changed |
sub saveHandGrade { |
sub saveHandGrade { |
my ($request,$url,$symb,$stuname,$domain,$newflg,$submitter,$part) = @_; |
my ($request,$url,$symb,$stuname,$domain,$newflg,$submitter,$part) = @_; |
my $v_flag=0; |
my @v_flag; |
my $usec = &Apache::lonnet::getsection($domain,$stuname, |
my $usec = &Apache::lonnet::getsection($domain,$stuname, |
$env{'request.course.id'}); |
$env{'request.course.id'}); |
if (!&canmodify($usec)) { return('not_allowed'); } |
if (!&canmodify($usec)) { return('not_allowed'); } |
Line 2174 sub saveHandGrade {
|
Line 2174 sub saveHandGrade {
|
} |
} |
# unless problem has been graded, set flag to version the submitted files |
# unless problem has been graded, set flag to version the submitted files |
unless ($record{'resource.'.$new_part.'.solved'} =~ /^correct_/ || $record{'resource.'.$new_part.'.solved'} eq 'incorrect_by_override') { |
unless ($record{'resource.'.$new_part.'.solved'} =~ /^correct_/ || $record{'resource.'.$new_part.'.solved'} eq 'incorrect_by_override') { |
$v_flag = 1; |
push (@v_flag,$new_part); |
} |
} |
} |
} |
if (scalar(keys(%newrecord)) > 0) { |
if (scalar(keys(%newrecord)) > 0) { |
if ($v_flag) { |
if (scalar @v_flag) { |
&Apache::lonnet::unmark_as_readonly($domain,$stuname,$symb.$env{'request.course.id'}); |
foreach my $part_flagged (@v_flag) { |
&version_portfiles(\%record, \@parts_graded, $env{'request.course.id'}, $symb, $domain, $stuname); |
&Apache::lonnet::unmark_as_readonly($domain,$stuname,$symb.$env{'request.course.id'}); |
|
&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); |
Line 2232 sub version_portfiles {
|
Line 2234 sub version_portfiles {
|
push(@v_portfiles, $answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]); |
push(@v_portfiles, $answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]); |
} |
} |
} |
} |
$$record{$key} = join(/,/,@v_portfiles); |
$$record{$key} = join(',',@v_portfiles); |
} |
} |
} |
} |
return 'ok'; |
return 'ok'; |