Pick Group Rank - Javascript or jQuery to count number of specific items assigned to specific groups | XM Community
Question

Pick Group Rank - Javascript or jQuery to count number of specific items assigned to specific groups

  • 17 July 2019
  • 1 reply
  • 7 views

I have a pick/group/rank question which has 8 items that respondents must assign to two possible groups. The items are randomized, but I think the item numbers stay the same despite randomized presentation order for javascript purposes. Items 1-4 are all Category 1 items, and items 5-8 are Category 2 items. I would like to write code to count how many items from category 1 were dragged into group 0, AND how many items from category 2 went into group 0. I think my code needs to take the structure of:

if item 1 is in group 0, then increment group0cat1count.
... through item 4,
if item 5 is in group 0, then increment group0cat2count.
... through item 8.

However, I'm having problems identifying how to use javascript to get assigned groups for specific items. Could someone please advise on how to get group assignments for individual items in Qualtrics Javascript? Thank you.

1 reply

Userlevel 6
Badge +27

If we have only 8 items then we can also use Branch logic and Math operation to get the numbers.

Leave a Reply