Have an idea?

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

Randomizing part of a block of questions

If I have a block of questions Q1, Q2, Q3, Q4, is there a way to show the questions in one of  two orders: Q1-Q2-Q3-Q4 OR Q1-Q3-Q2-Q4?
asked Jan 12 by anonymous

2 Answers

+2 votes
You can use randomised blocks here.

Create a parent list as follows ...

Call it OrderList.

Item 1-Q1
Item 2-Q2
Item 3-Q3
Item 4-Q4

Now create a constructed list which uses OrderList as the parent list ...

Call the constructed list OrderConList.
Begin Unverified Perl 
  
 if (SYSRAND(1,2)==1)
  {  
   ADD("OrderList",1,4);
  }
 else
  {  
   ADD("OrderList",1);
   ADD("OrderList",3);
   ADD("OrderList",2);
   ADD("OrderList",4);
  }

End Unverified

The constructed list will select either 1-2-3-4 or 1-3-2-4 based on a random number generated between 1+2. If you want another condition applied, you can modify the Perl script "if statement". Let me know if you need help there?

Now click on the Randomized button and select Blocks. Select Add Set and then Add Block. Define 4 blocks with start and end anchors as follows ...

Q1-Q1
Q2-Q2
Q3-Q3
Q4-Q4

Select the Use Constructed List radio button and choose OrderConList.

Setup Q1-Q4 and take it for a test drive.
answered Jan 13 by Paul Moon Platinum (74,830 points)
edited Jan 13 by Paul Moon
+1 vote
Using randomized blocks with a constructed list would be the way to do this. Use constructed list logic to create the question patterns that you need:

https://www.sawtoothsoftware.com/help/lighthouse-studio/manual/hid_web_randomq.html

You would need to use perl inside the constructed list in order to use  if/else statements to choose different patterns in the constructed list.

That said, do you want to have control over which pattern gets shown? Or do you just want it to randomly choose the pattern?

If random, I'm seeing that all you're really doing here is randomizing the order of Q2 and Q3. In that case, you wouldn't need Randomized Blocks. Just use Randomize Questions (or if on different pages, Randomize Pages) and choose Q2 and Q3 as anchors. They question order will show up randomly either Q1-Q2-Q3-Q4 or Q1-Q3-Q2-Q4.

If you need control over the order over Q2/Q3 (not random), and you can't figure it out yourself using randomized blocks with a constructed list, just post back and where you are getting stuck.
answered Jan 12 by Gary Baker Silver Sawtooth Software, Inc. (7,805 points)
Apologies Gary for chipping in along side you. I was part way through this, popped out for a tick and came home to finish it off.

I think we're both on the same wave length.

Like your idea with the randomised pages too. Nice solution.
Yes, see Paul's answer for how to control any order. Thanks for working this out, Paul!
...