Fixed Survey's handling of multi-answer questions (e.g. maxAnswers != 1)

Now stores all supplied answers to multi-answer question as arrayref
Variable [[var]] text replacement converts to comma-separated list
Expression Engine's value() returns appropriate value depending on context
Expression Engine's score() does sum of multi-answers, as you would expect
Updated related i18n & hover-help, and tests
Cleaned up survey js somewhat
This commit is contained in:
Patrick Donelan 2009-05-08 08:00:04 +00:00
parent 88d6a0d067
commit cf98c81461
6 changed files with 220 additions and 203 deletions

View file

@ -22,7 +22,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 50;
my $tests = 52;
plan tests => $tests + 1;
#----------------------------------------------------------------------------
@ -46,6 +46,7 @@ SKIP: {
my %values = (
n => 5,
s1 => 'my string',
multi => [ 'answer1', 'answer2' ],
);
my %scores = (
@ -76,6 +77,8 @@ SKIP: {
q{jump { sum(value(n),1,1,1) == 8 } target}, # List::Util sum, etc..
q{jump { score(n1) == 1 && score(n2) == 2 } target}, # score() works
q{jump { answered(n) && !answered(X) } target}, # answered() works
q{jump { value(multi) eq 'answer1, answer2' } target}, # multi-answer question stringifies in scalar context
q{jump { (value(multi))[1] eq 'answer2' } target}, # multi-answer question returns list in list context
);
my @should_not_jump = (