version 1.31, 2001/07/19 21:26:22
|
version 1.32, 2001/07/23 22:40:59
|
Line 25 sub caparesponse_check {
|
Line 25 sub caparesponse_check {
|
my $calc=''; |
my $calc=''; |
my ($response,$expr)=@_; |
my ($response,$expr)=@_; |
|
|
|
|
($answer,$type,$tol,$sig,$ans_fmt, |
($answer,$type,$tol,$sig,$ans_fmt, |
$unit,$calc) = eval $expr.';return ($answer,$type,$tol,$sig,$ans_fmt,$unit,$calc);'; |
$unit,$calc) = eval $expr.';return ($answer,$type,$tol,$sig,$ans_fmt,$unit,$calc);'; |
#type's definitons come from capaParser.h |
#type's definitons come from capaParser.h |
my $message=''; |
my $message=''; |
|
#remove leading and trailing whitespace |
|
if ($response=~ /^\s|\s$/) { |
|
$response=~ s:^\s+|\s+$::g; |
|
$message .="Removed ws now :$response:<br />"; |
|
} else { |
|
$message .="no ws in :$response:<br />"; |
|
} |
|
|
if ($type eq '' ) { |
if ($type eq '' ) { |
$message .= "Didn't find a type :$type:$expr: defaulting<br />"; |
$message .= "Didn't find a type :$type:$expr: defaulting<br />"; |
if ( $answer eq ($answer *1.0)) { $type = 2; |
if ( $answer eq ($answer *1.0)) { $type = 2; |
Line 99 sub caparesponse_check_list {
|
Line 108 sub caparesponse_check_list {
|
my $current_answer; |
my $current_answer; |
$result.="Got response :$CAPARESPONSE_CHECK_LIST_answer:$list[0]:<br />"; |
$result.="Got response :$CAPARESPONSE_CHECK_LIST_answer:$list[0]:<br />"; |
my @responselist; |
my @responselist; |
|
my $type =eval $expr.';return $answer;'; |
if ($type ne '' && $#list > 0) { |
if ($type ne '' && $#list > 0) { |
(@responselist)=split /,/,$response; |
(@responselist)=split /,/,$response; |
} else { |
} else { |