Embed the answer that corresponds another answer
Hello,
I am trying to record the answer depending on another answer. What I mean is that, let's say that I have 3 blocks. Each block has the same questions, like:
Block #1: First trip
Q1. How many miles did you travel? (text entry, only number)
Q2. What was the trip purpose? (multiple choice)
Block #2: Second trip
Q3. How many miles did you travel?
Q4. What was the trip purpose?
Block #3: Third trip
Q5. How many miles did you travel?
Q6. What was the trip purpose?
Then, I want to record the trip purpose if the trip mile is the longest among the three.
So, my logic is like,
var max = Math.max("${q://QID1/ChoiceTextEntryValue}", "${q://QID3/ChoiceTextEntryValue}", "${q://QID5/ChoiceTextEntryValue}");
Qualtrics.SurveyEngine.setEmbeddedData("max", max);
//From here, I just say my logic. It will not make sense in terms of javascript
if "Q1" is max, record the answer of Q2;
else if "Q3" is max, record the answer of Q4;
else record the answer of Q6;
//
Is it possible in Qualtrics?
Thank you very much in advance.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
