English to French translated course no longer pulling up LMS username

Jul 06, 2020

We have copied files from English course we have successfully launched and published in LMS and used those copies to translate each slide text contents into French.

Nothing else has been changed, except we tried on adding an Exit Course trigger button. 

Then when published, the French translated file no longer pulls the learner's name. (Same Javascript is used for the English and French course to pull the learner's name in the first and last page). 

We tried multiple troubleshooting removing the Exit button, but to no avail. 

Maybe someone can shed us a light or two? 

Thanks in advance!

1 Reply
Jericha dela Paz

Hi, this is the Javascript we use to pull the learner's name from LMS into the course. We are wondering if anyone can check and see if we should be updating it: 

//Grab the LMS object
var lmsAPI = parent

//Ask the LMS object to get the name
var rawName = lmsAPI.GetStudentName();

//LMS returns the name as "Last, First"
//The name goes into an array
//That is split into two elements
//NameArray[0] holds the last name, and nameArray[1] holds the first name
var nameArray = rawName.split(",")

//Typically, the first name is used onthe title screen
//LMS returns the first name with a preceeding space and a space at the end of the name
//The function substring(1) gets rid of the leading space
var firstName = nameArray[1].substring(1);

//The slice function cuts off the trailing space
//firstName = firstName.slice(0, -1);

//Set the last name equal to the nameArray[0] element so it can be used use later
//On the certificate
var lastName = nameArray[0];

//Ask for the Articulate player
var player = GetPlayer();

var currentTime = new Date()
var month = currentTime.getMonth()+1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dateString = month + "/" + day +"/" + year
//var player = GetPlayer();

//Set the variables created in Storyline to the first and last names
player.SetVar("firstName",firstName);
player.SetVar("lastName",lastName);
player.SetVar("systemDate", dateString);

 

___________________________________

 

Thanks in advance!

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