Have an idea?

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

randomize a constructed list

I am trying to randomize a constructed list. Below is how I am constructing my list:

The parent list has 15 responses, but my constructed list should only pipe in the predetermined responses based on the selected answers in the previous question.

constructed list:

Begin Unverified Perl
End Unverified

I am then using the constructed list for Q2. Everything works fine, but now I am having trouble randomizing the responses in Q2.


asked Dec 8, 2016 by mmeads (200 points)

1 Answer

+2 votes
Just add


before the "End Unverified" and you should be good to go.
answered Dec 8, 2016 by Zachary Platinum Sawtooth Software, Inc. (98,125 points)
Thanks! So that works, but how do I anchor the Other, please specify response to the be the last response on the list?
You just need to add the other specify item after doing the randomization.  Consider this example:

ADD('parent', 1, 3);
ADD('parent', 4);

This will add all four list items, but only the first three will be randomized.  The fourth item will always appear last.
Thanks! That worked like a charm! I bet  you have already guessed that I am very new to Sawtooth and Perl.
Hey, we all have to start somewhere.  I'm happy to help with your Perl needs as you get going.