Java script to record Quiz score
Oct 12, 2015
Hi,
I have a SQL database so I can record where in a module learners click. Here is an example of workign code: window.top.triggerLogging("widget", "codes");
Now, I am trying to record the quiz results. But it is not working. Here is the non-workign code. It is not recording anything to the database:
window.top.triggerLogging("Quiz 1", player.GetVar("Results.ScorePoints"));
The Results.ScorePoints is a variable created by SL when you create a quiz results page. I am trying to record the actual value of the variable.
Can anyone see what I might be doing wrong?
4 Replies
Hi Ben,
You may want to share the .story file here so that folks can take a look at your code in action as it's not something that we can offer support for. Also, as a reminder you'll want to confirm that you're testing the published output in the intended environment as testing it locally could cause you to encounter security restrictions where elements wouldn't work as expected.
Hey Ben,
I have had success using the Tin Can API to record the actions of the users in a database. https://www.articulate.com/tincanapi/
It fires off http requests to your tincan endpoint with what ever action the user does.
Thanks Kumar for sharing here.
Instead of requesting the Results.ScorePercent in Storyline set a user defined variable to results.scorePercent and then request that, the built in variables are protected.
This discussion is closed. You can start a new discussion or contact Articulate Support.