--- loncom/homework/default_homework.lcpm 2008/03/05 18:24:07 1.129 +++ loncom/homework/default_homework.lcpm 2008/03/06 01:54:16 1.130 @@ -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.129 2008/03/05 18:24:07 www Exp $ +# $Id: default_homework.lcpm,v 1.130 2008/03/06 01:54:16 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -157,7 +157,7 @@ sub caparesponse_check { #&LONCAPA_INTERNAL_DEBUG(" type is $type "); if ($type eq 'cs' || $type eq 'ci') { - #for string answers make surec all places spaces occur, there is + #for string answers make sure all places spaces occur, there is #really only 1 space, in both the answer and the response $answer=~s/ +/ /g; $response=~s/ +/ /g; @@ -311,7 +311,7 @@ sub caparesponse_check_list { if ($type eq '' || $type eq 'float') { #for numerical problems split off the unit # if ( $responses->[0][-1]=~ /(.*[^\s])\s+([^\s]+)/ ) { - if ( $responses->[0][-1]=~ /^([\d\.\,\s\$]*(?:(?:[xX\*]10[\^\*]*|[eE]*)[\+\-]*\d*)*(?:^|\S)\d)([\w\s][\$\s\w\^\*\/\(\)\+\-]*\D[\$\s\w\^\*\/\(\)\+\-]*)$/ ) { + if ( $responses->[0][-1]=~ /^([\d\.\,\s\$]*(?:(?:[xX\*]10[\^\*]*|[eE]*)[\+\-]*\d*)*(?:^|\S)\d+)([\$\s\w\^\*\/\(\)\+\-]*\D[\$\s\w\^\*\/\(\)\+\-]*)$/ ) { $responses->[0][-1]=$1; $unit=&capa_formula_fix($2); &LONCAPA_INTERNAL_DEBUG("Found unit :$unit:");