code for group, pick rank to assign items to groups (hidden) | XM Community
Skip to main content

Hi!
so for multiple choice there exists this Option 'add choice group' but apparently this is not available for the 'Group, pick, rank' Question.
i would like to randomize among the items in such Groups so that only 1 of each Group will be shown to a participant. that would work out if only i could assign the choices to Groups (which i hide)
is it possible to create such an assignment of items to Groups with JavaScript or so and randomize among the items in the groups?
I would be very happy, if yomeone could help!
thanks :)

One of the solution to accomplish this is using choice display logic.
Let's take for example if we have group A with 5 choices, then create 5 embedded data as GroupA_1, ....,GroupA_5 and set its initial value to 0. Now create a Randomizer with 5 embedded data elements as GroupA_1, ....,GroupA_5 under it, with value set to 1. Put 1 in randomly present text box. This randomizer will set the value to 1 for any one of the embedded data.
In the PGR question add display logic on each choice as display if its respective embedded data value is equal to 1. For example the display logic on first choice of Group A will be - display if embedded data "GroupA_1"= 1


That works perfectly! Just how I had imagined 🙊🔭 thank you so so much!!! rondev


Leave a Reply