I have created JS to define a variable by picking the highest score between multiple items. I then add these new variables as embedded data in the survey flow to include an an email trigger score report. The JS does not seem to run as these defined variables are not factored into my scoring at the end. I am wondering if anyone had a suggestion as to what could be off.
Qualtrics.SurveyEngine.addOnload(function()
{
var D2 = Math.max(parseInt("${gr://SC_080RbHTrsT1D3dX/Score}"), parseInt("${gr://SC_bxT0sMdAzcuvVwp/Score}"), parseInt("${gr://SC_0qdtqn6ZDef4M3r/Score}"));
Qualtrics.SurveyEngine.setEmbeddedData("D2", D2);
var D3 = Math.max(parseInt("${gr://SC_d6FNACqSr3a57F3/Score}"), parseInt("${gr://SC_eyuzFq3CuB0eKjz/Score}"));
Qualtrics.SurveyEngine.setEmbeddedData("D3", D3);
var D4 = Math.max(parseInt("${gr://SC_b286v30r9zo0naZ/Score}"), parseInt("${gr://SC_2bDQfrW19FnTcXj/Score}"), parseInt("${gr://SC_e2rxOogyrh9w3f7/Score}"), parseInt("${gr://SC_9RMkPlGRr2G1MDr/Score}"));
Qualtrics.SurveyEngine.setEmbeddedData("D4", D4);
});
Best answer by TomG
View original