Forum Discussion
JoeFrancis
3 years agoCommunity Member
Let's start with retrieving the user's name from Moodle and displaying it. The Javascript you would use is:
var player = GetPlayer();
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var lmsStudent_Name = lmsAPI.GetStudentName();
player.SetVar("lmsStudent_Name", lmsStudent_Name);
Create a new variable in Storyline called lmsStudent_Name and insert it as a Reference into a Text Box.