version 1.88, 2004/10/05 20:18:29
|
version 1.89, 2004/10/05 20:30:17
|
Line 70 sub caparesponse_check {
|
Line 70 sub caparesponse_check {
|
$response=~s/ +/ /g; |
$response=~s/ +/ /g; |
} |
} |
if ($type eq 'float') { $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 ($type eq 'float' && $ans_fmt=~/\$/) { |
if ($response!~/^\$/) { return "NO_UNIT: Missing \$ "; } |
if ($response!~/^\$/) { return "NO_UNIT: Missing \$ "; } |
$response=~s/\$//g; |
$response=~s/\$//g; |
Line 537 sub chemparse {
|
Line 536 sub chemparse {
|
|
|
sub prettyprint { |
sub prettyprint { |
my ($value,$fmt,$target)=@_; |
my ($value,$fmt,$target)=@_; |
&LONCAPA_INTERNAL_DEBUG("format -$fmt-"); |
|
my $result; |
my $result; |
if (!$target) { $target = $external::target; } |
if (!$target) { $target = $external::target; } |
if ($fmt =~ /chem/i) { return(&chemparse($value)); } |
if ($fmt =~ /chem/i) { return(&chemparse($value)); } |