Java script to record Quiz score


I have a SQL database so I can record where in a module learners click. Here is an example of workign code:"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:"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
Ashley Terwilliger

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.