Carry over responses from one loop and merge block to another | XM Community
Skip to main content

I am setting up a study in which participants first go through 40 items that are presented one by one, preferably in a random order, and choose for each item whether they want to study it or be tested on it in a later phase. I've implemented this using a loop and merge block. 

 

Then I want participants to go through the same 40 items again one by one,  preferably in a random order, and either see the item again for study or get tested on the item (i.e., text entry question) - based on their earlier choice for that item. I've tried to implement this phase using a different loop and merge block but I cannot see a way to use display logic (in order to determine whether the item would be studied or get tested) based on participants' choice in the earlier loop and merge block. 

 

I also tried to implement both phases in one loop and merge block, but I cannot see a way to make it loop through some questions first for all the items and then to loop through other questions for all the items.

 

Any way to make it work?

What you are trying to achieve is a little unclear from your question. Could you share some screenshots for clarity.

Thanks.


Sure. In the first block, the loop and merge table has 40 word pairs (field/1 and field/2 for the first and second word) Participants see the pairs in a random order and choose between option A and option B for each pair.

 

On a second phase,  participants again go through the same 40 word pairs in a random order. If they  previously choose option A for a pair, they will now get this:

 and if they the previously choose option B, they will now get this: 

Any idea how to do it?


The non-JS option is to create 80 (40x2) questions, and add display logic to each of them to show based on the answer in the LM block. You could keep each set in one block, i.e. have 40 blocks, then put those 40 blocks in a randomizer to display them in a random order.

 

 


@Vered,

For the second loop, use the same fields as the first loop and add a third field which is the piped recode value of the question in the first loop.

Add a text/graphic question to the beginning of the second loop with JavaScript that copies the value of Field3 to an embedded data field and clicks Next.  Add display logic based on the embedded field (recode) to the other questions in the second loop.

Example JS:

Qualtrics.SurveyEngine.addOnReady(function() {
Qualtrics.SurveyEngine.setEmbeddedData("recode","${lm://Field/3}");
this.clickNextButton();
});

 


Thank you both for these suggestions. I understand the non-JS option, but I am want to try the JS option first. 

I managed to add a third field for the second loop with the piped recode value of the question in the first loop. I added a text/graphic question to the beginning of the second loop and pasted the JS code you provided where it says “ /*Place your JavaScript here to run when the page is fully displayed*/”. But when I try to add a display logic to the following questions based on embedded data, “recode” doesn’t appear as one of the field names. What did I miss?

 


It doesn’t show in the list because it isn’t defined in the survey flow. You can add it to the survey flow or just type it in the display logic condition.  It doesn’t have to be in the survey flow to work.


Thank you! It worked! Your help is much appreciated!


Leave a Reply