randomized and fixed blocks | XM Community
Skip to main content
We have a set of 16 blocks we would like to randomize. Three of the blocks MUST be presented, and of the 13 remaining blocks, we only want to show 8 of them picked at random. The 11 (3 required blocks and the randomly picked 😎 should all be in random order. Is there a way to randomize presentation of all 11 of the blocks we want to present?
This would be easiest done using branches, embedded data, and 2 randomizers.



In the first randomizer, put different embedded data elements, and set each variable to 1. Display 8 of these at random.



In the second randomizer, put a branch per block with the block inside. Show each if the corresponding embedded data is 1. The 3 always shown should always be equal to 1.
Thanks @AnthonyR ! With your help, I was able to do the following:



I used one randomizer to set embedded data for 13 blocks:

Randomly present 8 of the following elements:

- Set Embedded Data B1 is 1

- Set Embedded Data B2 is 1

- Set Embedded Data B3 is 1

- etc.



I then used a second randomizer to present all blocks in random order: Randomly present 16 of the following elements:

-Required Block

- Required Block 2

- Required Block 3

- Then Branch if B1 is 1, then show block 1

- Then Branch if B2 is 1, then show block 2

- Then Branch if B3 is 1, then show block 3

- etc. for every single block



For the second randomizer, you present all 16 blocks because the branching takes care of the display logic for each of the blocks that were not chosen.
@AnthonyR and @lillianc



Would it be possible to attach an image of how this looks in the Survey Flow? I consider myself fairly knowledgeable in Qualtrics, but I am not sure what is meant by "set embedded data FOR a block."
@Akdashboard Absolutely! I'll work up an example qsf for you on this soon!
The entire survey flow doesn't fit on a screenshot so I've attached my QSF here.



Here are some screenshots:

Choosing 8 of the 13 blocks:

!



Randomly present 16 of both fixed and chosen random blocks:

!
@Akdashboard sorry I wasn't clear when I wrote "Set embedded data for blocks" - I am creating embedded data variables that can be used to reference which block to present later on. Variable B1 for example, will control whether I present Block 1. Variable B2 will control whether I present Block 2.
Thanks @lillianc. This makes perfect sense to me now.



Basically, because of the first Randomizer, only 8 of the 13 Ed fields will ever be populated, so when the 2nd Randomizer triggers, only the 8 that were filled will show up, mixed into a random order with the 3 that will always show up.



And you wouldn't need the 2nd Randomizer if you didn't need the blocks to appear in a random order.
@Akdashboard exactly! And thanks again to @AnthonyR for the solution, I really appreciate it!
@lillianc - Thanks for asking this! Very relevant to a project I'm working on and was trying to find a work around for!
@Libertywick I'm glad you found this useful! I ended up not being able to use the code in practice, however, since we had an additional requirement that the participants had to be able to move forward and backward through the whole survey, and the branches in the survey prevented this. For future surveys where moving forward and backward is not required, it's perfect!
One more note on this. On the first randomizer you would typically want to check 'Evenly Present Elements' so that you end up with a nearly equal number of respondents seeing each of the random blocks.
@TomG thanks, good point! Yes, in a research setting that would be very beneficial. Our use case was atypical, since we were using this for a quiz where we wanted everyone to have a truly random set and prevent cheating, so we preferred to not evenly present the elements.

Leave a Reply