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

Auto advance for matrix question

  • November 21, 2024
  • 2 replies
  • 62 views

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

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 5 ●●●●●
Forum|alt.badge.img+48
  • QPN Level 5 ●●●●●
  • 367 replies
  • Answer
  • November 21, 2024

Hi,

See this post, your problem has the same cause : 

 


ManfredBM
Level 5 ●●●●●
Forum|alt.badge.img+35
  • Author
  • Level 5 ●●●●●
  • 114 replies
  • November 22, 2024

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();
    }
}

});

 


Leave a Reply