Validation based on count of responses to several multiple choice questions | XM Community
Skip to main content

Validation based on count of responses to several multiple choice questions

  • November 18, 2022
  • 6 replies
  • 200 views

MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Level 5 ●●●●●

I have several multiple choice questions on a page. I have them in column layout (3 columns) rather than the default vertical layout. Is there a way to do validation/ stop a respondent progressing if they tick more than say 5 responses across the various multiple choice questions on the page?
n.b. there is display logic on each multiple choice question, so if I merged all the multiple choice questions into one question, then I'd need to add display logic on all of the options. Also, there are a lot of options, so I am using the column layout (3 columns) rather than the default vertical layout. I believe you can only use groups with the vertical layout.

6 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • November 19, 2022

MikeW
You can do this via custom coding rather than by custom validation where you can find the number of choices selected real time.Post which you can disable the other options if it is greater then 5.
Apply the same code in all your multiple choice questions.
Qualtrics can also provide you the selected choices count but it would be post the next button click/ post block is completed not relevant to your use case. You can use an embedded data with the value something like this ${q://QID368/ChoiceGroup/SelectedChoices}. Change the QID as required if you want to trigger a warning at the later stage.
Hope it helps!


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • November 19, 2022

MikeW,
You can do it with Custom Validation on the first question something like:
Q1 Selected Count Is Less Than or Equal to $e{ 5 - ( q://QID2/SelectedChoicesCount + q://QID3/SelectedChoicesCount ) }
BTW, you might be interested in the mcColumns function. It is a much more flexible way to do columns and it supports choice groups.


MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • November 19, 2022

MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • November 19, 2022

https://community.qualtrics.com/XMcommunity/discussion/comment/52392#Comment_52392Hi TomG - please can I check. Does this approach work if the questions are within a loop & merge block?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • November 20, 2022

MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • November 23, 2022