Randomization task with loop & merge and feedback | XM Community
Skip to main content

My task is to randomly assign participants to one of two groups (group tiger or leopard).

Then, I randomly assign 8 targets to the participant's or another team using hidden question randomization and html span tags.

 

My goal is to record which groups I have randomly assigned the targets to so I can later on quiz the participants on which member belonged to their team, giving them feedback on whether they were correct or incorrect.

 

My ideas so far were to record the assignments in JS, save them as embedded variables and then pipe them in the Loop&Merge field of the quiz.

 

However, I am unsure how to code all of this correctly. Any help would be much appreciated!

Everything after ‘var assignedTeam=...’ needs to be in an event handler. Where Tiger is choiceid 1 and Leopard is choiceid 2:

jQuery("#"+this.questionId+" dchoiceid]").click(function() {
if(this.checked) {
var selectedTeam;
if(this.getAttribute("choiceid")=="1") selectedTeam = "Tiger";
else selectedTeam = "Leopard";
if(selectedTeam == assignedTeam) {
/* rest of code goes here */
}
});

 


Leave a Reply