--- loncom/homework/grades.pm 2010/01/27 05:12:15 1.574.2.7
+++ loncom/homework/grades.pm 2010/04/01 01:00:28 1.574.2.9
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.574.2.7 2010/01/27 05:12:15 raeburn Exp $
+# $Id: grades.pm,v 1.574.2.9 2010/04/01 01:00:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1754,8 +1754,6 @@ sub gradeBox {
}
$line.=''."\n";
-
- #&mt('
Part: | [_1] | Points: | [_2] | or | [_3] | ',$display_part,$radio,$line);
$result .=
''.&mt('Part').': | '.$display_part.' | '.&mt('Points').': | '.$radio.' | '.&mt('or').' | '.$line.' | ';
$result.=''."\n";
@@ -7416,6 +7414,7 @@ sub scantron_get_maxbubble {
if (ref($nav_error)) {
$$nav_error = 1;
}
+ return;
}
my $map=$navmap->getResourceByUrl($sequence);
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0);
@@ -7579,8 +7578,15 @@ sub scantron_process_students {
my (%grader_partids_by_symb,%grader_randomlists_by_symb);
&graders_resources_pass(\@resources,\%grader_partids_by_symb,
\%grader_randomlists_by_symb);
+ my $resource_error;
foreach my $resource (@resources) {
- my $ressymb = $resource->symb();
+ my $ressymb;
+ if (ref($resource)) {
+ $ressymb = $resource->symb();
+ } else {
+ $resource_error = 1;
+ last;
+ }
my ($analysis,$parts) =
&scantron_partids_tograde($resource,$env{'request.course.id'},
$env{'user.name'},$env{'user.domain'},1);
@@ -7592,6 +7598,10 @@ sub scantron_process_students {
}
}
}
+ if ($resource_error) {
+ $r->print(&navmap_errormsg());
+ return '';
+ }
my ($uname,$udom);
my $result= <symb();
+ my $ressymb;
+ if (ref($resource)) {
+ $ressymb = $resource->symb();
+ } else {
+ $res_error = 1;
+ last;
+ }
if ((exists($grader_randomlists_by_symb{$ressymb})) ||
(ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
my ($analysis,$parts) =
@@ -7675,6 +7691,12 @@ SCANTRONFORM
}
}
+ if ($res_error) {
+ &scantron_add_delay(\@delayqueue,$line,
+ 'An error occurred while grading student '.$uname,2);
+ next;
+ }
+
&Apache::lonxml::clear_problem_counter();
&Apache::lonnet::appenv($scan_record);