Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active October 23, 2022 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marketinview/8310ba82acde38be62f007095bbe0278 to your computer and use it in GitHub Desktop.
Save marketinview/8310ba82acde38be62f007095bbe0278 to your computer and use it in GitHub Desktop.
Qualtrics: Automatically answer a multiple choice question with only one choice and go to next page. #qualtrics #js #jq #mc #carryforward
Qualtrics.SurveyEngine.addOnReady(function() {
var qobj = this;
var displayedChoices = [];
jQuery.each(qobj.getChoices(), function(index, value) {
if(qobj.getChoiceDisplayed(value)) displayedChoices.push(value);
});
if(displayedChoices.length == 1) {
qobj.setChoiceValue(displayedChoices[0], true);
qobj.clickNextButton();
}
});
@marketinview
Copy link
Author

marketinview commented Feb 6, 2019

See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment