Creating a multiple choice question with an "ALL of the above" action | XM Community
Skip to main content
Solved

Creating a multiple choice question with an "ALL of the above" action

  • March 14, 2018
  • 9 replies
  • 572 views

Is there a way to create a multiple choice question with an "All of the above" action? For example, i want to have a survey with blocks of questions about A, B, and C. Respondents can choose what to answer about. But I'd like the first question to give them to option to respond about all three, so that I could have them choose ALL and be sent to the block of questions about A, B, and C. Thank you!

Best answer by Michael_Campbell_RedPepper

Okay, I know this isn't the best practice, but here is something I came up with really quickly. I'm not sure how technical you are, but I'm assuming you know Javascript? If not, I would love to walk you through this! ```javascript Qualtrics.SurveyEngine.addOnReady(function() { /* This is the ID of the Wrapper of the Button for 'Select All' */ const SELECT_ALL_ID = '#QID1 > div.Inner.BorderColor.MAVR > div > fieldset > div > ul > li:nth-child(4) > span'; // grab a reference to the object const SELECT_ALL_CHOICE = jQuery(SELECT_ALL_ID); // and add a clicked listener, where it will go and click the other questions. // a better practice would loop through all your questions dynamically, rather than have them hard coded. SELECT_ALL_CHOICE.click(() => { console.log('Clicked!'); jQuery('#QID1-1-label').click(); jQuery('#QID1-2-label').click(); jQuery('#QID1-3-label').click(); }); }); ```

9 replies

Michael_Campbell_RedPepper
QPN Level 3 ●●●
Forum|alt.badge.img+3
Yeah! In the Survey Flow, you can set up logic so that when a specific question has a specific answer, that block will be shown - It's a pretty slick feature. !

Michael_Campbell_RedPepper
QPN Level 3 ●●●
Forum|alt.badge.img+3
You do this for every question that you have a corresponding block for, and if they selected the choice, then you can show them the block! In my example, it was a single choice, but it works for both.

  • Author
  • 3 replies
  • March 14, 2018
Is there a way not have to have to select A, B, and C, but just All of the Above? My list is actually 12 items long...

Michael_Campbell_RedPepper
QPN Level 3 ●●●
Forum|alt.badge.img+3
I think so - Let me check really quickly...

  • Author
  • 3 replies
  • March 14, 2018
Thank you!

Michael_Campbell_RedPepper
QPN Level 3 ●●●
Forum|alt.badge.img+3
Okay, I know this isn't the best practice, but here is something I came up with really quickly. I'm not sure how technical you are, but I'm assuming you know Javascript? If not, I would love to walk you through this! ```javascript Qualtrics.SurveyEngine.addOnReady(function() { /* This is the ID of the Wrapper of the Button for 'Select All' */ const SELECT_ALL_ID = '#QID1 > div.Inner.BorderColor.MAVR > div > fieldset > div > ul > li:nth-child(4) > span'; // grab a reference to the object const SELECT_ALL_CHOICE = jQuery(SELECT_ALL_ID); // and add a clicked listener, where it will go and click the other questions. // a better practice would loop through all your questions dynamically, rather than have them hard coded. SELECT_ALL_CHOICE.click(() => { console.log('Clicked!'); jQuery('#QID1-1-label').click(); jQuery('#QID1-2-label').click(); jQuery('#QID1-3-label').click(); }); }); ```

Michael_Campbell_RedPepper
QPN Level 3 ●●●
Forum|alt.badge.img+3
But this should get you started!

  • Author
  • 3 replies
  • March 14, 2018
I know a little bit about javascript and I think I understand what you are suggesting. Thank you for this. I will give it a try and see if this works.

Michael_Campbell_RedPepper
QPN Level 3 ●●●
Forum|alt.badge.img+3
For sure! And if you need any help along the way, please let me know and I can see about walking you through it.