Adding "Not Applicable" option to ranking question (drag and drop) | XM Community
Skip to main content

Hi Qualtrics Community,
Could anyone kindly explain how to add a "Not Applicable" option to the ranking question (drag and drop format)?
Thank you!

Hi there, if you still need, this can be put in place by adding another survey question to act as the Not Applicable and using In-Page display logic to show the ranking question or not based on that answer, like mentioned here. Alternatively, you can add a checkbox and use JavaScript to limit the respondent's ability to interact with the question if it is selected and capture the selection in an Embedded Data field.
To put that in place, first create an Embedded Data field called "NotApplicable" and put it at the top of the Survey Flow.
Next, create a ranking question and update the Question Text using the Rich Content Editor's HTML/Source view "<>" with the below:
Click to write question text.





Then update the question's JavaScript with the below:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});


Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/

var qid = this.questionId;
var na = document.getElementById('NA');

jQuery(na).css({
    "position": "relative",
    "opacity": "1",
    "z-index": "999",
    "height": "20px",
    "width": "20px",
});

jQuery(na).click(function () {

if( jQuery(na).is(":checked") )
    {
      jQuery("#"+qid+" .QuestionBody").css("pointer-events","none");
    }
 else
    {
      jQuery("#"+qid+" .QuestionBody").css("pointer-events","auto");
    }
});

});


Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});


Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

var na = document.getElementById('NA');

if( jQuery(na).is(":checked") )
    {
      Qualtrics.SurveyEngine.setEmbeddedData("NotApplicable", "yes");
    }

});


Leave a Reply