Forum Discussion
storyline 360 - javascript to send custom cmi data scorm 2004? please?
This thread has JavaScript code: Use JavaScript to send data to LMS with SCORM 2004 4th edition | E-Learning Heroes
I've never tried to do this.
Yes, I saw that post. He has an object called SCORM2004_objAPI but I'm not sure where that object came from as it's not declared in the code. I think he means lmsAPI but not sure. That's why I'm asking for someone to send me some code that they know works. :)
- Nedim1 day agoCommunity Member
SCORM2004_objAPI is an internal JavaScript variable (object) found in scorm.js It is not an official part of the global SCORM standard, but rather Storyline's own custom wrapper.
What is the difference?
- Standard SCORM 2004 Object: According to the official ADL specification, a Learning Management System (LMS) must provide an object in the browser window named exactly API_1484_11. Every LMS creates this object.
- Storyline's SCORM2004_objAPI: When you launch a Storyline course, its internal scripts search for that official API_1484_11 object provided by the LMS. Once found, Storyline maps it to its own local variable named SCORM2004_objAPI console.log(SCORM2004_objAPI)
Instead of requiring you to write complex JavaScript to constantly search the browser window hierarchy (window.parent, window.opener) for the LMS API, Storyline does it automatically at launch. It is like a shortcut for developers inside Storyline. You can directly call SCORM2004_objAPI.SetValue() or use the wrapper function SCORM2004_CallSetValue() to send data to the LMS.
lorraineS wrote:
That's why I'm asking for someone to send me some code that they know works. :)
It is not that simple. You should provide more details and answer some of the basic questions asked by AndrewBlemings- and MateuszSzuter-e. You could also upload a simple story file showing what you have done so far, what you have accomplished, what has worked, and what has not. There are many members in the community who can help and may even learn something new from your experience. Following PhilMayor advice could also help you identify what might be wrong with your current setup. Another thing you could do is publish your project to SCORM Cloud and share an invitation link so we can check for possible errors. I think that could work too. However, it takes a lot of testing and going back and forth.