';
+sub scantron_filenames {
my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
my $cname=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
my @files=&Apache::lonnet::dirlist('userfiles',$cdom,$cname,
&Apache::loncommon::propath($cdom,$cname));
- $result.=" ";
- foreach my $filename (@files) {
+ my @possiblenames;
+ foreach my $filename (sort(@files)) {
($filename)=split(/&/,$filename);
if ($filename!~/^scantron_orig_/) { next ; }
$filename=~s/^scantron_orig_//;
+ push(@possiblenames,$filename);
+ }
+ return @possiblenames;
+}
+
+sub scantron_uploads {
+ my $result= '';
+ $result.=" ";
+ foreach my $filename (sort(&scantron_filenames())) {
$result.="$filename \n";
}
$result.=" ";
@@ -3452,7 +3464,7 @@ sub scantron_CODElist {
my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
my @names=&Apache::lonnet::getkeys('CODEs',$cdom,$cnum);
my $namechoice=' ';
- foreach my $name (@names) {
+ foreach my $name (sort(@names)) {
if ($name =~ /^error: 2 /) { next; }
$namechoice.=''.$name.' ';
}
@@ -3517,8 +3529,8 @@ sub scantron_selectphase {
Options:
- Redo skipped records
- Ignore Original Corrections
+ Do only previously skipped records
+ Remove all exisiting corrections
@@ -3597,18 +3609,8 @@ SCANTRONFORM
Filename of scoring office file: $file_selector
-
- Records to download
-
-
- Skipped Records
- Corrected Records
- Original Records
-
-
-
-
+
@@ -3685,9 +3687,11 @@ sub scantron_fixup_scanline {
$args->{'username'}.':'.$args->{'domain'});
}
} elsif ($field eq 'CODE') {
- if ($args->{'CODE'} eq 'use_unfound') {
- &scan_data($scan_data,"$whichline.useCODE",'1');
- } else {
+ if ($args->{'CODE_ignore_dup'}) {
+ &scan_data($scan_data,"$whichline.CODE_ignore_dup",'1');
+ }
+ &scan_data($scan_data,"$whichline.useCODE",'1');
+ if ($args->{'CODE'} ne 'use_unfound') {
if (length($args->{'CODE'}) > $$scantron_config{'CODElength'}) {
return ($line,1,'New CODE value too large');
}
@@ -3696,9 +3700,6 @@ sub scantron_fixup_scanline {
}
substr($line,$$scantron_config{'CODEstart'}-1,
$$scantron_config{'CODElength'})=$args->{'CODE'};
-# if ($args->{'CODE'}=~/^\s*$/) {
-# &scan_data($scan_data,"$whichline.CODE",$args->{'CODE'});
-# }
}
} elsif ($field eq 'answer') {
my $length=$scantron_config->{'Qlength'};
@@ -3730,7 +3731,7 @@ sub scan_data {
}
sub scantron_parse_scanline {
- my ($line,$whichline,$scantron_config,$scan_data,$justCODE)=@_;
+ my ($line,$whichline,$scantron_config,$scan_data,$justHeader)=@_;
my %record;
my $questions=substr($line,$$scantron_config{'Qstart'}-1);
my $data=substr($line,0,$$scantron_config{'Qstart'}-1);
@@ -3742,11 +3743,13 @@ sub scantron_parse_scanline {
if (&scan_data($scan_data,"$whichline.useCODE")) {
$record{'scantron.useCODE'}=1;
}
+ if (&scan_data($scan_data,"$whichline.CODE_ignore_dup")) {
+ $record{'scantron.CODE_ignore_dup'}=1;
+ }
} else {
#FIXME interpret first N questions
}
}
- if ($justCODE) { return \%record; }
$record{'scantron.ID'}=substr($data,$$scantron_config{'IDstart'}-1,
$$scantron_config{'IDlength'});
$record{'scantron.PaperID'}=
@@ -3758,6 +3761,8 @@ sub scantron_parse_scanline {
$record{'scantron.LastName'}=
substr($data,$$scantron_config{'LastName'}-1,
$$scantron_config{'LastNamelength'});
+ if ($justHeader) { return \%record; }
+
my @alphabet=('A'..'Z');
my $questnum=0;
while ($questions) {
@@ -3825,7 +3830,7 @@ sub scantron_process_corrections {
my ($scanlines,$scan_data)=&scantron_getfile();
my $classlist=&Apache::loncoursedata::get_classlist();
my $which=$ENV{'form.scantron_line'};
- my $line=&scantron_get_line($scanlines,$which);
+ my $line=&scantron_get_line($scanlines,$scan_data,$which);
my ($skip,$err,$errmsg);
if ($ENV{'form.scantron_skip_record'}) {
$skip=1;
@@ -3841,16 +3846,23 @@ sub scantron_process_corrections {
} elsif ($ENV{'form.scantron_corrections'} =~ /^(duplicate|incorrect)CODE$/) {
my $resolution=$ENV{'form.scantron_CODE_resolution'};
my $newCODE;
+ my %args;
if ($resolution eq 'use_unfound') {
$newCODE='use_unfound';
} elsif ($resolution eq 'use_found') {
$newCODE=$ENV{'form.scantron_CODE_selectedvalue'};
} elsif ($resolution eq 'use_typed') {
$newCODE=$ENV{'form.scantron_CODE_newvalue'};
+ } elsif ($resolution =~ /^use_closest_(\d+)/) {
+ $newCODE=$ENV{"form.scantron_CODE_closest_$1"};
}
+ if ($ENV{'form.scantron_corrections'} eq 'duplicateCODE') {
+ $args{'CODE_ignore_dup'}=1;
+ }
+ $args{'CODE'}=$newCODE;
($line,$err,$errmsg)=
&scantron_fixup_scanline(\%scantron_config,$scan_data,$line,$which,
- 'CODE',{'CODE'=>$newCODE});
+ 'CODE',\%args);
} elsif ($ENV{'form.scantron_corrections'} =~ /^(missing|double)bubble$/) {
foreach my $question (split(',',$ENV{'form.scantron_questions'})) {
($line,$err,$errmsg)=
@@ -3864,17 +3876,78 @@ sub scantron_process_corrections {
if ($err) {
$r->print("Unable to accept last correction, an error occurred :$errmsg:");
} else {
- &scantron_put_line($scanlines,$which,$line,$skip);
+ &scantron_put_line($scanlines,$scan_data,$which,$line,$skip);
&scantron_putfile($scanlines,$scan_data);
}
}
+sub reset_skipping_status {
+ my ($scanlines,$scan_data)=&scantron_getfile();
+ &scan_data($scan_data,'remember_skipping',undef,1);
+ &scantron_putfile(undef,$scan_data);
+}
+
+sub allow_skipping {
+ my ($scan_data,$i)=@_;
+ my %remembered=split(':',&scan_data($scan_data,'remember_skipping'));
+ delete($remembered{$i});
+ &scan_data($scan_data,'remember_skipping',join(':',%remembered));
+}
+
+sub should_be_skipped {
+ my ($scan_data,$i)=@_;
+ if ($ENV{'form.scantron_options_redo'} !~ /^redo_/) {
+ # not redoing old skips
+ return 0;
+ }
+ my %remembered=split(':',&scan_data($scan_data,'remember_skipping'));
+ if (exists($remembered{$i})) { return 0; }
+ return 1;
+}
+
+sub remember_current_skipped {
+ my ($scanlines,$scan_data)=&scantron_getfile();
+ my %to_remember;
+ for (my $i=0;$i<=$scanlines->{'count'};$i++) {
+ if ($scanlines->{'skipped'}[$i]) {
+ $to_remember{$i}=1;
+ }
+ }
+ &Apache::lonnet::logthis('remembering '.join(':',%to_remember));
+ &scan_data($scan_data,'remember_skipping',join(':',%to_remember));
+ &scantron_putfile(undef,$scan_data);
+}
+
+sub check_for_error {
+ my ($r,$result)=@_;
+ if ($result ne 'ok' && $result ne 'not_found' ) {
+ $r->print("An error occured ($result) when trying to Remove the existing corrections.");
+ }
+}
sub scantron_validate_file {
my ($r) = @_;
my ($symb,$url)=&get_symb_and_url($r);
if (!$symb) {return '';}
my $default_form_data=&defaultFormData($symb,$url);
+
+ # do the detection of only doing skipped records first befroe we delete
+ # them when doing the corrections reset
+ if ($ENV{'form.scantron_options_redo'} ne 'redo_skipped_ready') {
+ &reset_skipping_status();
+ }
+ if ($ENV{'form.scantron_options_redo'} eq 'redo_skipped') {
+ &remember_current_skipped();
+ &scantron_remove_file('skipped');
+ $ENV{'form.scantron_options_redo'}='redo_skipped_ready';
+ }
+
+ if ($ENV{'form.scantron_options_ignore'} eq 'ignore_corrections') {
+ &check_for_error($r,&scantron_remove_file('corrected'));
+ &check_for_error($r,&scantron_remove_file('skipped'));
+ &check_for_error($r,&scantron_remove_scan_data());
+ $ENV{'form.scantron_options_ignore'}='done';
+ }
if ($ENV{'form.scantron_corrections'}) {
&scantron_process_corrections($r);
@@ -3891,8 +3964,8 @@ sub scantron_validate_file {
-
-
+
+
$default_form_data
SCANTRONFORM
$r->print($result);
@@ -3902,14 +3975,10 @@ SCANTRONFORM
'doublebubble',
'missingbubbles');
if (!$ENV{'form.validatepass'}) {
- $ENV{'form.valiadatepass'} = 0;
+ $ENV{'form.validatepass'} = 0;
}
- my $currentphase=$ENV{'form.valiadatepass'};
+ my $currentphase=$ENV{'form.validatepass'};
- if ($ENV{'form.scantron_selectfile'}=~m-^/-) {
- #first pass copy file to classdir
-
- }
my $stop=0;
while (!$stop && $currentphase < scalar(@validate_phases)) {
$r->print(" Validating ".$validate_phases[$currentphase]."
");
@@ -3939,9 +4008,44 @@ SCANTRONFORM
return '';
}
+sub scantron_remove_file {
+ my ($which)=@_;
+ my $cname=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+ my $file='scantron_';
+ if ($which eq 'corrected' || $which eq 'skipped') {
+ $file.=$which.'_';
+ } else {
+ return 'refused';
+ }
+ $file.=$ENV{'form.scantron_selectfile'};
+ return &Apache::lonnet::removeuserfile($cname,$cdom,$file);
+}
+
+sub scantron_remove_scan_data {
+ my $cname=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+ my @keys=&Apache::lonnet::getkeys('nohist_scantrondata',$cdom,$cname);
+ my @todelete;
+ my $filename=$ENV{'form.scantron_selectfile'};
+ foreach my $key (@keys) {
+ if ($key=~/^\Q$filename\E_/) {
+ if ($ENV{'form.scantron_options_redo'} eq 'redo_skipped_ready' &&
+ $key=~/remember_skipping/) {
+ next;
+ }
+ push(@todelete,$key);
+ }
+ }
+ my $result;
+ if (@todelete) {
+ $result=&Apache::lonnet::del('nohist_scantrondata',\@todelete,$cdom,$cname);
+ }
+ return $result;
+}
+
sub scantron_getfile {
- #FIXME really would prefer a scantron directory but tokenwrapper
- # doesn't allow access to subdirs of userfiles
+ #FIXME really would prefer a scantron directory
my $cname=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
my $lines;
@@ -3984,34 +4088,48 @@ sub lonnet_putfile {
sub scantron_putfile {
my ($scanlines,$scan_data) = @_;
- #FIXME really would prefer a scantron directory but tokenwrapper
- # doesn't allow access to subdirs of userfiles
+ #FIXME really would prefer a scantron directory
my $cname=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
- my $prefix='scantron_';
+ if ($scanlines) {
+ my $prefix='scantron_';
# no need to update orig, shouldn't change
# &lonnet_putfile(join("\n",@{$scanlines->{'orig'}}),$prefix.'orig_'.
# $ENV{'form.scantron_selectfile'});
- &lonnet_putfile(join("\n",@{$scanlines->{'corrected'}}),
- $prefix.'corrected_'.
- $ENV{'form.scantron_selectfile'});
- &lonnet_putfile(join("\n",@{$scanlines->{'skipped'}}),
- $prefix.'skipped_'.
- $ENV{'form.scantron_selectfile'});
+ &lonnet_putfile(join("\n",@{$scanlines->{'corrected'}}),
+ $prefix.'corrected_'.
+ $ENV{'form.scantron_selectfile'});
+ &lonnet_putfile(join("\n",@{$scanlines->{'skipped'}}),
+ $prefix.'skipped_'.
+ $ENV{'form.scantron_selectfile'});
+ }
&Apache::lonnet::put('nohist_scantrondata',$scan_data,$cdom,$cname);
}
sub scantron_get_line {
- my ($scanlines,$i)=@_;
- if ($scanlines->{'skipped'}[$i]) {return undef;}
+ my ($scanlines,$scan_data,$i)=@_;
+ if (&should_be_skipped($scan_data,$i)) { return undef; }
+ if ($scanlines->{'skipped'}[$i]) { return undef; }
if ($scanlines->{'corrected'}[$i]) {return $scanlines->{'corrected'}[$i];}
return $scanlines->{'orig'}[$i];
}
+sub get_todo_count {
+ my ($scanlines,$scan_data)=@_;
+ my $count=0;
+ for (my $i=0;$i<=$scanlines->{'count'};$i++) {
+ my $line=&scantron_get_line($scanlines,$scan_data,$i);
+ if ($line=~/^[\s\cz]*$/) { next; }
+ $count++;
+ }
+ return $count;
+}
+
sub scantron_put_line {
- my ($scanlines,$i,$newline,$skip)=@_;
+ my ($scanlines,$scan_data,$i,$newline,$skip)=@_;
if ($skip) {
$scanlines->{'skipped'}[$i]=$newline;
+ &allow_skipping($scan_data,$i);
return;
}
$scanlines->{'corrected'}[$i]=$newline;
@@ -4030,7 +4148,7 @@ sub scantron_validate_ID {
my %found=('ids'=>{},'usernames'=>{});
for (my $i=0;$i<=$scanlines->{'count'};$i++) {
- my $line=&scantron_get_line($scanlines,$i);
+ my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
$scan_data);
@@ -4044,11 +4162,11 @@ sub scantron_validate_ID {
if ($found{'ids'}{$found}) {
&scantron_get_correction($r,$i,$scan_record,\%scantron_config,
$line,'duplicateID',$found);
- return(1);
+ return(1,$currentphase);
} elsif ($found{'usernames'}{$username}) {
&scantron_get_correction($r,$i,$scan_record,\%scantron_config,
$line,'duplicateID',$username);
- return(1);
+ return(1,$currentphase);
}
#FIXME store away line we previously saw the ID on to use above
$found{'ids'}{$found}++;
@@ -4060,18 +4178,18 @@ sub scantron_validate_ID {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
$line,'duplicateID',$username);
- return(1);
+ return(1,$currentphase);
} elsif (!defined($username)) {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
$line,'incorrectID');
- return(1);
+ return(1,$currentphase);
}
$found{'usernames'}{$username}++;
} else {
&scantron_get_correction($r,$i,$scan_record,\%scantron_config,
$line,'incorrectID');
- return(1);
+ return(1,$currentphase);
}
}
}
@@ -4122,7 +4240,7 @@ sub scantron_get_correction {
if ($error eq 'incorrectCODE') {
$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 ".join(', ',@{$arg}).", and CODEs are supposed to be unique
\n");
}
$r->print("The CODE on the form is ".
$$scan_record{'scantron.CODE'}." \n");
@@ -4133,8 +4251,21 @@ sub scantron_get_correction {
$$scan_record{'scantron.FirstName'}."
");
$r->print("How should I handle this? \n");
$r->print("\n ");
- $r->print(" Use the CODE ".$$scan_record{'scantron.CODE'}." that is was on the paper, ignoring the error.");
+ my $i=0;
+ if ($error eq 'incorrectCODE') {
+ my ($max,$closest)=&scantron_get_closely_matching_CODEs($arg,$$scan_record{'scantron.CODE'});
+ foreach my $testcode (@{$closest}) {
+ my $checked='';
+ if (!$i) { $checked=' checked="on" '; }
+ $r->print(" Use the similar CODE ".$testcode." instead. ");
+ $r->print("\n ");
+ $i++;
+ }
+ }
+ my $checked; if (!$i) { $checked=' checked="on" '; }
+ $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) {
@@ -4157,7 +4288,6 @@ ENDSCRIPT
$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");
$r->print(' ');
@@ -4204,9 +4334,38 @@ sub scantron_bubble_selector {
$r->print('');
}
+sub num_matches {
+ my ($orig,$code) = @_;
+ my @code=split(//,$code);
+ my @orig=split(//,$orig);
+ my $same=0;
+ for (my $i=0;$i{'count'};$i++) {
- my $line=&scantron_get_line($scanlines,$i);
+ my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
$scan_data);
@@ -4237,16 +4392,17 @@ sub scantron_validate_CODE {
if (!exists($allcodes{$CODE}) && !$$scan_record{'scantron.useCODE'}) {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
- $line,'incorrectCODE',$CODE);
- return(1);
+ $line,'incorrectCODE',\%allcodes);
+ return(1,$currentphase);
}
- if (exists($usedCODEs{$CODE}) && $ENV{'form.scantron_CODEunique'}) {
+ if (exists($usedCODEs{$CODE}) && $ENV{'form.scantron_CODEunique'}
+ && !$$scan_record{'scantron.CODE_ignore_dup'}) {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
- $line,'duplicateCODE',$CODE);
- return(1);
+ $line,'duplicateCODE',$usedCODEs{$CODE});
+ return(1,$currentphase);
}
- $usedCODEs{$CODE}++;
+ push (@{$usedCODEs{$CODE}},$$scan_record{'scantron.PaperID'});
}
return (0,$currentphase+1);
}
@@ -4261,7 +4417,7 @@ sub scantron_validate_doublebubble {
my %scantron_config=&get_scantron_config($ENV{'form.scantron_format'});
my ($scanlines,$scan_data)=&scantron_getfile();
for (my $i=0;$i<=$scanlines->{'count'};$i++) {
- my $line=&scantron_get_line($scanlines,$i);
+ my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
$scan_data);
@@ -4311,7 +4467,7 @@ sub scantron_validate_missingbubbles {
my $max_bubble=&scantron_get_maxbubble();
if (!$max_bubble) { $max_bubble=2**31; }
for (my $i=0;$i<=$scanlines->{'count'};$i++) {
- my $line=&scantron_get_line($scanlines,$i);
+ my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
$scan_data);
@@ -4356,18 +4512,25 @@ SCANTRONFORM
my @delayqueue;
my %completedstudents;
+ my $count=&get_todo_count($scanlines,$scan_data);
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Scantron Status',
- 'Scantron Progress',$scanlines->{'count'});
+ 'Scantron Progress',$count,
+ 'inline',undef,'scantronupload');
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
'Processing first student');
my $start=&Time::HiRes::time();
my $i=-1;
- my ($uname,$udom);
+ my ($uname,$udom,$started);
while ($i<$scanlines->{'count'}) {
($uname,$udom)=('','');
$i++;
- my $line=&scantron_get_line($scanlines,$i);
+ my $line=&scantron_get_line($scanlines,$scan_data,$i);
if ($line=~/^[\s\cz]*$/) { next; }
+ if ($started) {
+ &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
+ 'last student');
+ }
+ $started=1;
my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
$scan_data);
unless ($uname=&scantron_find_student($scan_record,$scan_data,
@@ -4388,27 +4551,30 @@ SCANTRONFORM
my $i=0;
foreach my $resource (@resources) {
$i++;
- my $result=&Apache::lonnet::ssi($resource->src(),
- ('submitted' =>'scantron',
- 'grade_target' =>'grade',
- 'grade_username'=>$uname,
- 'grade_domain' =>$udom,
- 'grade_courseid'=>$ENV{'request.course.id'},
- 'grade_symb' =>$resource->symb()));
+ my %form=('submitted' =>'scantron',
+ 'grade_target' =>'grade',
+ 'grade_username'=>$uname,
+ 'grade_domain' =>$udom,
+ 'grade_courseid'=>$ENV{'request.course.id'},
+ 'grade_symb' =>$resource->symb());
+ if (exists($scan_record->{'scantron.CODE'}) &&
+ $scan_record->{'scantron.CODE'}) {
+ $form{'CODE'}=$scan_record->{'scantron.CODE'};
+ }
+ my $result=&Apache::lonnet::ssi($resource->src(),%form);
+
}
$completedstudents{$uname}={'line'=>$line};
} continue {
&Apache::lonnet::delenv('form.counter');
&Apache::lonnet::delenv('scantron\.');
- &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last student');
}
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
# my $lasttime = &Time::HiRes::time()-$start;
# $r->print("took $lasttime
");
$navmap->untieHashes();
- $r->print("Done
");
+ $r->print("");
$r->print(&show_grading_menu_form($symb,$url));
return '';
}
@@ -4504,6 +4670,50 @@ sub scantron_upload_scantron_data_save {
return '';
}
+sub valid_file {
+ my ($requested_file)=@_;
+ foreach my $filename (sort(&scantron_filenames())) {
+ &Apache::lonnet::logthis("$requested_file $filename");
+ if ($requested_file eq $filename) { return 1; }
+ }
+ return 0;
+}
+
+sub scantron_download_scantron_data {
+ my ($r)=@_;
+ my $default_form_data=&defaultFormData(&get_symb_and_url($r,1));
+ my $cname=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+ my $file=$ENV{'form.scantron_selectfile'};
+ if (! &valid_file($file)) {
+ $r->print(<
+ The requested file name was invalid.
+
+ERROR
+ $r->print(&show_grading_menu_form(&get_symb_and_url($r,1)));
+ return;
+ }
+ my $orig='/uploaded/'.$cdom.'/'.$cname.'/scantron_orig_'.$file;
+ my $corrected='/uploaded/'.$cdom.'/'.$cname.'/scantron_corrected_'.$file;
+ my $skipped='/uploaded/'.$cdom.'/'.$cname.'/scantron_skipped_'.$file;
+ &Apache::lonnet::allowuploaded('/adm/grades',$orig);
+ &Apache::lonnet::allowuploaded('/adm/grades',$corrected);
+ &Apache::lonnet::allowuploaded('/adm/grades',$skipped);
+ $r->print(<
+ Original file as uploaded by the scantron office.
+
+
+ Corrections , a file of corrected records that were used in grading.
+
+
+ Skipped , a file of records that were skipped.
+
+DOWNLOAD
+ $r->print(&show_grading_menu_form(&get_symb_and_url($r,1)));
+ return '';
+}
#-------- end of section for handling grading scantron forms -------
#
@@ -4795,7 +5005,7 @@ sub handler {
(&Apache::lonnet::allowed('usc',$ENV{'request.role.domain'})||
&Apache::lonnet::allowed('usc',$ENV{'request.course.id'}))) {
$request->print(&scantron_upload_scantron_data_save($request));
- } elsif ($command eq 'scantrondownload' &&
+ } elsif ($command eq 'scantron_download' &&
&Apache::lonnet::allowed('usc',$ENV{'request.course.id'})) {
$request->print(&scantron_download_scantron_data($request));
} elsif ($command) {