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

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. 

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 = d];
    jQuery.each(qobj.getChoices(), function(index, value) {
        if(qobj.getChoiceDisplayed(value)) displayedChoices.push(value);
    });    
    if(displayedChoices.length == 1) {
        qobj.setChoiceValue(displayedChoiceso0], true);
        jQuery("#"+this.questionId).hide()  //to hide question
        qobj.clickNextButton();
    }
});


@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


Dear Nam, Faiz:

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


Dear Nam, Faiz:

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

@SCK02005 Glad to know that 👍


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


Leave a Reply