How to make randomized blocks more likely to appear than others? | XM Community
Skip to main content
Question

How to make randomized blocks more likely to appear than others?

  • May 8, 2023
  • 3 replies
  • 72 views

Forum|alt.badge.img+2

We have a section in a survey where there are 8 question blocks and only 3 of the blocks will randomly appear when you take the survey. We set up a randomizer to randomly select the 3 blocks that a user sees. We would like certain blocks to have a higher likelihood of appearing than others. Is there a way to do this? If a CSS or JavaScript option is the only way, please be specific on where the code should go. 

3 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • May 9, 2023

Assuming you are using Randomizer element of survey flow. You can have a ratio between the blocks and have that block that many times under the randomizer. For example: if there are three blocks and you want to show it in ratio 1:2:1, then under randomizer have one block for block 1 and block 3 but 2 blocks for block 2.


Forum|alt.badge.img+2
  • Author
  • Level 2 ●●
  • May 9, 2023

Thank you! In your example let’s imagine that the user is answering 2 out of the 3 blocks. How would you prevent them from getting asked block 2 twice by mistake since it is in the randomizer twice? 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • May 9, 2023

Thank you! In your example let’s imagine that the user is answering 2 out of the 3 blocks. How would you prevent them from getting asked block 2 twice by mistake since it is in the randomizer twice? 

Put your blocks under branches, and set flags when blocks are displayed. For example:

Branch: If Embedded Data blockA Is Not Equal to 1

       Block: A

       Set Embedded Data: blockA = 1