Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active October 27, 2022 12:39
Show Gist options
  • Save marketinview/4d6916c1b180830ec97c04f03e59149b to your computer and use it in GitHub Desktop.
Save marketinview/4d6916c1b180830ec97c04f03e59149b to your computer and use it in GitHub Desktop.
Qualtrics: Randomize Side-by-side Selects #qualtrics #js #jq #sbs #select #random
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]); }
});
});
@marketinview
Copy link
Author

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