Forum Discussion

SharonUrquha144's avatar
SharonUrquha144
Community Member
23 days ago

Pulling Student Name from Oracle LMS using JavaScript

Hello brains trust!

I am hoping that one of you can help me with this.

I am trying to pull the student name from our Oracle LMS using JavaScript. When I upload the course into SCORMCloud, it works perfectly. However, it does not work at all when I upload the course to our Oracle LMS.

Here is the JavaScript I have used:

let player = GetPlayer();

let myName = lmsAPI.GetStudentName();

let array = myName.split(',');

let newName = array[1] + ' ' + array[0]

player.SetVar("lmsName", newName)

Has anyone else had this problem and been able to rectify it? Is "StudentName" called something else in Oracle? 

The attached image shows the output from our LMS with the student name missing, and then the output from SCORMCloud with the student name displaying.

  • SBP_Inc's avatar
    SBP_Inc
    Community Member

    The "StudentName" is a function, not a variable as you might be thinking. I would start by finding out if the call lmsAPI.GetStudentName is working and myName is a value. The better question is  does the lmsAPI object's GetStudentName function know how to get the value from Oracle.

    Bonus tip, let newName = array.join(' ') is shorter