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

www lon-capa-cvs-allow@mail.lon-capa.org
Wed, 05 Mar 2008 15:31:59 -0000


www		Wed Mar  5 10:31:59 2008 EDT

  Modified files:              
    /loncom/homework	default_homework.lcpm 
  Log:
  For dollar-type problems (e.g., answer: "$1.99"), the Computer's Answer was
  wrong (computer would enter "1.99 $"). 
  
  
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.125 loncom/homework/default_homework.lcpm:1.126
--- loncom/homework/default_homework.lcpm:1.125	Mon Mar  3 14:14:51 2008
+++ loncom/homework/default_homework.lcpm	Wed Mar  5 10:31:57 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.125 2008/03/03 19:14:51 www Exp $
+# $Id: default_homework.lcpm,v 1.126 2008/03/05 15:31:57 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -166,7 +166,7 @@
 	$response=~s/[\s,]//g;
     }
     if ($type eq 'float' && $unit=~/\$/) {
-	if ($response!~/^\$/)  { return ('NO_UNIT', undef); }
+	if ($response!~/^\$|\$$/)  { return ('NO_UNIT', undef); }
 	$response=~s/\$//g;
     }
     if ($type eq 'float' && $unit=~/\,/ && (&check_commas($response)<0)) {