How to randomly assign a text to an image? | XM Community
Question

How to randomly assign a text to an image?

  • 1 December 2020
  • 1 reply
  • 27 views

Hello everyone! 
I have a problem and I would be really appreciate if someone could help me!
I have 24 stories (texts) and 24 images. I want to present a story and an image at the same time to the participants each trial:
1)    Each story is paired with an image randomly. 
2)   Each stimulus (both story and image) appears only once.
How can I achieve that?
I tried to use loop & merge: put all the images in field 1 and put all the stories in field 2. But the image is paired with story in the fixed pattern in this way, that is, story X always paired with image Y ...  What I want is each story paired with image randomly. For example, participant A may see story 1 paired with image 3, participant B may see story 1 paired with image 8, participant C may see story 1 paired with image 20, etc. I have no idea what to do.
截屏2020-12-01 下午7.40.19.png
Thanks in advance! 


1 reply

Userlevel 7
Badge +22

One of the solution can be:
Create 24 embedded data and assign them the radom img tag as value using javascript. Now in field 1 of loop and merge pipe those 24 embedded data and keep story in field 2.

Leave a Reply