Randomly selecting images from two lists in a loop | XM Community
Skip to main content

Hello,

I have a survey that involves showing respondents an image and asking them several questions about the image. This is repeated 6 times, each time with a different image. The images need to be randomly selected from one of two lists. Each respondent needs to see exactly three images from list A and three images from list B. There are 50 images in list A and 50 images in list B. Is there any way to do this such that the respondent sees these 6 images in a random order? I don't want respondents to see all the list A images before the list B images or vice versa. They should be mixed together. I tried to set up a loop and merge with random selection but there seemed to be no way of ensuring even representation of list A and list B images.
Thank you

ashb - You can do the following:

  1. Create a Multiple Choice Question for 50 images for list A. Randomize to only display 6 images.

  2. Create another Multiple Choice Question for 50 images for list B. Randomize to only display 6 images. Also, carry forward displayed choices from List A Multiple Choice Question. These forwarded choices should not be included in the randomization.

  3. Carry forward displayed choices from the previous question and randomize the order. You will now have 12 images and fully randomized. Loop and merge on these displayed choices.

  4. Since you would not want to display these questions to the respondent, use the following javascript in the above 3 questions:

jQuery("#NextButton").click();


Thank you! Quite a crazy process required for something seemingly quite simple. I've followed your advice and I think it is working except that the three hidden questions seem to flash on the screen briefly before being hidden when I run the preview. I checked the "look and feel" section and the page transitions are set to "none." I tried adding the code you provided to run "on load" and "on ready" (and on both) and I can't get the flashing to stop. I also tried using the following (which I found others proposing on the web)
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery('#Wrapper').css('visibility','hidden');
jQuery('#Wrapper').css('opacity','0');
jQuery("#NextButton").click();
}); 

It doesn't seem to work either. Any advice about how to avoid the flashing?
Thank you


ashb - Not sure if that can be avoided completely. However, the above Jquery works much better as the flash is only for a flick of a second.


Leave a Reply