jasonC
jasonC

Reputation: 347

Retrieving values from Brightspace LMS using SCORM API

I'm trying to use the SCORM API provided by SCORM.com / Rustici here (https://scorm.com/scorm-explained/technical-scorm/run-time/), to retrieve some values from the Brightspace LMS.

The values I'm interested in are the student's name, student's section (in Brightspace lingo it is the student's class), and the course title. From the API reference (https://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/), I see that it's possible to extract the student's name using cmi.core.student_name.

Question: how can I extract the student's section and the course title using the SCORM API?

Upvotes: 0

Views: 412

Answers (1)

John
John

Reputation: 3785

Depending on which version of SCORM you are running then you need to copy and paste the code from https://scorm.com/scorm-explained/technical-scorm/run-time/api-discovery-algorithms/

Once you have done this then for sCORM 1.2

var API = getAPI();

if (API) {
   var studentName = API.LMSGetValue("cmi.core.student_name");
   console.log(studentName);
}
else {
    console.log("Failed: Did you run this course directly and not via the LMS?");
}

For SCORM 2004

getAPI(window);

if (API) {
   var studentName = API.GetValue("cmi.core.student_name");
   console.log(studentName);
}
else {
    console.log("Failed: Did you run this course directly and not via the LMS?");
}

There is a slight difference in code. You are better off using https://pipwerks.com/laboratory/scorm/api-wrapper-javascript/ to find the SCORM API and use this wrapper to deal with the slight differences in versions.

As for the course title - If you are running a specific course you already know the title of the course because you are currently running it.

Upvotes: 0

Related Questions