--- loncom/homework/grades.pm 2007/10/26 00:41:31 1.468 +++ loncom/homework/grades.pm 2007/10/29 09:46:28 1.470 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.468 2007/10/26 00:41:31 albertel Exp $ +# $Id: grades.pm,v 1.470 2007/10/29 09:46:28 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1852,12 +1852,6 @@ sub submission { $request->print('

 Submission Record

'."\n". '

 Resource: '.$env{'form.probTitle'}.'

'."\n"); - if ($env{'form.handgrade'} eq 'no') { - my $checkMark='

 Note: Part(s) graded correct by the computer is marked with a '. - $checkIcon.' symbol.'."\n"; - $request->print($checkMark); - } - # option to display problem, only once else it cause problems # with the form later since the problem has a form. if ($env{'form.vProb'} eq 'yes' or $env{'form.vAns'} eq 'yes') { @@ -1989,6 +1983,13 @@ KEYWORDS $result.= &mt('Submissions'); $result.=''."\n"; + if ($env{'form.handgrade'} eq 'no') { + $result.=''. + &mt('Part(s) graded correct by the computer is marked with a [_1] symbol.',$checkIcon)."\n"; + + } + + # If any part of the problem is an essay-response (handgraded), then check for collaborators my $fullname; @@ -5238,6 +5239,7 @@ sub scan_data { sub scantron_parse_scanline { my ($line,$whichline,$scantron_config,$scan_data,$just_header)=@_; + my %record; my $questions=substr($line,$$scantron_config{'Qstart'}-1); # Answers my $data=substr($line,0,$$scantron_config{'Qstart'}-1); # earlier stuff @@ -5276,7 +5278,9 @@ sub scantron_parse_scanline { my $questnum=0; my $ansnum =1; # Multiple 'answer lines'/question. - while ($questions) { + chomp($questions); # Get rid of any trailing \n. + $questions =~ s/\r$//; # Get rid of trailing \r too (MAC or Win uploads). + while (length($questions)) { my $answers_needed = $bubble_lines_per_response{$questnum}; my $answer_length = $$scantron_config{'Qlength'} * $answers_needed; @@ -5312,15 +5316,18 @@ sub scantron_parse_scanline { } elsif (!defined($currentquest) || (&occurence_count($currentquest, $$scantron_config{'Qoff'}) == length($currentquest)) || (&occurence_count($currentquest, "[A-Z]") == 0)) { + &Apache::lonnet::logthis("Missing if, $questnum, $ansnum"); for (my $ans = 0; $ans < $answers_needed; $ans++ ) { $record{"scantron.$ansnum.answer"}=''; $ansnum++; } if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) { + &Apache::lonnet::logthis("Parsed missing: $questnum"); push(@{$record{"scantron.missingerror"}},$questnum); - $ansnum += $answers_needed; + # $ansnum += $answers_needed; } + &Apache::lonnet::logthis("Residual scanline: '$questions'"); } else { for (my $ans = 0; $ans < $answers_needed; $ans++) { @@ -6479,7 +6486,9 @@ ENDSCRIPT join(',',@{$arg}).'" />'); foreach my $question (@{$arg}) { my $selected = &get_response_bubbles($scan_record, $question); - &scantron_bubble_selector($r,$scan_config,$question); + my @select_array = split(/:/,$selected); # ought to be an array of empties. + &Apache::lonnet::logthis("Calling bubble selector (missing)"); + &scantron_bubble_selector($r,$scan_config,$question, @select_array); } } else { $r->print("\n