How to randomize blocks and match that order at a later point? | XM Community
Skip to main content

Hello!
I am wondering is it possible to randomize blocks (6 different case stories) per participant in the first task, and then have that random order repeated at a later point of the survey?
In the second task, the participants would answer a few questions related to the cases from the first task, and it would make sense to have the same order in which it was presented to them in the first task. However, I do not know how to arrange that after having those blocks randomized in the first task.
I appreciate your help!
Thank you for your input.

Hi kknezev Unfortunately it's not possible to predict how the randomizer might push each block because of which it won't be possible to show the blocks in the exact order as they appeared randomly from the first one


Aanurag_QC Thank you for your answer; too bad it cannot be programmed.


I also have this question, and I really think that someone thinking creatively could do this. We have two time points - the first we need to capture block order, and the second we need to use a captured order to display questions.
I think the first step would be to set up an embedded field that captures the displayed blocks in order. Maybe by initializing it and then each block having code that adds on the next elements to a list.
Edit: Seems to be what is discussed here: https://community.qualtrics.com/XMcommunity/discussion/comment/19934#Comment_19934
Then you would have code in the second step that splits apart the list and assigns each element to a variable in order - first element = disp1, second element=disp2. Then the second part of the survey displays "disp1" and "disp2" in the question spot.
That feels like the right process - now I think I need to find someone who knows java and qualtrics to implement.


Okay, I figured out how to do this. My method is a bit messy - maybe someone who is a bit better at these things might be able to make it prettier. There are 3 steps...

  1. Add embedded fields to your flow so that you are capturing the displayed order of the elements. This is basically what was described here; https://community.qualtrics.com/XMcommunity/discussion/comment/19934#Comment_19934

My implementation looks like this (screenshot 1):
image.png2. Add javascript to your question block to capture the SurveyPath information and separate it into a list of new embedded variables (Disp1, Disp2) you will be able to put into use. One issue is that I needed to put a "buffer question" in to hold this code. This is a question that added between the Block Option 1, etc. and the later question (for part 3) where I will use the new embedded variables. Here is the code I used (screenshot 2) Note that I am not familiar with Java so this might be improved by someone - I have a lot of calls to the console so I can check my work.
Qualtrics.SurveyEngine.addOnload(function()
{
      var path = "${e://Field/SurveyPath}";
   console.log(path);
   myArray = path.split(",");
   var disp1=myArrayr1];
   var disp2=myArray2];
   console.log(disp1);
   console.log(disp2);
   Qualtrics.SurveyEngine.setEmbeddedData('Disp1', disp1);
      Qualtrics.SurveyEngine.setEmbeddedData('Disp2', disp2);
});

3. Then you need to actually use the new embedded variables in a question text. Here was my mock question (screenshot 3).
image.pngHope this helps you and the next person looking to figure this out!


Thank you Danielle2021, glad you found out a solution for your design!
I unfortunately cannot figure it out how to use it for my intention (for the whole blocks to appear in the previous order which was created randomly).
I did find something very similar here (although I am still trying to make it work for myself): https://community.qualtrics.com/XMcommunity/discussion/17124


Oh, that should be fine as well. Do something like this for step 3 (you will still need the buffer question, I think). The idea is that you need to create a group with subbranches (you will need 6 subbranches because you have 6 blocks that might come first). The duplicate that group 5 more times, substituting Disp2 for Disp1, etc. etc. This follows their method, although I think my example is easier to follow....

image.png


Leave a Reply