Qualtrics.SurveyEngine.addOnReady(function() {
var words = [0.50, 1.50, 3, 5]; //Your words
var i = Math.floor(Math.random() * words.length); //randomly select an index
var my_word = words[i]; //select a word
Qualtrics.SurveyEngine.setEmbeddedData( 'word', my_word); //Send the word to the Qualtrics output, otherwise you would not know which participant get which word
document.getElementById("random").innerHTML = my_word; //show the word to respondents
});
Now I would do a maths operation with the stored value (e.g. 0.5) plus a fix value (e.g. 3) and show it in a question. For example, I would have the following question:
If you said yes to the question above, (where showed 0.5 - ${e://Field/word} )
are willing to pay £ 0.5 + 3? (I want to show that maths operation automatically)
How can I do this? With Javascript or Piped Text?
Best answer by valedigen
View original