Matrix carousel multi select - how to set up exclusive option | XM Community
Skip to main content
Solved

Matrix carousel multi select - how to set up exclusive option


Forum|alt.badge.img+1
  • Level 1 ●
  • 6 replies

Hello!

I have a multi select matrix question set up as a carousel and I would like to define one of the answer options (‘Not sure’) as exclusive.

Has anyone advise on this?

I found another post on this but unfortunately the code didn’t work.

Thank you!

Best answer by TomG

@EvaZw,

You can use this as long as you aren’t using Simple layout.

 

View original

3 replies

Forum|alt.badge.img+20
  • QPN Level 5 ●●●●●
  • 290 replies
  • March 6, 2024

Hi @EvaZw you can use custom validation to create a specific combination of conditions through which respondent can pass the questions.
NOTE: This can prove to be lengthy and complicated if you have large number of statements and scale points.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5935 replies
  • Answer
  • March 6, 2024

@EvaZw,

You can use this as long as you aren’t using Simple layout.

 


Forum|alt.badge.img
  • 1 reply
  • August 7, 2024

Thank you @TomG! The code works! I have applied it in a multi-choice carousel where the 9th column is exclusive. 

 

Qualtrics.SurveyEngine.addOnload(function() {
  /* carouselExclusive.js */
  /* Thomas Gibbons Consulting (qualtricswiki.tgibbons.com) */
  var q = jQuery(this.questionContainer);

  // Add 'exclusiveCB' class to checkboxes in column 9
  q.find(".CarouselAnswerButtonContainer").each(function() {
    var columnIndex = jQuery(this).index();
    if (columnIndex === 8) { // Column index is zero-based, so column 9 is index 8
      jQuery(this).find("[type=checkbox]").addClass("exclusiveCB");
    }
  });

  var cbs = q.find("[type=checkbox]"), 
      exCbs = cbs.filter(".exclusiveCB"), 
      notExCbs = cbs.not(exCbs);

  exCbs.click(function() { 
    if (this.checked) cbs.not(this).prop("checked", false); 
  });

  notExCbs.click(function() { 
    if (this.checked) exCbs.prop("checked", false); 
  });
});

Leave a Reply