version 1.171, 2005/06/26 22:30:05
|
version 1.175, 2005/07/14 02:52:22
|
Line 353 sub end_numericalresponse {
|
Line 353 sub end_numericalresponse {
|
#} |
#} |
} |
} |
my $response=$ans; |
my $response=$ans; |
if ($unit) { |
my $hideunit=&Apache::lonnet::EXT('resource.'.$partid.'_'. |
|
$id.'.turnoffunit'); |
|
if ($unit ne '' && |
|
! ($Apache::lonhomework::type eq 'exam' || |
|
lc($hideunit) eq "yes") ) { |
my $cleanunit=$unit; |
my $cleanunit=$unit; |
$cleanunit=~s/\$\,//g; |
$cleanunit=~s/\$\,//g; |
$response.=" $cleanunit"; |
$response.=" $cleanunit"; |
Line 382 sub end_numericalresponse {
|
Line 386 sub end_numericalresponse {
|
$parstack,$safeeval); |
$parstack,$safeeval); |
my ($ad,$msg) =&Apache::inputtags::finalizeawards($awards,$msgs); |
my ($ad,$msg) =&Apache::inputtags::finalizeawards($awards,$msgs); |
if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') { |
if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') { |
# answer failed check if it is sig figs that is failing |
my $error; |
my ($awards,$msgs)=&check_submission($response,$partid,$id, |
if ($tag eq 'formularesponse') { |
$tag,$parstack,$safeeval, |
$error=&mt('Computer\'s answer is incorrect ("[_1]").'); |
1); |
} else { |
my ($ad,$msg)=&Apache::inputtags::finalizeawards($awards, |
# answer failed check if it is sig figs that is failing |
$msgs); |
my ($awards,$msgs)=&check_submission($response,$partid,$id, |
|
$tag,$parstack, |
my $msg=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") or significant figures ("[_4]" to "[_5]") needs to be adjusted',$response,$low,$high,$siglow,$sighigh); |
$safeeval,1); |
|
($ad,$msg)=&Apache::inputtags::finalizeawards($awards, |
|
$msgs); |
|
|
|
if ($siglow ne '' && $sighigh ne '') { |
|
$error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") or significant figures ("[_4]" to "[_5]") need to be adjusted.',$response,$low,$high,$siglow,$sighigh); |
|
} else { |
|
$error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") needs to be adjusted.',$response,$low,$high); |
|
} |
|
} |
if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') { |
if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') { |
&Apache::lonxml::error($msg); |
&Apache::lonxml::error($error); |
} else { |
} else { |
&Apache::lonxml::warning($msg); |
&Apache::lonxml::warning($error); |
} |
} |
} |
} |
} |
} |