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

How to use javascript to check whether the two random selections are equal in qualtrics

  • May 6, 2022
  • 4 replies
  • 50 views

Forum|alt.badge.img+2

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

Best answer by TomG

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

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6082 replies
  • May 6, 2022

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


Forum|alt.badge.img+2
  • Author
  • 2 replies
  • May 6, 2022

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.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6082 replies
  • Answer
  • May 6, 2022

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


Forum|alt.badge.img+2
  • Author
  • 2 replies
  • May 6, 2022

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