Can I use Javascript to write and get a custom field in an LMS table via SCORM API or AICC?

Jul 27, 2015

I have an LMS (Expertus) that does not track content completion (just class completion, and a class can have multiple pieces of content). The LMS database does have custom fields in its tables, and I can write custom reports to pull those fields out of the tables.

How do I use Articulate to write to those custom fields? I presume it has to be through the SCORM API, maybe using objAPI.LMSSetValue?

I just don't know how to do that...

Thanks!

7 Replies
George Ganahl

I have a button set to run JavaScript when a user clicks on it.

The javascript is:

blnSuccess = objAPI.LMSSetValue(“cmi.core.student_name”,"Bubba Smith");
blnSuccess = objAPI.LMSCommit(“”);

based on what I see at http://scorm.com/scorm-explained/technical-scorm/scorm-12-overview-for-developers/

When I run my class from the LMS with debug turned on, I see other commands being sent through the API, such as:

235:Tue Jul 28 2015 08:51:47 GMT-0400 (Eastern Daylight Time) - SCORM_CallLMSSetValue strElement=cmi.core.session_time, strValue=0000:00:05.39

However, when I click the button I do not see anything similar in the debug window.

I also have JavaScript set to run when the user clicks Next:

StudentName = objAPI.LMSGetValue(“cmi.core.student_name”);

I don't see anything in the Debug window for that Javascript, either.

I am using SCORM 1.2.

 

Ashley Terwilliger-Pollard

Hi George,

I'm not equipped to assist with Javascript, but I did want to share our documented best practices here, and that you may also want to look at testing this at SCORM Cloud vs. in your LMS, as it's an industry standard for testing SCORM content. This article will walk you through testing at SCORM Cloud. Additionally, are you using the LMS debug mode described here or one within your LMS? 

George Ganahl

Hi, Ashley,

I did go through the best practices you linked as part of my attempts. they don't say anything about how to call the SCORM API with JavaScript, so weren't much help.

I did turn on the debug mode as described in the article you linked. That is the debug session I copied and pasted from above.

The debug window comes up when running on SCORM Cloud, but it does not show anything being sent to the API from my JavaScript, either.

I need a specific example of how to send the SCORM API commands from Articulate Storyline 2 content running on a SCORM 1.2 or SCORM 2004 2nd Edition compliant LMS.

Thanks!

Kelly Kung

Hi George,

Sorry, writing to or reading from a custom field using the API is not possible.  I mainly deal with SCORM and theres very little that you can read from the LMS.  Basically the things you can read from the LMS are the username or the user ID. Then theres the Suspend Data that writes to the LMS, this is used for custom variables or states that are used within Storyline.  This too is a dead end as Articulate compresses/encrypts it so even if you go to the database level, it is not human readable.   Maybe there is a solution for this but it sounds like an extremely high level customization.

George Ganahl

Thanks, Kelly.

Do you have an example of what to put into a trigger for JavaScript that would get the Username? I can't even get the trigger to send anything at all to the LMS/SCORM API, as far as I can tell from the debug window. I see other commands being sent by Articulate, but nothing for my Javascript trigger.

This discussion is closed. You can start a new discussion or contact Articulate Support.