How to use javascript to check whether the two random selections are equal in qualtrics | XM Community
Skip to main content

Hi all,
I’m setting up an online experiment and using embedded data as a randomizer. What I’m trying to do is that I have a list of 8 portrait pictures and I want my participant to randomly view two pictures and then pick one they want to interact with later.
So now I have entered these pictures as 2 lists of embedded data, and every entry will randomly draw a picture from each list. However, since the pictures are the same, there is going to be a case where participants view two identical portrait pictures (see attached). 
Does anyone have any suggestions on how to avoid this? If so, could you please advise me on how to achieve it?

Screenshot 2022-05-06 at 10.13.21.png

Don't use embedded data. Add all eight choices (portraits) to your question and used Advanced Randomization to display two, evenly distributed.


Hi, TomG
Thank you very much for your timely comment! I have tried this advanced randomisation.
Because I want my participant to continually interact with the picture they chose in the beginning. So, for the randomizer, I need to create a set of additional follow-up questions for each picture, which might seem a little repetitive.
The reason I want to use embedded data is that it could make sure that participant is always working with the person they chose at the beginning. But I'm not very sure, whether randomizer could offer such feature.


You would just need to pipe the selected answer for the question in the follow-up questions.


Wow! It worked! You are a genius!! Thank you very much!!👍


Leave a Reply