Auto advance for matrix question | Experience Community
Skip to main content
Solved

Auto advance for matrix question

  • Nov 21, 2024 11:21 AM UTC
  • 2 replies
  • 142 views

ManfredBM
Level 5 ●●●●●
Forum|alt.badge.img+37

Hi,
for the past 3 years I was using the following JS for simulating an auto advance on matrix questions.

 

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var that = this;
var choices = this.getChoices( "radio" ).length;
this.questionclick = function( event, element ){
var selected = that.getSelectedChoices().length;
if ( choices == selected ) {
that.clickNextButton();
}
}

});

This code worked like a charm - but stopped working about 2 months ago!

 

The current behaviour is:

Once all subquestions in the matrix are answered, the next button gets clicked and the next question is displayed. BUT also on the next question, the next button is clicked and this question is basically not displayed.

 

Is anyone aware of any changes made by Qualtrics, which could cause this behaviour?

Or is there a different solution for auto advance on a matrix question?

 

Thanks!

Manfred

Best answer by vgayraud

Hi,

See this post, your problem has the same cause : 

 

View original

2 replies

vgayraud
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+68
  • QPN Level 8 ●●●●●●●●
  • Answer
  • Nov 21, 2024 11:50 AM UTC

Hi,

See this post, your problem has the same cause : 

 


ManfredBM
Level 5 ●●●●●
Forum|alt.badge.img+37
  • Author
  • Level 5 ●●●●●
  • Nov 22, 2024 6:48 AM UTC

Thanks a lot, ​@vgayraud !

 

In my case, simply replacing the last line of code solved the issue. 

Here’s the code that works:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var that = this;
var choices = this.getChoices( "radio" ).length;
this.questionclick = function( event, element ){
var selected = that.getSelectedChoices().length;
if ( choices == selected ) {
jQuery(".NextButton").click();
}
}

});