Random image pairs for large number of images | XM Community
Skip to main content

Hi all,
I'm trying to present a large number of images side by side; a participant would choose one of the images and move to the next pair.
As far as I can see I have to manually make every question with every pair of images, but since there are many images I am looking for a way to have Qualtrics randomly pair two images.
The idea is to upload an even number of images to the graphics library, e.g. 100, and then present 50 questions, each containing 1 random pair of images. Does anyone know if it is possible to randomly choose two images without replacement from the graphics library? Any help would be much appreciated

  1. Use a webservice or JavaScript to randomize the 100 images into 100 embedded data fields image1 through image100 where the values are the image urls.

  2. Pipe the embedded fields into a loop & merge block where each loop & merge row has two fields: ${e://Field/image1} and ${e://Field/image2}, ${e://Field/image3} and ${e://Field/image4}, etc.

  3. Pipe the loop & merge fields into your question as ${lm://Field/1} and ${lm://Field/2}

You'll need to decode the answers to analyze the results across respondents. You might consider using a webservice or JavaScript after the loop & merge block to do this so the data you'll need is already in the response data.


Hi Tom,
Thank you for the quick reply, option 1 seems reasonable, the survey in qualtrics would then be able to work with the URL's of the images even if they are not in the graphics library from qualtrics?
For option 2 I've noticed that the graphics library gives random name starting with 'IM_' to files, is it still possible to refer to images with a simple file name, like you suggest as 'image1' or would I have to get the exact URL for the image inside the qualtric graphic library?

PS: example file name URL difference:
the file name: 5contrast.jpg
the URL: https://qfreeaccountssjc1.az1.qualtrics.com/ControlPanel/Graphic.php?IM=IM_55vGi9X0i34vLEx


https://www.qualtrics.com/community/discussion/comment/31007#Comment_31007The numbered items aren't options, they are steps. The urls are as you noted, and you have to get the exact url that includes the randomly assigned image id in order to use it. If you've put all the images in a folder there is a short cut to get the list of image ids: go to Account Settings -> Qualtrics IDs -> Library (e.g., My Library) and copy the list of the image names with associated image ids for the folder.


Hi Tom,
Custom JavaScript is disabled for the free account, and embedding an image by placing something like this in the question box does not seem to work:

 

where the "lm://Field/1" field is the exact URL of the picture to the graphics library.
the URL is updates corrected on the basis of the "loop and merge" table, and the image also show if I manually place hte URL inside the html snippet, but the variable doesnt render properly when trying to place the loop n merge value there
src="${lm://Field/1}" 
results in a number '1' being displayed
src="${lm://Field/someword1}" 
results in a number 'someword1' being displayed
Is there something that I am missing?

PS: The acount settings -> qualtrics ID's is very helpful thank you
(PPS: for those trying to enter URL's from the graphic library straight into the survey the URL from the control panel is slightly different then the one used in the survey, control panel is replaced by CP, e.g.
https://qfreeaccountssjc1.az1.qualtrics.com/ControlPanel/Graphic.php?IM=IM_55vGi9X0i34vLEx
https://qfreeaccountssjc1.az1.qualtrics.com/CP/Graphic.php?IM=IM_eYjGkqqI3jGfUr3


https://www.qualtrics.com/community/discussion/comment/31016#Comment_31016I think you've misunderstood how loop & merge works. Your pipe:

is correct if the first field in the loop & merge setup is an image url.
If you can't use JavaScript to do the randomization, perhaps you can write and use your own webservice (I don't know what he limitations on free accounts are - I've never used one).


afbeelding.pngHi Tom,
Thanks again for the quick reply, loop and merge has a correct URL but doesn't want to render in the html snippet, it seems possibly due to the fact that there are special characters inside the lm field, such as the slashes, if you look at the printscreen this is the exact URL of the image in the graphics library


https://www.qualtrics.com/community/discussion/comment/31039#Comment_31039It works fine for me. I'm guessing maybe you are trying to do a block preview, which doesn't replace loop & merge fields. Use Survey Preview to check.


Hm, it renders the lm field fine, but it can't get the image right:
This is the output of the rich text editor, followed by output from survey preview:
afbeelding.png

${lm://Field/1}

as you can see in the image above, the lm field only shows "1}"


https://www.qualtrics.com/community/discussion/comment/31042#Comment_31042Your html must be messed up. Probably from editing in rich text editor. Edit in HTML view.


Fair enough. I am putting this down to the free account, custom javascript and html are not explicit options, the only html editing option is by going to the richt text editor and looking at the source here.
For the moment I will simple create pairs of images in an external application and make questions with a single image, which seems more straightforward and easily randomizable, thank you for all the help Tom,
Roelof


Leave a Reply