'.$timestamp.' | ';
+ if ($isCODE) {
+ $studentTable.=''.$record->{$version.':resource.CODE'}.' | ';
+ }
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
foreach my $partid (@{$parts}) {
@@ -4295,8 +4301,8 @@ sub scantron_get_correction {
} elsif ($error eq 'duplicateCODE') {
$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");
+ $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 ".
@@ -4442,6 +4448,12 @@ sub scantron_validate_CODE {
$scan_data);
my $CODE=$$scan_record{'scantron.CODE'};
my $error=0;
+ if (!&Apache::lonnet::validCODE($CODE)) {
+ &scantron_get_correction($r,$i,$scan_record,
+ \%scantron_config,
+ $line,'incorrectCODE',\%allcodes);
+ return(1,$currentphase);
+ }
if (%allcodes && !exists($allcodes{$CODE})
&& !$$scan_record{'scantron.useCODE'}) {
&scantron_get_correction($r,$i,$scan_record,
@@ -4615,6 +4627,8 @@ SCANTRONFORM
if (exists($scan_record->{'scantron.CODE'}) &&
$scan_record->{'scantron.CODE'}) {
$form{'CODE'}=$scan_record->{'scantron.CODE'};
+ } else {
+ $form{'CODE'}='';
}
my $result=&Apache::lonnet::ssi($resource->src(),%form);
if (&Apache::loncommon::connection_aborted($r)) { last; }