Select a few from a list of multiple choices and follow up with each choice separately | XM Community
Skip to main content
Solved

Select a few from a list of multiple choices and follow up with each choice separately

  • October 10, 2024
  • 5 replies
  • 48 views

Forum|alt.badge.img+1

Hi All,

The faculty members have taught in up-to 13 (one, two, three etc.) classrooms last 3 years. I want them to rank up-to three of these classrooms. I have written three separate statements with display logic that works. But I want to change it to one question where they can select all three classrooms from a list. Then, the follow-up three questions pick up each of these classrooms one by one and ask a series of statements. Is there a way to do this with JavaSript? I hope I have clearly stated my question to you all. Thank you for the help. 

Best answer by Nam Nguyen

@SCK02005 I think you will find the solution with this Loop & Merge base on a question Loop & Merge (qualtrics.com)

So you can ask which classes did they taught in the 1st question, and in the next block you can set-up to loop the questions through each class.

You want them to rank up-to 3 class so set validation in the 1st question of answer range 1-3

Hope I can help. Let me know if you need more info

View original

5 replies

Forum|alt.badge.img+3
  • Level 1 ●
  • 14 replies
  • October 11, 2024

Hi,

 

You can show the ranking question up front(e.g QXYZ) and apply min and max as 3. Duplicate that question, convert it to single select, name it as hRank1..and put display logic on each of the options e.g display code 1 if code 1 at QXYZ= rank1, then code 2=rank1 and so on. Then paste below JS in js block.. It will auto punch the option, hide and click next.

 

You can then apply logic based on that hidden question, similarly do for other 2 ranks.

If you don't have JS, you can simply apply auto next via timing and use display e.g Show if code 1 displayed at hRank1

    Qualtrics.SurveyEngine.addOnReady(function() {
    var qobj = this;
    var displayedChoices = [];
    jQuery.each(qobj.getChoices(), function(index, value) {
        if(qobj.getChoiceDisplayed(value)) displayedChoices.push(value);
    });    
    if(displayedChoices.length == 1) {
        qobj.setChoiceValue(displayedChoices[0], true);
        jQuery("#"+this.questionId).hide()  //to hide question
        qobj.clickNextButton();
    }
});


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1091 replies
  • Answer
  • October 11, 2024

@SCK02005 I think you will find the solution with this Loop & Merge base on a question Loop & Merge (qualtrics.com)

So you can ask which classes did they taught in the 1st question, and in the next block you can set-up to loop the questions through each class.

You want them to rank up-to 3 class so set validation in the 1st question of answer range 1-3

Hope I can help. Let me know if you need more info


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 10 replies
  • October 11, 2024

Dear Nam, Faiz:

Good news! Both solutions work. Got it done. Thanks for all the help.


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1091 replies
  • October 11, 2024
SCK02005 wrote:

Dear Nam, Faiz:

Good news! Both solutions work. Got it done. Thanks for all the help.

@SCK02005 Glad to know that 👍


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 10 replies
  • October 14, 2024

@Nam Nguyen has the quickest answer @faaiz.rahman if you know JS and need a bit of work.


Leave a Reply