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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 29 Sep 2004 05:47:33 -0000


albertel		Wed Sep 29 01:47:33 2004 EDT

  Modified files:              
    /loncom/homework	optionresponse.pm 
  Log:
  - unbubbled scantron responses in optionresponse were treated as if the user had bubbled A BUG#3508
  
  
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.119 loncom/homework/optionresponse.pm:1.120
--- loncom/homework/optionresponse.pm:1.119	Wed Aug 25 16:00:31 2004
+++ loncom/homework/optionresponse.pm	Wed Sep 29 01:47:33 2004
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.119 2004/08/25 20:00:31 albertel Exp $
+# $Id: optionresponse.pm,v 1.120 2004/09/29 05:47:33 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -192,7 +192,7 @@
 	my $ignored=0;
 	foreach $name (@whichopt) {
 	  my $response=&Apache::response::getresponse($temp);
-	  if ($ENV{'form.submitted'} eq 'scantron') {
+	  if ($ENV{'form.submitted'} eq 'scantron' && $response=~/\S/) {
 	      $response = $opt[$response];
 	  }
 	  if ( $response =~ /[^\s]/) {
@@ -238,7 +238,11 @@
 	} else {
 	    my $ad;
 	    if ($wrong==0 && $right==0) {
-		#nothing submitted
+		#nothing submitted only assign a score if we 
+		#need to override a previous grade
+		if (defined($Apache::lonhomework::history{"resource.$part.$id.awarddetail"})) {
+		    $ad='ASSIGNED_SCORE';
+		}
 	    } else {
 		$ad='ASSIGNED_SCORE';
 	    }