Javascript stopped working
Apr 15, 2013
Hi all
I have used this javascript in previous courses to get the student name and ID from the LMS. Those courses still work.
Now I am doing a new course and the code doesnt work at all. Did something change in the last update?
I have checked the API and get the correct responses from there LMSGetValue("cmi.core.student_name")
Anybody got any clues?
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var FullName = array[1] + ' ' + array[0];
var FirstName = array[1];
var LastName = array[0];
player.SetVar("FullName", FullName);
player.SetVar("FirstName", FirstName);
player.SetVar("LastName", LastName);
var UserName = lmsAPI.GetStudentID();
player.SetVar("UserName",UserName);
Going Nuts
2 Replies
Finally found it.
A syntax error in an unrelated Javascript stopped everything.
Removed the failed javascript and it all worked again.
Hi Graeme,
Sorry for the delay in response. I'm happy to hear you were able to get this working. Thanks for sharing the solution!
Have a great day,
Christine
This discussion is closed. You can start a new discussion or contact Articulate Support.