Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

forgot to mention the 'bargain' and 'expensive' questions are randomized

this doesn't seem to be working for me, i forgot to mention that the 2 questions (on separate pages) are randomized.  will this impact the coding?
asked Mar 24, 2017 by clare (190 points)

1 Answer

0 votes
Best answer
That's an interesting situation.  What I would do is put the custom verification in both questions, but use the Sawtooth Script function "Answered" so that the verification is only ran for whichever question comes last.

Bargain verification:

if ([% Answered(ExpensiveQ) %] && [% ExpensiveQ %] < SSI_GetValue('BargainQ')) {
    strErrorMessage = 'BargainQ error';

Expensive verification:

if ([% Answered(BargainQ) %] && SSI_GetValue('ExpensiveQ') < [% BargainQ %]) {
    strErrorMessage = 'ExpensiveQ error';

Like before, "BargainQ" and "ExpensiveQ" should be replaced with the names of those two questions.
answered Mar 24, 2017 by Zachary Platinum Sawtooth Software, Inc. (144,125 points)
selected Mar 27, 2017 by clare
thanks so much for the help on this!