Skip to content

Instantly share code, notes, and snippets.

@marketinview
Created November 29, 2022 22:40
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/50356345b379ecc6f09b3b29b6074444 to your computer and use it in GitHub Desktop.
Save marketinview/50356345b379ecc6f09b3b29b6074444 to your computer and use it in GitHub Desktop.
Qualtrics: Randomize Bipolar Left/Right Statements. Turn off Mobile Friendly (it is useless anyway). #qualtrics #js #jq #bipolar #random
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .ChoiceRow").each(function() {
if(Math.random() < 0.5) {
var row = jQuery(this);
row.children().each(function() { row.prepend(jQuery(this)); });
row.find("th").first().removeClass("AnswerLeft").addClass("AnswerRight");
row.find("th").last().removeClass("AnswerRight").addClass("AnswerLeft");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment