# Select a block randomly if more than one selected

Hi guys, I'm new with Sawtooth so i guess my question should be really easy for you :)

Here is my problem: I have a multiple response question with 3 possibilities (lets say ProductA, ProductB, ProductC). If the customer selects only one product, he will answer a block of questions regarding that product (that's the easy part, the one I accomplished).

But, if he select more than 1 products, lets say ProductA and ProductB, I want to randonmly choose one of this products, A or B, and he only answers to the respective block of questions.

I've been able to reach the solution for the case where he selects all the answers, because I only have to generate a random number and make a skip-logic to that number. But with two products, it can be A and B or A and C or B and C. (In my case i have a lot of products, if it were only 3 it would be simple, i guess).

I know my English is poor, sorry for that, hope you understand! :)

Cheers,

Bruno
asked Feb 24, 2014
edited Apr 9, 2014

+1 vote
Look at the help here, your approach will be a variation on the section "Showing a Random Subset of Questions/Blocks"

https://www.sawtoothsoftware.com/help/issues/ssiweb/online_help/index.html?hid_web_randomq.htm

Suppose your multiple response question MyQuestion uses the list MyList, create a new constructed list with MyList as the parent list and  these constructed list commands:

AIC(MyQuestion)
Randomize()
ListMax(1)

In your randomized block settings, use the option that allows you to set the sequence based on the constructed list you created.
answered Feb 25, 2014 by Silver (7,820 points)
edited Feb 25, 2014
Use ListValue(MyList,1) in your skips.

eg. ListValue(MyList,1)=1
Thanks a lot Gary Baker, it works great :)

Just a small correction, I use AIC(Question) instead of AIC(MyList), and it's working great
Paul Moon, thanks a lot. But I think I dont need to do that using the randomized blocks, thanks anyway :)
Correct. The skips I mentioned refer to using a constructed list and no randomised blocks. Both methods work effectively.
Good catch, I've edited my original post to correctly use AIC(Question).