Getting from LMS cmi.learner_name as variable

Jul 26, 2019

Hello everybody,

I read every single message in this thread  (https://community.articulate.com/discussions/retrieve-lms-user-name-as-variable) , and in some others (https://community.articulate.com/discussions/getting-the-student-name-from-the-lms).... (https://community.articulate.com/discussions/getting-student-name-from-the-lms-and-using-it-in-articulate)

But couldn't find what I am looking for :

My client LMS (Talentsoft) in SCORM 2004, can display cmi.learner_name as a variable.

I tried many many many syntaxes to grab this data, but I guess the only working one wasn't in my scope !

Can anymone help me ? what is the syntax to grab this value ?

thank you for the help

Philippe

1 Reply
phil Mek

Hello again,

Matthew Bibby gave me the answer. It works perfectly in Talensoft LMS.

Be aware that  I only needed the firstname.

Here is his code to close this thread.

 

function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var name = lmsAPI.SCORM2004_GetStudentName();
var nameArray = name.split(',');
var firstName = nameArray[1];
// var lastName = nameArray[0];
// var fullName = firstName + ' ' + lastName;
var player = GetPlayer();
player.SetVar("Name",firstName);

 

Philippe

This discussion is closed. You can start a new discussion or contact Articulate Support.