Have an idea?

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

Randomizing with constructive list

I have a multiple select question with certains attributes are visible to respondnts based on some condtions. Here is the code I have used to buuld constructive list. All these attributes   needs to be randomized except the last one. When D2=1, attribute 3 & 4 will be invisible; D2=2, attribute 5 will be invisilbe. In this situation I am unable to randmize by specifiying StartMember# and EndMember# as the list will have different attributes based on the condtion each time.

Is there a way to not randomize the last attribute in any given members in the list?

Begin Unverified Perl
 {ADD("D29List",1); }
End Unverified
asked Jul 12, 2012 by Lawrence Bronze (2,100 points)
retagged Sep 13, 2012 by Walter Williams

2 Answers

0 votes
Best answer
lets assume your list above is named Con1, define another constructed list named con2 and set its parent to D29List as well. use the following logic to create con2
answered Jul 12, 2012 by Bahadir Ozkurt Gold (16,830 points)
Thanks Bahadir! Smart code.
0 votes
If you wanted to do it in just one list, you could think a little backwards about adding (removing):


Begin Unverified Perl
if(VALUE("D2") == 1)
if(VALUE("D26_C1") >= 4)
End Unverified
answered Jul 12, 2012 by Brian McEwan Gold Sawtooth Software, Inc. (37,610 points)
Both nice solutions by Brian and Bahadir. So many people don't use the power of the constructed list functions.