Forum Discussion
AndrewRost
13 years agoCommunity Member
Retrieve LMS User Name as Variable
I know you can have a user fill in a text box with their name and then later use that variable for personalization. What we would like to do is programmatically retrieve the user name from the LMS....
JamesBonney-EDE
9 years agoCommunity Member
Hi All,
In SL1, this code works for me on my Moodle LMS, but in SL2, it doesn't pull the name through. Can anyone tell me why it's no longer working?
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1];
player.SetVar("newName", newName);
Thanks
James