var COST = ["$400","$500","$600","$700","$800"];
var COST_a1 = COST[Math.floor(Math.random()*COST.length)];
alert (COST_a1) ; /* for debugging */
When I preview the survey, Qualtrics runs this piece of code TWICE. The alert box pops up twice with different values for COST_a1.
This is causing issues on another page when I try to capture the value of Cost_a1
using
this.setChoiceValue(3,COST_a1);
I only need the random value to be generated once. Any guidance on this matter is appreciated.
Thank you.
Best answer by Michael_Campbell_RedPepper
View original