Skip to content

Instantly share code, notes, and snippets.

@matthewphewes
Created May 15, 2013 15:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewphewes/e7a4fe703006bd1e18aa to your computer and use it in GitHub Desktop.
Save matthewphewes/e7a4fe703006bd1e18aa to your computer and use it in GitHub Desktop.
Articulate Storyline score/data submission and forwarding to a results page.
// Retrive the player instance so we an retrieve stored variables
var player = GetPlayer();
// These are variables saved within your Storyline module
var nameValue = player.GetVar("Name");
var scoreValue = player.GetVar("score");
// We create a session value (random number) so the value cannot and will not be submitted more than once
var sessionValue = Math.floor(Math.random()*9999999999999999999999999999);
// This creates a URL and retrieves it... forwarding the entire browser window to the results page
var url = "http://learntelehealth.org/games/hubandspoke?username="+encodeURIComponent(nameValue)+"&score="+encodeURIComponent(scoreValue)+"&session="+sessionValue;
window.location = url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment