version 1.61, 2003/04/30 21:10:50
|
version 1.63, 2003/06/07 03:52:39
|
Line 62 sub caparesponse_check {
|
Line 62 sub caparesponse_check {
|
$message .="no ws in :$response:\n"; |
$message .="no ws in :$response:\n"; |
} |
} |
|
|
|
if (length($response) > 500) { return "TOO_LONG: Answer too long"; } |
|
|
if ($type eq '' ) { |
if ($type eq '' ) { |
$message .= "Didn't find a type :$type:$expr: defaulting\n"; |
$message .= "Didn't find a type :$type:$expr: defaulting\n"; |
if ( $answer eq ($answer *1.0)) { $type = 2; |
if ( $answer eq ($answer *1.0)) { $type = 2; |
Line 134 sub get_array_args {
|
Line 136 sub get_array_args {
|
my ($expr,$arg)=@_; |
my ($expr,$arg)=@_; |
# do these first, because who knows what varname the instructor might have used |
# do these first, because who knows what varname the instructor might have used |
# but it probably isn't $CAPARESPONSE_CHECK_LIST_answer |
# but it probably isn't $CAPARESPONSE_CHECK_LIST_answer |
my $CAPARESPONSE_CHECK_LIST_answer = eval $expr.';return $'.$arg; #' |
my $CAPARESPONSE_CHECK_LIST_answer = eval $expr.';return $'.$arg; #' stupid emacs |
my $GET_ARRAY_ARGS_result; |
my $GET_ARRAY_ARGS_result; |
my @GET_ARRAY_ARGS_list; |
my @GET_ARRAY_ARGS_list; |
if ($CAPARESPONSE_CHECK_LIST_answer =~ /^\s*[\$\@]/) { |
if ($CAPARESPONSE_CHECK_LIST_answer =~ /^\s*[\$\@]/) { |
Line 154 sub caparesponse_check_list {
|
Line 156 sub caparesponse_check_list {
|
$expr =~ s/\\/\\\\/g; |
$expr =~ s/\\/\\\\/g; |
$expr =~ s/\'/\\\'/g; |
$expr =~ s/\'/\\\'/g; |
my ($result,@list) = &get_array_args($expr,'answer'); |
my ($result,@list) = &get_array_args($expr,'answer'); |
|
$expr =~ s/\\\'/\'/g; |
|
$expr =~ s/\\\\/\\/g; |
my $aresult=''; |
my $aresult=''; |
my $current_answer; |
my $current_answer; |
my $answers=join(':',@list); |
my $answers=join(':',@list); |