Logging and tracking quiz results to a web server

Hello, I'm working towards the goal of using javascript to post quiz results to a web server. I'm starting small by simply using console.log to log quiz results, this this small test is not working. Can someone guide me in the right direction please? My script is below, and it executed by trigger when timeline (results slide) starts. Thanks!

 

var player = GetPlayer();
var score = player("Results.PassPercent");
console.log("score");

1 Reply
Matthew Bibby

You can't access the Results.PassPercent variable in that way.

First, in SL, add a trigger that makes a different variable equal to the results variable, then you'll be able to grab it from SL using JS.

Also, your script won't actually get any variable. It needs to be formatted like this:

var player = GetPlayer(); 
var score = player.GetVar("StorylineVariable");