Hi,
When I use Loop and Merge in Qualtrics, I like to capture the ordering of the loop and merge for easy analysis. I also like to dynamically update (and print to the participant) the Loop & Merge round number.
I’ve been using this code for a while but it suddenly does not work anymore. Does anybody know why that may be?
Thank you so much for your time and inputs!
(Note that these will go up to 12 for the current sandbox version, I have added up to 3)
And the code in written form:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
//input
var round = parseInt("${e://Field/round}");
var id = parseInt("${lm://Field/1}");
Qualtrics.SurveyEngine.setEmbeddedData("order_treatment_"+id, round);
// order opposite:
var id = parseInt("${lm://Field/1}");
Qualtrics.SurveyEngine.setEmbeddedData("treatment_of_scenario_nr_"+round, id);
// up round
var round = round + 1;
Qualtrics.SurveyEngine.setEmbeddedData("round", round);
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
// order
});