--- loncom/homework/grades.pm 2004/11/02 20:48:02 1.223
+++ loncom/homework/grades.pm 2004/11/17 20:32:44 1.228
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.223 2004/11/02 20:48:02 albertel Exp $
+# $Id: grades.pm,v 1.228 2004/11/17 20:32:44 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3196,9 +3196,12 @@ sub displayPage {
sub displaySubByDates {
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_;
+ my $isCODE=0;
+ if (exists($record->{'resource.CODE'})) { $isCODE=1; }
my $studentTable='
'.
'
'.
'
Date/Time
'.
+ ($isCODE?'
CODE
':'').
'
Submission
'.
'
Status
';
my ($version);
@@ -3211,6 +3214,9 @@ sub displaySubByDates {
for ($version=1;$version<=$$record{'version'};$version++) {
my $timestamp = scalar(localtime($$record{$version.':timestamp'}));
$studentTable.='
'.$timestamp.'
';
+ if ($isCODE) {
+ $studentTable.='
'.$record->{$version.':resource.CODE'}.'
';
+ }
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
foreach my $partid (@{$parts}) {
@@ -3468,7 +3474,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 (sort(@names)) {
+ foreach my $name (sort {uc($a) cmp uc($b)} @names) {
if ($name =~ /^error: 2 /) { next; }
$namechoice.='';
}
@@ -3505,8 +3511,8 @@ sub scantron_selectphase {
$result.= <
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 +4447,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,8 +4626,14 @@ 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 ($result ne '') {
+ &Apache::lonnet::logthis("scantron grading error -> $result");
+ &Apache::lonnet::logthis("scantron grading error info name $uname domain $domain course $ENV{'request.course.id'} url $resource->src()");
+ }
if (&Apache::loncommon::connection_aborted($r)) { last; }
}
$completedstudents{$uname}={'line'=>$line};