Forum Discussion
Importing and retaining variables
Hi,
Try this code to get the name from the lms. You can see how to display either first name only or full name.
//get user name
//grab the LMS object
var lmsAPI = parent
//ask the LMS object to get the name
var rawName = lmsAPI.GetStudentName();
//the name comes very formal "Last, First"
//we will fix that by sticking the name into an array
var nameArray = rawName.split(",")
//then we save it the other way round "First Last"
var niceName = nameArray[1] +" "+nameArray[0];
//now we grab the Articulate player
var p = GetPlayer();
- JayDharap11 years agoCommunity Member
Hi Bruce!
Thank you for helping me! What I am getting is teh full name, and I would
like to create a variable with just the first name, so what i wanted to
know is how I could isolate the first name from the array into a variable...Any thoughts?
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago