简体   繁体   中英

How do I access the responses from previous questions in Qualtrics

I have a survey where I'd like to pull the output from a "Pick Group and Rank" list for use in a second question. We need both the items and the ranking. The operation in the second stage is a complicated set of random pairwise comparisons, and the base Qualtrics functionality isn't flexible enough to do it.

I have looked through the Qualtrics Javascript API and I assume one of the getChoices* functions is what I want, but I don't know how to reference the previous question.

Thanks for any help!

EDITED answer based on comment:

You can only access things (questions) on the same page with JavaScript. I'm assuming your questions are on different pages (otherwise it would be a real mess). So you can't access the answer to the first question with getChoices(). You could pipe the answers from the pick/group/rank into the second question, but it would be difficult to make effective use of them at that point.

A better way is to send all the pick/group/rank piped variables (items and rankings) to a web service script and have it sort the items by ranking. This is how I always do it.

You pipe the pick/group/rank variables into the parameters of your web service call. Since in this case you are dealing with pairs (the description and the rank), you probably want to make them one parameter with a delimeter that your web service script can use, such as:

answer1 = ${q://QID1/ChoiceDescription/1}~${q://QID1/ChoiceNumericEntryValue/Rank/1}
answer2 = ${q://QID1/ChoiceDescription/2}~${q://QID1/ChoiceNumericEntryValue/Rank/2}
etc...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM