Fixed Survey expression validation handling of verbatim values

This commit is contained in:
Patrick Donelan 2009-05-11 08:16:14 +00:00
parent 7a3ecea4bb
commit 639a3398f0

View file

@ -44,7 +44,13 @@ Returns the recorded response value for the answer to question_variable
sub value {
my $key = shift;
_validateVariable($key, 'value');
# Verbatim values are valid variable + _verbatim
if (my ($verbatimKey) = $key =~ m/(.+)_verbatim/) {
_validateVariable($verbatimKey, 'value');
} else {
_validateVariable($key, 'value');
}
my $value = $tags->{$key} || $values->{$key};
if (ref $value eq 'ARRAY') {
my $joined = join ', ', @$value;