--- loncom/homework/caparesponse/caparesponse.pm 2005/08/17 16:37:11 1.178 +++ loncom/homework/caparesponse/caparesponse.pm 2005/09/08 17:49:22 1.180 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.178 2005/08/17 16:37:11 albertel Exp $ +# $Id: caparesponse.pm,v 1.180 2005/09/08 17:49:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -422,7 +422,7 @@ sub end_numericalresponse { if ($sigline ne '') { $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_2] or significant figures [_3] need to be adjusted.',$response,$tolline,$sigline); } else { - $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_1] needs to be adjusted.',$response,$tolline); + $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_2] needs to be adjusted.',$response,$tolline); } } if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') { @@ -700,7 +700,7 @@ sub end_stringresponse { # $answer=$token->[2]->{'answer'}; # } ${$safeeval->varglob('LONCAPA::response')}=$response; - $result = &Apache::run::run('return $LONCAPA::response=~m'.$answer,$safeeval); + $result = &Apache::run::run('if ($LONCAPA::response=~m'.$answer.') { return 1; } else { return 0; }',$safeeval); &Apache::lonxml::debug("current $response"); &Apache::lonxml::debug("current $answer"); $ad = ($result) ? 'APPROX_ANS' : 'INCORRECT';