Add exclusive response (don't know) option to Rank Order Matrix Question | Experience Community
Skip to main content
Solved

Add exclusive response (don't know) option to Rank Order Matrix Question

  • Mar 24, 2021 11:03 PM UTC
  • 3 replies
  • 509 views

Forum|alt.badge.img

Hello,
I am trying to add a don't know option to my rank order question. I'm aware that this may not be best practice, but our client is asking to include this option.
In this question, we have 4 items we're asking users to rank from 1 to 4. However, I'd like to include a don't know option to this question AND have that don't know be an exclusive option (e.g., if the user selects don't know, they won't have any other responses recorded). I've found the code to hide radio button and columns to try and call out the don't know as much as possible, but it is STILL possible for a user to rank these options AND select "don't know". See image below for an example.
I'm happy to adjust the question to any other rank type, but I need the don't know option to be exclusive.
Thanks,
Mark

image.png

Best answer by ahmedA

Custom Validation:
image.pngimage.png
Caveat, de-selecting radio buttons is not possible using the default functionality. So, if they select anything else and then decide to select E, then the survey will not move forward.

View original

3 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • Answer
  • Mar 24, 2021 11:36 PM UTC

Custom Validation:
image.pngimage.png
Caveat, de-selecting radio buttons is not possible using the default functionality. So, if they select anything else and then decide to select E, then the survey will not move forward.


Forum|alt.badge.img
  • Author
  • Mar 25, 2021 2:04 PM UTC

Thanks so much!


Forum|alt.badge.img+2
  • Dec 5, 2022 9:17 PM UTC

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

   var that = this;
   jQuery("input[type*=checkbox]").on("click",function()
   {
      var el = jQuery(this);
      setTimeout(function(){ enDB(); },50);
   })
   enDB();
   function enDB()
   {
      if( jQuery("input[type*=checkbox]:checked").length>0 )
      {
         jQuery("input[type*=radio]").each(function()
         {
            var rowID = jQuery(this).attr('id').split('~')[2];
            var scaleID = jQuery(this).attr('id').split('~')[3];
            that.setChoiceValue(rowID,scaleID,0)

         });
         jQuery("input[type*=radio]").parent().attr("disabled","disabled").css({"pointer-events":"none","background-color":""});
         jQuery("input[type*=radio]").attr("disabled","disabled").css("pointer-events","none");
      }
      else
      {
         jQuery("input[type*=radio]").removeAttr("disabled").css("pointer-events","");
         jQuery("input[type*=radio]").parent().removeAttr("disabled").css("pointer-events","");
      }
   }
});