[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 17 Jun 2005 20:24:56 -0000
albertel Fri Jun 17 16:24:56 2005 EDT
Modified files:
/loncom/homework default_homework.lcpm
Log:
- BIUG#4088, string response in mc mode ignores spaces and commas in instructor answer and student response.
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.99 loncom/homework/default_homework.lcpm:1.100
--- loncom/homework/default_homework.lcpm:1.99 Fri Apr 1 08:58:25 2005
+++ loncom/homework/default_homework.lcpm Fri Jun 17 16:24:56 2005
@@ -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.99 2005/04/01 13:58:25 ng Exp $
+# $Id: default_homework.lcpm,v 1.100 2005/06/17 20:24:56 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -89,11 +89,15 @@
} else {
$message .="no ws in :$response:\n";
}
- if ($type eq 'cs' || $type eq 'ci' || $type eq 'mc') {
+ &LONCAPA_INTERNAL_DEBUG(" type is $type ");
+ if ($type eq 'cs' || $type eq 'ci') {
#for string answers make surec all places spaces occur, there is
#really only 1 space, in both the answer and the response
$answer=~s/ +/ /g;
$response=~s/ +/ /g;
+ } elsif ($type eq 'mc') {
+ $answer=~s/[\s,]//g;
+ $response=~s/[\s,]//g;
}
if ($type eq 'float' && $unit=~/\$/) {
if ($response!~/^\$/) { return "NO_UNIT: Missing \$ "; }