Ending a block upon selecting in multiple choice | XM Community
Skip to main content
Solved

Ending a block upon selecting in multiple choice

  • April 18, 2019
  • 4 replies
  • 13 views

I want the block to end once participants choose one of the multiple choices. I came up with the following code "my knowledge with Java is so poor": Qualtrics.SurveyEngine.addOnload(function() { $(this.questionId).select('checked')==true.first().observe('click', function(event) { $('NextButton').click(); }); }); Qualtrics.SurveyEngine.addOnReady(function() { jQuery("[type='checkbox']").change(function(){ if(jQuery(this).prop("checked") == true){ ('NextButton').click(); } }); }); Still, it does not work. Any help, please

Best answer by ahmezon

Dear @WaterSampler, Thank you so much. I figured this out, and it works. Qualtrics.SurveyEngine.addOnload(function() { $('Buttons').hide(); var that = this; this.questionclick = function(event,element){ if (element.type == 'radio') { that.clickNextButton(); } } });

4 replies

  • April 18, 2019
Hello @ahmezon , Use skip logic on MC question and select end of block

  • Author
  • April 18, 2019
Dear @Shashi Thank you. Skip logic works only after the next button is clicked. I want to bypass that. We are measuring the response time. We need the block to terminate once a choice is made.

WaterSampler
Level 2 ●●
Forum|alt.badge.img+1
  • Level 2 ●●
  • April 19, 2019
You can use a function like this added to the OnLoad: this.questionclick = function(event,element) { $('NextButton').click(); } This assumes that you want all answers to automatically end the block. You can put conditional logic in also to click the next button when a specific choice is clicked.

  • Author
  • Answer
  • April 20, 2019
Dear @WaterSampler, Thank you so much. I figured this out, and it works. Qualtrics.SurveyEngine.addOnload(function() { $('Buttons').hide(); var that = this; this.questionclick = function(event,element){ if (element.type == 'radio') { that.clickNextButton(); } } });