Displaying blocks based on rank of previous answer? | XM Community
Skip to main content

Hello all, 

I hope you can help me. I'm designing a survey in which I use a constant sum (without forced total) question to ask teachers how many hours a week they spend on certain teaching tasks.

For each teaching task I have a separate block of follow up questions. To diminish survey length I only want to show the 2 blocks of follow-up questions for the tasks that the participants spend the most and second-most time on. Preferably randomized so that half the group gets second-most before most and vice versa.

If I look at branch logic, I can only select by values greater/smaller than, not on the values relative to each other,  which would lead to some teachers being presented with four or more follow-up blocks, and others with none at all. I understand the answer to this is probably Javascript, and I have found the question API, but I'm struggling with how to implement it. I have some programming knowledge, but not in Javascript, and the people around me with Javascript knowledge have no Qualtrics knowledge. Do you have any assistance on how I can get started with this?

You can use JavaScript to rank (i.e., sort) the choices and save them to embedded data fields.  You really only need the question API to save the embedded data fields. A JS programmer should be able to do it without prior knowledge of Qualtrics if they have access to the survey.

I have a function, csRanks, that does this (not compatible with New Experience). Contact me by private message if interested.


Leave a Reply