Advanced randomization using javascript | XM Community
Skip to main content

I have a total of 200 images. Each image has 20 descriptions. First, I want to randomize these 20 descriptions and split them into 4 groups (each containing 5) such that the groups are unique for every user. In each trial, I want the user to see an image followed by 5 of its descriptions as multiple choice. In total, there will be 800 trials (200 images * 4 description groups per image), i.e., each user will see each image 4 times with a different set of descriptions. All the 800 trials must be randomized (such that the same image does not appear in consecutive trials).
I am new to both Javascript and Qualtrics. I was trying to upload my data ( a JSON file containing image URLs and 20 descriptions for each image) into my survey using javascript and executing my randomization process. Still, I am not exactly sure how to continue with it. I also tried using loop and merge as shown in (https://community.qualtrics.com/XMcommunity/discussion/comment/11657#Comment_11657), but I don't know how to ensure each user would see all 20 descriptions and how I would randomize the 4 groups with other images in the dataset.
I am not sure how to proceed forward, and any help would be appreciated. Thank you for your time

You can create a question wherein you will add all 20 descriptions and in that same question add a randomization option and select present only 5 of the total. then follow same till you get 4 groups of 5 each; use this to use as a pipe-in per image. Now if you want to randomize image use survey flow randomizer and get the desired result.

Then you can either use loop and merge or can go directly depending on the length of the survey and time given to you to script everything.


Leave a Reply