--- loncom/homework/grades.pm 2008/02/02 02:28:02 1.504 +++ loncom/homework/grades.pm 2008/02/04 17:45:07 1.506 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.504 2008/02/02 02:28:02 raeburn Exp $ +# $Id: grades.pm,v 1.506 2008/02/04 17:45:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6762,7 +6762,7 @@ sub questions_to_line_list { $first = $first_bubble_line{$question-1} + 1; $count = $bubble_lines_per_response{$question-1}; } - my $last = $first+$count-1; + $last = $first+$count-1; push(@lines, ($first..$last)); } return join(',', @lines); @@ -7262,7 +7262,25 @@ sub scantron_validate_missingbubbles { # Probably here's where the error is... foreach my $missing (@{$$scan_record{'scantron.missingerror'}}) { - if ($missing > $max_bubble) { next; } + my $lastbubble; + if ($missing =~ /^(\d+)\.(\d+)$/) { + my $question = $1; + my $subquestion = $2; + if (!defined($first_bubble_line{$question -1})) { next; } + my $first = $first_bubble_line{$question-1}; + my @subans = split(/,/,$subdivided_bubble_lines{$question-1}); + my $subcount = 1; + while ($subcount<$subquestion) { + $first += $subans[$subcount-1]; + $subcount ++; + } + my $count = $subans[$subquestion-1]; + $lastbubble = $first + $count; + } else { + if (!defined($first_bubble_line{$missing - 1})) { next; } + $lastbubble = $first_bubble_line{$missing - 1} + $bubble_lines_per_response{$missing - 1}; + } + if ($lastbubble > $max_bubble) { next; } push(@to_correct,$missing); } if (@to_correct) {