Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active February 6, 2024 16:10
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/b03bb890f1fd07343ba6ce09377b8f6e to your computer and use it in GitHub Desktop.
Save marketinview/b03bb890f1fd07343ba6ce09377b8f6e to your computer and use it in GitHub Desktop.
Qualtrics: MC choices to list. Use to present an unordered (bullets) or ordered (numbered) randomized list of items. #qualtrics #js #jq #random #list #bullets #numbered
Qualtrics.SurveyEngine.addOnload(function() {
var listType = "ul"; //use ul for unorderd list, ol for ordered list
var q = jQuery(this.questionContainer);
q.find(".QuestionBody").hide();
q.find(".QuestionText").append("<"+listType+" class='choiceList'></"+listType+">");
var list = q.find(".choiceList").css("margin-bottom","0px");
q.find("label.SingleAnswer>span").each(function() { list.append("<li>"+this.innerHTML+"</li>"); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment