Forum Discussion

lorraineS's avatar
lorraineS
Community Member
2 days ago

storyline 360 - javascript to send custom cmi data scorm 2004? please?

Hi,

I'm in Storyline 360, 5/27 release publishing scorm 2004. Can anyone share with me a javascript to send my own variables of information via cmi data to the lms? I've tried a few things and nothing's working so I must be missing a basic concept somewhere. 

Thank you!

7 Replies

  • When you say nothing's working, can you provide more detail? What LMS are you using? Is the LMS sending an error? Have other courses sent similar info? Are you using the built-in LMS API methods of Storyline or creating your own? Is your browser's inspector throwing a console error? Is there an active project file we can troubleshoot or is this more a square-one question?

    • lorraineS's avatar
      lorraineS
      Community Member

      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. :)

      • Nedim's avatar
        Nedim
        Community 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.

  • lorraineS's avatar
    lorraineS
    Community Member

    AndrewBlemings-​  What Imean is nothing I've written in javascript is working. lol.  I get nothing in my LMS. I just need an example to work from of javascript that is known to work and send info via cmi info to an lms that will work with scorm 2004.

    • MateuszSzuter-e's avatar
      MateuszSzuter-e
      Community Member

      Well, you won't get an answer without providing of a lot of details.
      Just because there's a standard called scorm 2004, and you know the details of it, doesn't mean your lms handles these things as they are in the standard. That's quite a rabbit hole, a lot of LMSes are non-compliant with standards (that has been present for 20 years :D)

  • CarlFink1​ has provided a Lin to a page that should help. What errors are you getting in the console, it is possible the LMS API is not at the level you are expecting it to be.