Last active
February 6, 2024 16:10
-
-
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
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 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