Set custom validation to matrix table to force respondents rate at least 3 of the given statements | XM Community
Solved

Set custom validation to matrix table to force respondents rate at least 3 of the given statements

  • 7 August 2019
  • 3 replies
  • 68 views

Badge
Hi everyone,

I'm setting up a survey with a couple of matrix table questions, each one contains some statements which I would like people to rate by Likert scales.

Because of the statement lists are a bit long (some contains more than 10 statements), I do not want to force the respondents to rate each single statement, but rather, for each matrix table question, force them to rate at least 3 out of the given statements.

How do I set the custom validation to achieve this?

Here's a snapshot if it helps to make sense, as you can see there are seven statements, and I would like people to rate at least 3 of them.

!

Thank you!
icon

Best answer by KimothiSaurabh 2 September 2019, 14:31

View original

3 replies

Userlevel 4
Badge +5
I don't believe this can be done in validation alone. You would need to either create some branch logic after the question in the survey flow and then repeat it OR you could use some custom code. This question might be better answered if posted in the Custom Code category.
Userlevel 4
Badge +18
Right, this is not feasible by validation code only. You can use below code that would disable the next button until 3 rows are answered so respondent can move next only after answering at-least three statements. You can update this code to show error message as well if respondent try to click next button instead of disabling it.


Qualtrics.SurveyEngine.addOnload(function()
{
this.disableNextButton();
this.questionclick = function(event,element)
{
if (element.type == 'radio')
{
var numAnswered= this.getSelectedChoices()
if (numAnswered.length >= 3)
{
this.enableNextButton();
}
else
{
this.disableNextButton();
}
}
}
});
Badge
Thank you @KimothiSaurabh and @Libertywick for your answers. The disable "next" button suggestion sounds like a good work-around. I'll give it a try.

Leave a Reply