Open JamesPHoughton opened 9 months ago
Copilot suggests this:
let questionOrder = [];
survey.onAfterRenderQuestion.add(function(survey, options) {
questionOrder.push(options.question.name);
});
// After the survey is completed, you can see the order of questions
survey.onComplete.add(function(result) {
console.log(questionOrder);
});
Strictly speaking, this only records the chronological order they were displayed in, not the visual order on the page
When we randomize questions on the page, we want to know the order that those questions appear to the user, and save this with the response. Recording and saving with the state might help with: https://github.com/Watts-Lab/surveys/issues/151