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....
SaralSharma
10 years agoCommunity Member
Hi guys,
I used the javascript code given in this forum and it works fine for me.
The problem is I also got bookmark feature "Prompt to resume on presentation restart'' which gets stop as soon as I use this javascript code to get the Learner's name.
Is there any way that I can have both features in my course?
I used following code for user name:
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);