Forum Discussion

BenChamish's avatar
BenChamish
Community Member
2 years ago

UserName from cornersone LMS

Anyone, 

I am creating a simple certificate in Storyline 360 and plan on embedding it into my RISE 360 course or users to print. I'm coming from Lectora. I'd like to have the users name added without them having to type it in. Lectora had a pre set variable for this, AICC_userName and it worked. I've seen several threads from years ago covering this but nothing has worked. My LMS is Cornerstone OnDemand, and im publishing as SCORM 1.2. below is what I've been trying, to see if any of them pull a username but to no avail. I've also tried without the ".getValue()". Any help would be supper helpful. the lmsNames# are variables set in Storyline.

let player = GetPlayer();

let myName1 = cmi.core.student_name.getValue();
let myName2 = cmi.core.student_id.getValue();
let myName3 = cmi.learner_id.getValue();
let myName3 = AICC_Student_Name.getValue();

player.SetVar("lmsName1", myName1);
player.SetVar("lmsName2", myName2);
player.SetVar("lmsName3", myName3);
player.SetVar("lmsName4", myName4);

  • try

    function findLMSAPI(win) {
      if (win.hasOwnProperty("GetStudentID")) return win;
      else if (win.parent == win) return null;
      else return findLMSAPI(win.parent);
    }

    let player = GetPlayer()
    let lmsAPI = findLMSAPI(this);

    let myName = lmsAPI.GetStudentName();

    player.SetVar("StudentName", myName);