--- loncom/homework/default_homework.lcpm 2004/10/05 20:18:29 1.88 +++ loncom/homework/default_homework.lcpm 2004/10/11 16:31:34 1.90 @@ -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.88 2004/10/05 20:18:29 albertel Exp $ +# $Id: default_homework.lcpm,v 1.90 2004/10/11 16:31:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,7 +70,6 @@ sub caparesponse_check { $response=~s/ +/ /g; } if ($type eq 'float') { $response=~s/,//g; } - &LONCAPA_INTERNAL_DEBUG("fmt $ans_fmt, res is $response"); if ($type eq 'float' && $ans_fmt=~/\$/) { if ($response!~/^\$/) { return "NO_UNIT: Missing \$ "; } $response=~s/\$//g; @@ -515,8 +514,8 @@ sub chemparse { } next; } - $token =~ /^\s*(\d*)(.*)/; - $formula .= $1 if ($1 > 1); # stoichiometric coefficient + $token =~ /^\s*(\d*(?:&frac\d\d)?)(.*)/; + $formula .= $1 if ($1 ne '1'); # stoichiometric coefficient my $molecule = $2; # subscripts @@ -537,7 +536,6 @@ sub chemparse { sub prettyprint { my ($value,$fmt,$target)=@_; - &LONCAPA_INTERNAL_DEBUG("format -$fmt-"); my $result; if (!$target) { $target = $external::target; } if ($fmt =~ /chem/i) { return(&chemparse($value)); }