[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 04 Jun 2005 19:05:33 -0000


albertel		Sat Jun  4 15:05:33 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - BUG #3728, if CODE is blank don't show the whole list of codes.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.272 loncom/homework/grades.pm:1.273
--- loncom/homework/grades.pm:1.272	Sat Jun  4 15:02:19 2005
+++ loncom/homework/grades.pm	Sat Jun  4 15:05:31 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.272 2005/06/04 19:02:19 albertel Exp $
+# $Id: grades.pm,v 1.273 2005/06/04 19:05:31 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4735,7 +4735,8 @@
 	$r->print("<p>How should I handle this? <br /> \n");
 	$r->print("\n<br /> ");
 	my $i=0;
-	if ($error eq 'incorrectCODE') {
+	if ($error eq 'incorrectCODE' 
+	    && $$scan_record{'scantron.CODE'}=~/\S/ ) {
 	    my ($max,$closest)=&scantron_get_closely_matching_CODEs($arg,$$scan_record{'scantron.CODE'});
 	    foreach my $testcode (@{$closest}) {
 		my $checked='';
@@ -4745,9 +4746,11 @@
 		$i++;
 	    }
 	}
-	my $checked; if (!$i) { $checked=' checked="on" '; }
-	$r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_unfound' $checked /> Use the CODE <b><tt>".$$scan_record{'scantron.CODE'}."</tt></b> that is was on the paper, ignoring the error.</label>");
-	$r->print("\n<br />");
+	if ($$scan_record{'scantron.CODE'}=~/\S/ ) {
+	    my $checked; if (!$i) { $checked=' checked="on" '; }
+	    $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_unfound' $checked /> Use the CODE <b><tt>".$$scan_record{'scantron.CODE'}."</tt></b> that is was on the paper, ignoring the error.</label>");
+	    $r->print("\n<br />");
+	}
 
 	$r->print(<<ENDSCRIPT);
 <script type="text/javascript">