diff --git a/lib/WebGUI/Asset/Wobject/Survey/Test.pm b/lib/WebGUI/Asset/Wobject/Survey/Test.pm index b2107b338..7cdfa1053 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/Test.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/Test.pm @@ -306,7 +306,7 @@ sub _test { return fail($testCount, "determine answer for $variable", "No answers matched text: '$spec'"); } $self->session->log->debug("Recording $variable ($answerAddress) => $answer->{recordedAnswer}"); - $responses->{$answerAddress} = $answer->{recordedAnswer}; + $responses->{$answerAddress} = 1; } } @@ -444,8 +444,7 @@ sub _test_mc { my $answerAddress = "$address->[0]-$address->[1]-$aIndex"; my $answer = $answers->[$aIndex]; - my $recordedAnswer = $answer->{recordedAnswer}; - $responses->{$answerAddress} = $recordedAnswer; + $responses->{$answerAddress} = 1; my $name = $opts{name}; # get this fresh for every subtest if ($name) { @@ -458,7 +457,7 @@ sub _test_mc { $name .= " for $variable mc answer " . ($aIndex + 1); } - $self->session->log->debug("Recording answer for mc question $variable at index $aIndex ($answerAddress) => $recordedAnswer"); + $self->session->log->debug("Choosing mc question $variable answer index $aIndex ($answerAddress)"); push @tap, $self->_recordResponses( { responseJSON => $rJSON, responses => $responses, diff --git a/t/Asset/Wobject/Survey/Test.t b/t/Asset/Wobject/Survey/Test.t index 1f6a3712e..c15553123 100644 --- a/t/Asset/Wobject/Survey/Test.t +++ b/t/Asset/Wobject/Survey/Test.t @@ -83,8 +83,8 @@ $s->surveyJSON_update( [ 0, 0 ], { questionType => 'Yes/No' } ); # S0Q0 is a Yes $s->surveyJSON_update( [ 0, 0 ], { gotoExpression => q{ tag('tagged at S0Q0'); } } ); # S0Q0 tagged data $s->surveyJSON_update( [ 1, 0 ], { questionType => 'Yes/No' } ); # S1Q0 is a Yes/No -$s->surveyJSON_update( [ 1, 0, 0 ], { goto => 'S3' } ); # S1Q0 answer 0 jumps to S3 -$s->surveyJSON_update( [ 1, 0, 1 ], { gotoExpression => q{ tag('tagged at S1Q0', 999); } } );# S1Q0 answer 1 tagged numeric data +$s->surveyJSON_update( [ 1, 0, 0 ], { goto => 'S3', recordedAnswer => q{} } ); # S1Q0 answer 0 jumps to S3 (set recordedAnswer to '' to detect subtle bug) +$s->surveyJSON_update( [ 1, 0, 1 ], { gotoExpression => q{ tag('tagged at S1Q0', 999); }, recordedAnswer => q{} } );# S1Q0 answer 1 tagged numeric data $s->surveyJSON_update( [ 3 ], { gotoExpression => q{ jump { score(S3) == 0 } S5; } } ); # jump to S5 if all 3 questions answered as No for my $qIndex (0..2) { @@ -596,7 +596,7 @@ $spec = <