Have an idea?

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

Random block by select question

Dear All,

Q1 single select question. There are 6 answers as below:

1. Promo1-Promo2-Promo3
2. Promo1-Promo3-Promo2
3. Promo2-Promo1-Promo3
4. Promo2-Promo3-Promo1
5. Promo3-Promo1-Promo2
6. Promo3-Promo2-Promo1

Another question I have set in 3 blocks.

Block 1: From Q2x1 to Q8x1
Block 2: From Q2x2 to Q8x2
Block 3: From Q2x3 to Q8x3

I want to randomize these block depend on Q1. For example

If Q1=1 we will ask Block 1 => Block 2 => Block 3.
If Q1=2 we will ask Block 1 => Block 3 => Block 2.
If Q1=3 we will ask Block 2 => Block 1 => Block 3.
........

How can i do that?
asked Apr 5, 2018 by Saroeun Bronze (1,630 points)

1 Answer

0 votes
Setup / define your 3 blocks by clicking on the "Randomize" button and then select "Blocks" followed by "Add Set".

Select the Anchor Question 1 and 2 for each block as follows ...

Block 1: From Q2x1 to Q8x1
Block 2: From Q2x2 to Q8x2
Block 3: From Q2x3 to Q8x3

Create a parent list and call it BlockList and define it as such ...

1 Block 1
2 Block 2
3 Block 3

Now create a constructed list which uses the parent list BlockList and call it BlockConList ...
Begin Unverified Perl 
  
 if (VALUE("Q1")==1)
  {  
   ADD("BlockList",1,3);
  }

 elsif (VALUE("Q1")==2)
  {  
   ADD("BlockList",1);
   ADD("BlockList",3);
   ADD("BlockList",2);
  }

 elsif (VALUE("Q1")==3)
  {  
   ADD("BlockList",2);
   ADD("BlockList",1);
   ADD("BlockList",3);
  }

 elsif (VALUE("Q1")==4)
  {  
   ADD("BlockList",2);
   ADD("BlockList",3);
   ADD("BlockList",1);
  }

 elsif (VALUE("Q1")==5)
  {  
   ADD("BlockList",3);
   ADD("BlockList",1);
   ADD("BlockList",2);
  }

 else
  {  
   ADD("BlockList",3);
   ADD("BlockList",2);
   ADD("BlockList",1);
  }
 
End Unverified

When you are defining your blocks, select the "Use Constructed List" option and select "BlockConList".

You can also export "BlockConList" in your data to display and analyse the order the question blocks were displayed in.
answered Apr 5, 2018 by Paul Moon Platinum (72,880 points)
edited Apr 5, 2018 by Paul Moon
...