Toggle menu
876
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Auto next on single question: Difference between revisions

From Catglobe Wiki
Created page with "To make single questions automatically go to next question when an answer option has been selected, put the script on questionnaire's javascript of editor <source lang="javas..."
(No difference)

Revision as of 07:26, 15 October 2020

To make single questions automatically go to next question when an answer option has been selected, put the script on questionnaire's javascript of editor

AnswerSheet.bind('afterShowPage', function(ev, as) {
	//check current is Single Question
	if (as.questions.length != 1) return;
	var q = as.questions[0];
	if (q.type != 1) return;
	//auto next
	q.answerOptions.bind('selectionChanged', function() {
		var ao = this.getAnswer()[0];
		if (!ao || ao.open) return; //ignore Open answer
		as.moveToNextPage();
	});
});