version 1.56, 2004/08/24 16:01:18
|
version 1.57, 2004/11/19 22:26:37
|
Line 267 sub end_stringhint {
|
Line 267 sub end_stringhint {
|
my ($ad,$msg); |
my ($ad,$msg); |
if ($type eq 're' ) { |
if ($type eq 're' ) { |
${$safeeval->varglob('LONCAPA::response')}=$response; |
${$safeeval->varglob('LONCAPA::response')}=$response; |
$result = &Apache::run::run('return $LONCAPA::response=~m'.$answer,$safeeval); |
my $compare='='; |
|
if ($answer=~/^\s*NOT\s*/) { |
|
$answer=~s/^\s*NOT\s*//; |
|
$compare='!'; |
|
} |
|
my $test='$LONCAPA::response'.$compare.'~m'.$answer; |
|
&Apache::lonxml::debug("test $test"); |
|
$result = &Apache::run::run("return $test",$safeeval); |
&Apache::lonxml::debug("current $response"); |
&Apache::lonxml::debug("current $response"); |
&Apache::lonxml::debug("current $answer"); |
&Apache::lonxml::debug("current $answer"); |
$ad = ($result) ? 'APPROX_ANS' : 'INCORRECT'; |
$ad = ($result) ? 'APPROX_ANS' : 'INCORRECT'; |