Hi everyone I hope someone can help me with this.
So I have a multiple choice question where people are forced to choose 4 answers from a list of 12 choices.
Now in a the next question, I want to compare the selected choices with each other. So if a person choose for example banana, apple, pear and cherry from a list of fruit, I would want to ask them how apples compare to pears, then how apples compare to bananas and finally to cherries.
So I would ideally like to have a line to pipe each selected answer from 1 question individually, and not all at the same time like ${q://QID62/ChoiceGroup/SelectedChoices} or the carry over function does. Is there a way to pipe 'selected answer 1', 'selected answer 2' etc. seperately?
How to pipe seperate selected choices from one multiple choice question to compare them
Best answer by rondev
The code is correct except the line - var rank = ......... ; here their is an extra '}' just remove one. Also, this code will run on next page any questions JS part. Make sure you have created four embedded data at the beginning of the survey.
Below is the method 2, this code needs to be pasted on the same MC question (unlike previous one). First, go to recode values and check variable naming option and click close. Paste the below code in the JS part of the MC question (the code will only run if the selection is equal to 4, hence make sure you have set the custom validation properly)
Qualtrics.SurveyEngine.addOnPageSubmit(function(type)
{
var that = this;
if(type == "next")
{
var arr = that.getSelectedChoices();
var ed = ["k1","k2","k3","k4"];
if(arr.length == 4){
for(var i = 0;i
}
}
}
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.