--- loncom/homework/grades.pm 2004/04/20 06:11:49 1.186 +++ loncom/homework/grades.pm 2004/04/24 09:01:52 1.190 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.186 2004/04/20 06:11:49 albertel Exp $ +# $Id: grades.pm,v 1.190 2004/04/24 09:01:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3487,7 +3487,7 @@ sub scantron_selectphase {
-
+ $default_form_data @@ -3519,6 +3519,13 @@ sub scantron_selectphase { + + + + @@ -3579,6 +3586,40 @@ UPLOAD SCANTRONFORM } + $r->print(< + + +SCANTRONFORM $r->print(< @@ -3690,7 +3731,7 @@ sub scan_data { } sub scantron_parse_scanline { - my ($line,$whichline,$scantron_config,$scan_data)=@_; + my ($line,$whichline,$scantron_config,$scan_data,$justCODE)=@_; my %record; my $questions=substr($line,$$scantron_config{'Qstart'}-1); my $data=substr($line,0,$$scantron_config{'Qstart'}-1); @@ -3702,6 +3743,7 @@ sub scantron_parse_scanline { #FIXME interpret first N questions } } + if ($justCODE) { return \%record; } $record{'scantron.ID'}=substr($data,$$scantron_config{'IDstart'}-1, $$scantron_config{'IDlength'}); $record{'scantron.PaperID'}= @@ -3794,7 +3836,15 @@ sub scantron_process_corrections { 'username'=>$ENV{'form.scantron_username'}, 'domain'=>$ENV{'form.scantron_domain'}}); } elsif ($ENV{'form.scantron_corrections'} =~ /^(duplicate|incorrect)CODE$/) { - my $newCODE=$ENV{'form.scantron_CODE'}; + my $resolution=$ENV{'form.scantron_CODE_resolution'}; + my $newCODE; + if ($resolution eq 'use_unfound') { + &FIXME_blow_up(); + } elsif ($resolution eq 'use_found') { + $newCODE=$ENV{'form.scantron_CODE_selectedvalue'}; + } elsif ($resolution eq 'use_typed') { + $newCODE=$ENV{'form.scantron_CODE_newvalue'}; + } ($line,$err,$errmsg)= &scantron_fixup_scanline(\%scantron_config,$scan_data,$line,$which, 'CODE',{'CODE'=>$newCODE}); @@ -3834,6 +3884,10 @@ sub scantron_validate_file { + + + + $default_form_data SCANTRONFORM $r->print($result); @@ -4061,18 +4115,42 @@ sub scantron_get_correction { $r->print(''); } elsif ($error =~ /CODE$/) { if ($error eq 'incorrectCODE') { - $r->print("The encoded CODE is not in the list of possible CODEs

\n"); + $r->print("

The encoded CODE is not in the list of possible CODEs

\n"); } elsif ($error eq 'duplicateCODE') { - $r->print("The encoded CODE has also been used by a previous paper $arg, and CODEs were supposed to be unique

\n"); + $r->print("

The encoded CODE has also been used by a previous paper $arg, and CODEs were supposed to be unique

\n"); } + $r->print("

The CODE on the form is ". + $$scan_record{'scantron.CODE'}."
\n"); $r->print("

The ID on the form is ". $$scan_record{'scantron.ID'}."
\n"); $r->print("The name on the paper is ". $$scan_record{'scantron.LastName'}.",". $$scan_record{'scantron.FirstName'}."

"); $r->print("

How should I handle this?
\n"); - $r->print("\n

  • "); - $r->print('
  • '); + $r->print("\n
    "); + $r->print(" Use the CODE ".$$scan_record{'scantron.CODE'}." that is was on the paper, ignoring the error."); + $r->print("\n
    "); + $r->print(< +function change_radio(field) { + var slct=document.scantronupload.scantron_CODE_resolution; + var i; + for (i=0;i +ENDSCRIPT + my $href="/adm/pickcode?". + "form=".&Apache::lonnet::escape("scantronupload"). + "&scantron_format=".&Apache::lonnet::escape($ENV{'form.scantron_format'}). + "&scantron_CODElist=".&Apache::lonnet::escape($ENV{'form.scantron_CODElist'}). + "&curCODE=".&Apache::lonnet::escape($$scan_record{'scantron.CODE'}). + "&scantron_selectfile=".&Apache::lonnet::escape($ENV{'form.scantron_selectfile'}); + $r->print(" Select a CODE from the list of all CODEs and use it. Selected CODE is "); + $r->print("\n
    "); + $r->print(" Use as the CODE."); + $r->print("\n

    "); } elsif ($error eq 'doublebubble') { #FIXME Need to print out who this is along with the paper info $r->print("

    There have been multiple bubbles scanned for a some question(s)

    \n"); @@ -4132,7 +4210,6 @@ sub scantron_validate_CODE { &FIXME_blow_up() } } else { - &Apache::lonnet::logthis(" CODE stuf $scantron_config{'CODElocation'}:$scantron_config{'CODEstart'}:$scantron_config{'CODElength'}"); return (0,$currentphase+1); } @@ -4142,7 +4219,7 @@ sub scantron_validate_CODE { my $cdom =$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; my $cnum =$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; my %result=&Apache::lonnet::get('CODEs',[$old_name],$cdom,$cnum); - my %allcodes=map {($_,1)} split(',',$result{$old_name}); + my %allcodes=map {(&Apache::lonprintout::num_to_letters($_),1)} split(',',$result{$old_name}); my ($scanlines,$scan_data)=&scantron_getfile(); for (my $i=0;$i<=$scanlines->{'count'};$i++) {
Options: + Redo skipped records
+ Ignore Original Corrections +
+ + + + + + + + + + + + + + + + +
+  Download a scoring office file +
Filename of scoring office file: $file_selector
+ Records to download + + Skipped Records
+ Corrected Records
+ Original Records +
+ +
+ +