Hello All,
I am trying to compare participant's input data, compare it against the number that is randomly generated, and show different messages depending on the size.
I have created a JS code that looks as below but I can't really find a reason why it does not work. I have tried it so many different ways but I keep getting an error message that there is an unexpected token {.
Qualtrics.SurveyEngine.addOnReady(function()
{
if (${e://Field/RandomAssetNo} > ${q://QID130/ChoiceTextEntryValue}) {
"Your earnings will be 0";
} else {
"Your earnings will be (${e://FieldRandomAssetNo - ${q://QID130/ChoiceTextEntryValue)";
});
My two questions would be:
(1) Can I bring participant inputted values and randomly generated number like above?
(2) What else wrong am I doing with the code there?
I would appreciate any of your help!
Thanks!
Question
(Using JS) Bringing participant's input data and comparing it against the random number generator.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

