Displaying images for specific time limit during MCQ question types. | XM Community
Skip to main content

Hi there,
I am not sure if what I am asking is possible, but wanted to ask the community.
I am putting together Multiple Choice Questions (MCQs) as trials that have two key parts:

  1. An image (this will be in the Question test)

  2. MCQ of two answers (same/different)

However, for this trial, I am looking to have the image only displayed for a specific length of time (e.g., 5 seconds), but participants can take as long as they like to answer the question itself.
So, for instance, if a participant was to go onto the trial, the image is displayed for 5 seconds only, but participants do not have a time limit to actually answer the question. Therefore, a participant is able to respond to the MCQ during the 5 seconds the image is displayed, and after the image has disappeared.
Is this something that is possible in Qualtrics using custom code?
I know there is auto-advance with a timing question, but this would mean that the image display and MCQ would need to be two separate questions, rather than one. Participants would not be able to respond as soon as they see the image, but will have to wait until after the image has been displayed.
Thank you in advance.

Yes, it is possible:
HTML in question text:

JS:
Qualtrics.SurveyEngine.addOnReady(function() {
var qobj = this;
setTimeout(function() { jQuery("#"+qobj.questionId+" .hideAfter5").hide(); },5000);
});


TomG As always, you are a lifesaver! Thank you so much for your help!


Sorry TomG, I just have one more question re this (I am not 100% used to using HTML). Below is a snippet of the HTML with the actual URL removed. However, it does not go after 5 seconds.



I should note that the image is accompanied by text both before and after the image. Would this also have an impact on this working?


Hi TomG ,
Update: I have been implementing this, but changed it to JS rather than HTML. It works perfectly for the first trial. However, when I copy and paste the same JS code to each other question that needs it, it no longer works, and the image is displayed until a response is selected. Is it fixed for that first question only, or should it be running for each?
Thank you.


https://community.qualtrics.com/XMcommunity/discussion/comment/55046#Comment_55046You need both the html and the JS in each question - they go together.
You have errors in your html (and a lot of extraneous and redundant stuff you don't need). Setting the image width/height isn't required. It is easier and causes fewer headaches to just to set the max-width to 100% and let the browser handle it from there. Cleaned up version:



Thank you for your response TomG !
I understand now, and it works! Thank you so much. Thank you for the advice re the image sizes. However, as this is for research, we have the images set to a specific size so that all participants see the same size image when on a computer, regardless of screen size, to avoid giving any participant the potential advantage over another by simply having a larger screen.


https://community.qualtrics.com/XMcommunity/discussion/comment/55055#Comment_55055In that case, just set the width.


Hello, I am facing the same scenario described in the question here. My survey question has an image and I would like to mask it or change the image after 200ms. After the mask is applied, I would like to display a multiple choice question corresponding to the image that the user saw. Currently I added a “Auto advance” question in-between my image and the question, but there is a little snag or delay in moving from the image to question screen (a page loading/processing symbol appears on the blurred image, causing the image to be visible to the user for more than 200 ms). 

 

The images linked in the previous answers for the html code are not opening up and the links to answers are not relevant anymore I guess. Could you please help to resolve this scenario.


Leave a Reply