How to display multiple choice answers above question | XM Community
Skip to main content
Solved

How to display multiple choice answers above question

  • September 12, 2023
  • 4 replies
  • 89 views

Forum|alt.badge.img+1

My research team is trying to put together a survey where participants see a picture in the center of the screen and the 4 multiple choice options are displayed around it: 2 options above the picture in 2 columns and 2 options below the picture in 2 columns. Is it possible to write a javascript that will do this?

Best answer by TomG

Set your MC question format to List->Alignment:Column->Number of columns:2. Add this JS to the question and insert the actual image id where the xxxx is:

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" tr:first").after(
"<tr><td colspan='4' style='text-align:center;'><img src='/ControlPanel/Graphic.php?IM=xxxx'></td></tr>");
});

 

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • September 12, 2023

Yes, you can write JavaScript to do this.


Forum|alt.badge.img+1
  • Author
  • 2 replies
  • September 12, 2023

That’s great news! Would you be able to help me get started in writing that script? I’ve been searching through various questions in this community but couldn’t find any scripts that repositioned the answers from Qualtrics standards.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • Answer
  • September 13, 2023

Set your MC question format to List->Alignment:Column->Number of columns:2. Add this JS to the question and insert the actual image id where the xxxx is:

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" tr:first").after(
"<tr><td colspan='4' style='text-align:center;'><img src='/ControlPanel/Graphic.php?IM=xxxx'></td></tr>");
});

 


Forum|alt.badge.img+1
  • Author
  • 2 replies
  • September 13, 2023

Thank you!!