Forum Discussion
Everything we know about Cornerstone on Demand and Storyline!
Hi All,
I'm trying to use JavaScript to pull in User Name and User ID into a Storyline 360 Module. I've successfully pulled in Name, but ID has been odd. It doesn't pull in the "User ID" or "Employee ID" that's in everyone's User Record. After a bunch of toying around, and reaching out to CSOD, we found out it's pulling in something called the "Target User ID", which is a unique identifier found in the URL of each user's transcripts. It's something generated on the back end?
I'm using the SCORM2004 3rd Edition. Any thoughts on why it pulls this ID, and not the User ID in the system? I'm waiting right now to hear back from CSOD about it, but I thought I'd ask on here as well.
See JS below. Thanks!
var player = GetPlayer();
function findLMSAPI(win) {
// look in this window
if (win.hasOwnProperty("GetStudentID")) return win;
// all done if no parent
else if (win.parent == win) return null;
// climb up to parent window & look there
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var myName = lmsAPI.SCORM2004_GetStudentName();
var array = myName.split(' ');
var newName = array[0] + ' ' + array[1];
player.SetVar("newName", newName);
var player = GetPlayer();
UserName=player.GetVar("newName", newName);
var lmsAPI = findLMSAPI(this);
var myID = lmsAPI.SCORM2004_GetStudentID();
var array = myID.split(' ');
var newID = array[0];
player.SetVar("newID", newID);
var player = GetPlayer();
UserID=player.GetVar("newID", newID);
Interesting - it looks like this is a sequential ID number that goes up by one for each new user. I noticed I am 16 and another administrator is 17, which sounds about right since we were probably the 16th and 17th users of the system.
My guess is that they use it for security reasons because they don't want it to be the same as the user's company ID number where it could potentially expose this online. But it may just be a pragmatic reason like, "that's how the programmer coded it."