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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 12 Feb 2007 23:09:15 -0000


albertel		Mon Feb 12 18:09:15 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - Was handling the number mode scantron lines, 0 <-> J
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.388 loncom/homework/grades.pm:1.389
--- loncom/homework/grades.pm:1.388	Thu Jan  4 16:24:39 2007
+++ loncom/homework/grades.pm	Mon Feb 12 18:09:14 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.388 2007/01/04 21:24:39 raeburn Exp $
+# $Id: grades.pm,v 1.389 2007/02/12 23:09:14 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4638,6 +4638,7 @@
 		$answer=$alphabet[$args->{'response'}];
 	    } elsif ($on eq 'number') {
 		$answer=$args->{'response'}+1;
+		if ($answer == 10) { $answer = '0'; }
 	    } else {
 		substr($answer,$args->{'response'},1)=$on;
 	    }
@@ -4708,7 +4709,7 @@
 		|| $currentquest eq '*') {
 		push(@{$record{'scantron.doubleerror'}},$questnum);
 		$record{"scantron.$questnum.answer"}='';
-	    } elsif (!$currentquest 
+	    } elsif (!defined($currentquest)
 		     || $currentquest eq $$scantron_config{'Qoff'}
 		     || $currentquest !~ /^[A-Z]$/) {
 		$record{"scantron.$questnum.answer"}='';
@@ -4723,9 +4724,9 @@
 		|| $currentquest eq '*') {
 		push(@{$record{'scantron.doubleerror'}},$questnum);
 		$record{"scantron.$questnum.answer"}='';
-		} elsif (!$currentquest 
-			 || $currentquest eq $$scantron_config{'Qoff'} 
-			 || $currentquest !~ /^\d$/) {
+	    } elsif (!defined($currentquest)
+		     || $currentquest eq $$scantron_config{'Qoff'} 
+		     || $currentquest !~ /^\d$/) {
 		$record{"scantron.$questnum.answer"}='';
 		if (!&scan_data($scan_data,"$whichline.no_bubble.$questnum")) {
 		    push(@{$record{"scantron.missingerror"}},$questnum);