Forum Discussion
ScottDellinger
8 years agoCommunity Member
How to access xAPI/Tin Can LMS variables in JavaScript
When Storyline 360 publishes a SCORM 1.2 or 2004 package, an entire library of SCORM JavaScript functions are created and can be used inside Storyline (for instance: SCORM_CallLMSGetValue("cmi.core....
Nandhakumar_S
8 years agoCommunity Member
Here is Retrieve the username From storyline code.
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var a =[];var a1 = [];
var foo = getParameterByName('actor');
a = foo.split(",");
var x=a[0];
a1 = x.split(":");
var str = a1[1];
var UName = str.replace(/[^a-zA-Z ]/g, "");
var player = GetPlayer();
player.SetVar("UserName",UName);