I would like to randomly choose a multiple choice answer for participants (like randomization). I will not be displaying this question to participants.
My goal is to randomize without creating a dozen extra questions and excessive display logic. Hence, not wanting to use randomization and do extra survey flow work. This would allow me to be able to pipe the (randomly chosen) answer into the next questions.
Page 1 / 1
Hi LBG
Try adding this Java Script code in that question, hope this helps.
Qualtrics.SurveyEngine.addOnReady(function () {
var $this = jQuery(this.questionContainer);
$this.hide(); //this line will hide the question for participants
var $choices = jQuery(".QuestionBody .ChoiceStructure .LabelWrapper label for]", $this);
var randomChoice = Math.floor(Math.random() * $choices.length + 1) - 1;
jQuery(".QuestionBody .ChoiceStructure .LabelWrapper labelpfor]:eq(" + randomChoice + ")", $this).click();
});
https://www.qualtrics.com/community/discussion/comment/34814#Comment_34814YOU ROCK. This was perfect.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.