--- loncom/homework/grades.pm 2007/10/17 10:48:20 1.461 +++ loncom/homework/grades.pm 2007/10/25 00:47:24 1.463 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.461 2007/10/17 10:48:20 foxr Exp $ +# $Id: grades.pm,v 1.463 2007/10/25 00:47:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3912,7 +3912,8 @@ sub csvuploadassign { if ($wgt) { $entries{$fields{$dest}}=~s/\s//g; my $pcr=$entries{$fields{$dest}} / $wgt; - my $award='correct_by_override'; + my $award=($pcr == 0) ? 'incorrect_by_override' + : 'correct_by_override'; $grades{"resource.$part.awarded"}=$pcr; $grades{"resource.$part.solved"}=$award; $points{$part}=1; @@ -5383,20 +5384,22 @@ sub scantron_parse_scanline { my $first_answer = $ansnum; for (my $ans =0; $ans < $answers_needed; $ans++) { - $record{"scantron.$ansnum.answer"} = ''; - $ans++; + my $item = $first_answer+$ans; + $record{"scantron.$item.answer"} = ''; } my @ans=@array; - my $i=length($ans[0]);shift(@ans); + my $i=0; + my $increment = 0; while ($#ans) { - $i+=length($ans[0])+1; - my $line = $i/$$scantron_config{'Qlength'} + $first_answer; + $i+=length($ans[0]) + $increment; + my $line = int($i/$$scantron_config{'Qlength'} + $first_answer); my $bubble = $i%$$scantron_config{'Qlength'}; - $record{"scantron.$line.answer"}.=$alphabet[$bubble]; shift(@ans); + $increment = 1; } + $ansnum += $answers_needed; } } } @@ -6492,8 +6495,8 @@ sub scantron_bubble_selector { if ($l != 0) { $r->print('