--- loncom/homework/grades.pm 2004/10/07 22:12:47 1.220 +++ loncom/homework/grades.pm 2004/10/14 20:39:34 1.221 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.220 2004/10/07 22:12:47 albertel Exp $ +# $Id: grades.pm,v 1.221 2004/10/14 20:39:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4460,7 +4460,8 @@ sub scantron_validate_CODE { $scan_data); my $CODE=$$scan_record{'scantron.CODE'}; my $error=0; - if (!exists($allcodes{$CODE}) && !$$scan_record{'scantron.useCODE'}) { + if (%allcodes && !exists($allcodes{$CODE}) + && !$$scan_record{'scantron.useCODE'}) { &scantron_get_correction($r,$i,$scan_record, \%scantron_config, $line,'incorrectCODE',\%allcodes);