JavaScript for obtaining the Learner's name from the LMS

Jan 11, 2024

Hi everyone,

I have looked at a couple of the posts on here and watched a tutorial video by Jeff Batt at Learning Dojo on how to retrieve the learner's name from the LMS and display it automatically on a slide.

I can't seem to get it to work and I am a complete novice when it comes to JS, is there anyone who can help me get it working?

This is the code I have used which is from Jeff Batt:

let player = GetPlayer();
let myName = lmsAPI.GetStudentName();
let array = myName.split(',');
let newName = array[1] + ' ' + array[0];
                  
player.SetVar("lmsName", newName);

I have tried this with let and with var

Thanks, Adam

Be the first to reply