Forum Discussion
Sum many text variables in one variable
Hi Francesco,
What Phil says is absolutely true, in terms of the LMS's ability to collect data.
To the narrower question about the Javascript, there were a few small errors, and it is very picky. (You had a couple of extra parentheses characters, and while you had created Javascript variables jsQ1, jsQ2, etc., the script was trying to use js_Q1, js_Q2, etc.
I was able to get it to work with the Javascript below.
var player = GetPlayer();
var jsQ1 = player.GetVar("Q_1");
var jsQ2 = player.GetVar("Q_2");
var jsQ3 = player.GetVar("Q_3");
var jsQ4 = player.GetVar("Q_4");
var jsQ5 = player.GetVar("Q_5");
var jsQ6 = player.GetVar("Q_6");
var jsQ7 = player.GetVar("Q_7");
var jsQ8 = player.GetVar("Q_8");
var jsQ9 = player.GetVar("Q_9");
var jsQ10 = player.GetVar("Q_10");
player.SetVar("Result1",jsQ1+" "+jsQ2+" "+jsQ3+" "+jsQ4+" "+jsQ5+" "+jsQ6+" "+jsQ7+" "+jsQ8+" "+jsQ9+" "+jsQ10)
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago