Forum Discussion
Retrieve LMS User Name as Variable
Ah. The very first one posted was Flash only. However, HTML5 output supports the second one posted no problem. Has for awhile:)
Only works in Flash:
player.SetVar("sLearnerName", SCORM_GetStudentName());
Works in all:
var player = GetPlayer();
//might need to use lmsAPI=parent; on some LMS
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);
- AlexYong110 years agoCommunity Member
Gah! Ok, but the issue that Tanmay found was that this JS wouldn't work on the certificate or results slide. But now that i'm comparing the code I see he's using something different. The code you posted above will work in the results slide too? Or is that the limitation that Tanmay was working around?
Thanks in advanced for helping me understand, this is so very helpful!
- KyleMullaney6 years agoCommunity Member
This is not working in HTML5 on Sakai. It does work in flash on Sakai.
- BrianAllen6 years agoCommunity Member
I'd be curious to know if Sakai exposes student name as part of it's API... Not sure if this is an industry standard, and not sure if Sakai adheres to those industry standards.