I created a survey where participants answer the same question block multiple times. In between each answer, I store the participant’s responses in some embedded data variables, change some parameters, and then display the same question block again.
However, after the first time participants answer the block, their responses remain selected on the questions for the next time I display the block. How can I reset these using JavaScript?
Here’s what I tried:
Qualtrics.SurveyEngine.addOnload(function() {
// Function to reset choices for a given question
function resetChoices(questionID) {
var choices = jQuery('#' + questionID + ' .q-radio, #' + questionID + ' .q-checkbox');
choices.each(function() {
jQuery(this).prop('checked', false);
});
}
// Reset choices for the specified questions
resetChoices('QID632');
resetChoices('QID631');
});
I’m not sure why this code isn’t properly resetting the multiple choice question. I have a page break between the question containing this JS and the multiple choice questions.