A mix of within-block and across-block randomization | XM Community
Skip to main content

Hi there, I am looking for insights on how to implement a rather complex randomization described in the following. I've done quite some search in both the support site and the community but ended up with no luck.
Here is the problem. Basically there exist two different pools, A and B, each of which contains several statements, let's say 5. I'd like to create a survey where participants can select how many statements they want to read from each pool. For instance, one wants to read 3 from A and 4 from B.
I know that I can achieve within-block randomization simply via question randomization, by showing randomly 3 statements from pool A and 4 statements from pool B. This can give me a random sequence of a1,a2,a3 and b1,b2,b3,b4.
I also know that I can randomize the order of blocks via a randomizer. This means a participant can read either a1,a2,a3,b1,b2,b3,b4 or b1,b2,b3,b4,a1,a2,a3.
Yet, I'd like to push the randomization to a further level. It would be great if the order of the seven statements are also randomized so that any arbitrary sequence can be allowed. For example, the sequence of the statements could be something like b1,a1,a2,b2,b3,a3,b4.
Any help will be appreciated! Thanks in advance!

Showing dynamic number of statements based on the respondent choice is itself not achievable using qualtrics any randomization, as no randomization allows pipe text in it, hence we can use JS for this. But, yes if you are ready to create 5 ramdomizer (that randomizer 1 will show only 1 statement, randomizer 2 will show 2 statement etc) for each pool then you don't need JS.
Then create 10 ED(QA1, QA2......,QB1, QB2........) one ED for each question and set its value to false.
Under each randomizer add 5 ED survey element with respective pool question embedded data and set its value to true. For eg Randomizer of pool A will have 5 ED element as QA1, QA2, QA3, QA4, QA5 and its value as true.
Based on the user input of number of statements to read, add branch logic and add repective randomizer under it. like if user selects 3 for pool A, then add pool A randomizer which has - show 3 elements option entered.
Now add all questions in single block, and create display logic on each question as if its respective ED is set to true. In this block do question randomization from block options.


Thanks a lot! rondev
I see this approach can help with the dynamic presentation. One follow up question though: in this approach, the selection of statements into each of the randomizers seems not random. I have to manually determine which 1/2/3/4 statements I'd like to put into the randomizer that shows 1/2/3/4 statements, no?
I also failed to see how does this help achieve a full randomization wrp the whole statement sequence? e.g. something like QA1, QB1, QA2, QB2, ...


" the selection of statements into each of the randomizers seems not random" - No, they are actually random. Because when we create ED all are set to false, but because of randomizer, randomly any 1/2/3/4/5 statements ED gets true.

"I also failed to see how does this help achieve a full randomization wrp the whole statement sequence? e.g. something like QA1, QB1, QA2, QB2, ..." - I didn't mention in my earlier post but in the last para, you can do question randomization at block option.


Thanks! rondev Super helpful!


Hi rondev ,
I am currently having a similar problem but am not sure about how to apply what you explain here to my own survey.
I would like to use randomization in my study, but am a bit stuck when it comes to the specifics:
I have 20 blocks that are split into 2 groups of 10. I would like participants to view 5 blocks from group 1 and 5 blocks from group 2 randomly. Participants would see 10 blocks in total. In other words, I would like the order of the blocks they see to be randomly chosen from each group and mixed together. So, they may see a block from group 1 and then group 2, for example, until they have seen 5 from each group.
The trouble I'm having is that I don't want the two groups grouped into a single group as I want to have the same amount of blocks shown from each group. Currently, participants will see 5 random blocks from group 1 and then 5 random blocks from group 2. Ideally, I would have the blocks they see be mixed up.
I would GREATLY appreciate any help! 🙂 (.. I am a bit frustrated at this point...)


Leave a Reply