[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sat, 06 Sep 2008 21:39:16 -0000


raeburn		Sat Sep  6 17:39:16 2008 EDT

  Modified files:              
    /loncom/homework	default_homework.lcpm 
  Log:
  Fix bug 5785.
  - Removal of spaces from user responses to stringresponse questions when checking for correctness is a side effect of rev 1.133 which addressed bug 4680.
  
  
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.137 loncom/homework/default_homework.lcpm:1.138
--- loncom/homework/default_homework.lcpm:1.137	Sat Jun 14 12:34:54 2008
+++ loncom/homework/default_homework.lcpm	Sat Sep  6 17:39:15 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
 #
-# $Id: default_homework.lcpm,v 1.137 2008/06/14 16:34:54 www Exp $
+# $Id: default_homework.lcpm,v 1.138 2008/09/06 21:39:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -316,7 +316,9 @@
     $unit=~s/\s//;
     foreach my $response (@$responses) {
        foreach my $element (@$response) {	
-          $element =~ s/\s//g;
+          if (($type eq 'float') || (($type eq '') && ($unit ne ''))) {
+              $element =~ s/\s//g;
+          }
           my $appendunit=$unit;
           if ($unit=~/\%/) {
              $element=$element/100;