Last active
October 27, 2022 12:39
-
-
Save marketinview/4d6916c1b180830ec97c04f03e59149b to your computer and use it in GitHub Desktop.
Qualtrics: Randomize Side-by-side Selects #qualtrics #js #jq #sbs #select #random
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
var selector = "select"; //Update for specific selects | |
jQuery(this.questionContainer).find(selector).each(function() { | |
var sel = jQuery(this); | |
var options = sel.find("option:not(:first)").toArray(); | |
for(var i=0;i<=options.length;i++) { sel.append(options[Math.random() * i | 0]); } | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php