Search Unity

[RELEASED] Scorm 1.2 / 2004 API

Discussion in 'Assets and Asset Store' started by bdovaz, Jan 20, 2016.

  1. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051

    Scorm 1.2 and 2004 integration. It implements all common and most used features available.

    Asset Store link


    https://assetstore.unity.com/packages/tools/integration/scorm-api-53523

    Online documentation


    https://docs.google.com/document/d/1B3dysl1bG2-qo0IR50X4Tl-spP3iF_UkMTEOg3IOhPM/

    Examples to try it out

    Scorm 1.2: https://www.dropbox.com/s/k5rttyxtegw1wf2/1_2.zip?dl=0
    Scorm 2004: https://www.dropbox.com/s/p63wftcnwb48z9g/2004.zip?dl=0

    Supported Platforms


    Scorm packages run on LMS that run on Web Browsers.

    • WebGL support.
    • WebPlayer support has been removed. The last Unity compatible version was 5.3. If you still need it I can share you the last 1.x version of the plugin.

    Features
    • Scorm 1.2 and Scorm 2004 support. Implemented 1.2/2004 equivalent API, If you need something specific of Scorm 2004 that is not available in 1.2, feel free to ask and you will have it as soon as possible.
    • Builds Scorm packages automatically. You get a “*.zip” with your Scorm package ready to upload to a LMS.

    • Full object oriented API (you don’t deserialize anything, it’s already done it for you).

    • C# Source code included.
    • Documentation available.

    • Easy integration to your Unity project.
    • Well organized and structured code.

    • Provides a in editor implementation for testing purposes.
    • Examples available. Includes an example to test the full API with a console view.




     
    Last edited: Apr 3, 2020
  2. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Bump! It has been approved
     
  3. KeithT

    KeithT

    Joined:
    Nov 23, 2011
    Posts:
    83
    Bought this a couple of days ago and whilst it seems to make a SCORM wrapper that will load into an LMS it does not return any data. Even a straight build of the API scene loaded into scormcloud does not work, all SCORM data you ask for is returned "undefined".

    I thought this might be scormcloud, so tried it in a client's full moodle installation and got the same result.

    Have you tested that this can actually access data from the LMS?
     
  4. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    I don't understand. I have opened a project with the asset in Unity 5.3.3f1 and published in UnityWebGL using Scorm 1.2 and creating a Zip (with the asset publishing capabilities). Then I have uploaded to ScormCloud, I've launched the course and the test scene provided with the asset works with no problems (no 'undefined').

    You are the first one having problems (I have more sales and more testing users in my Scorm Cloud test course with no feedback with errors or weird behaviour).

    I need more information and a test project to check it out.

    Edit: I think I know what it's happening.

    Are you trying Scorm 2004? You need to change two things to make it work.

    Go to asset documentation and read "Getting Started" and "Using included WebGL template" section (I think that you haven't changed Scorm version in step 3 and you have it with 1.2 so it's using 1.2 API in 2004).
     
    Last edited: Mar 2, 2016
  5. KeithT

    KeithT

    Joined:
    Nov 23, 2011
    Posts:
    83
    Hi,

    Thanks for responding so quickly.
    It was not 2004 instead of 1.2 but it was that field in the template. It was blank.
    Putting in 1.2 means it works on scormcloud now.
    Thanks again.

    KeithT
     
  6. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    I'm glad that you finally sorted it out!

    Please make a review on the asset store, thanks!
     
  7. uprashanth

    uprashanth

    Joined:
    May 24, 2014
    Posts:
    99
    Hi I just purchased your asset. We make modules as learning games, so if I implement scorm and do a standalone PC build will it work (Will it work on PC standalone apart from WebGL build) ?
     
  8. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    No but no because my asset doesn't support it, no because it's no possible by definition.

    It uses Javascript to communicate with the LMS once it's uploaded to the LMS and launched from there.

    Any Scorm package behaviour is this because it's the standard way and the only way that works on any LMS.

    How would be possible to do this from an exe without any LMS context? To do that you depend on the LMS you are targeting if it has a web Service or some way to communicate externally. It's not the standard way and this is not supported by all LMS.
     
  9. uprashanth

    uprashanth

    Joined:
    May 24, 2014
    Posts:
    99
    Thank you so much for your response. I'm happy atleast your asset supports webGL. if I have any doubts I will ask you here.
     
  10. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Of course, feel free to ask anything you want.
     
  11. NYU_InteractiveDev

    NYU_InteractiveDev

    Joined:
    Jan 15, 2016
    Posts:
    1
    Hello. Just wondering if you will be implementing Tin Can API. Also, any chance that this will work with mobile?
     
  12. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Tin Can API is a lot of work and in case I do it it will be a totally different asset.

    Mobile support doesn't depend on my asset, depends on LMS if it has a REST API or something like that to communicate externally with the LMS. It would be a LMS dependant implementation. Scorm it's a standard independent from LMS.
     
  13. Lucas7CL

    Lucas7CL

    Joined:
    Sep 28, 2015
    Posts:
    7
    Hi, just tryied the online example but is not available: "
    The course you are trying to launch is not currently available. Contact the person who invited you for more details."
     
  14. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    I've tried now and I don't have any problems, please try it again.
     
  15. 68chase

    68chase

    Joined:
    Oct 27, 2014
    Posts:
    9
    Hi - I wanted to use the included API example scene to publish a sco and test in on my lms. There are errors not allowing it to publish. I don't think I changed anything. Did an update to unity break something? upload_2016-8-13_18-12-45.png
     
  16. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    "WebGLTemplates" is a Unity "special" folder like "StreamingAssets", "Resources"... It needs to be in the root folder: "Assets/WebGLTemplates".

    If it's in another folder hierarchy it "thinks" that "*.js" files are JavaScript/UnityScript files and that's because you have errors.
     
  17. 68chase

    68chase

    Joined:
    Oct 27, 2014
    Posts:
    9
    Got It...Thanks
     
  18. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi,

    SCORM WenGL Template not shown in player settings. There is no error shown up.
     

    Attached Files:

  19. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    We fixed by email, the problem was the same as 68chase.

    All this is already documented, please read the documentation carefully.
     
  20. profwar

    profwar

    Joined:
    Sep 1, 2016
    Posts:
    7
    Hello,

    I have done the documentation procedure and no Scorm template appeared. Could you help me?
    P.S.: I am using Unity Personal v5.4.0.
     

    Attached Files:

  21. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    You have unzipped the template wrong. There has to be a folder between "Assets/WebGLTemplates" and the contents of the template. Example:

    - Assets
    --- WebGLTemplates
    ------ ScormTemplate
    --------- js
    --------- TemplateData
     
    Last edited: Sep 2, 2016
  22. profwar

    profwar

    Joined:
    Sep 1, 2016
    Posts:
    7
    Did you see the picture? "WebGLTemplates" is the folder that you mention. Isn´t it?
     
  23. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Yes sorry, I have edited my answer.
     
  24. profwar

    profwar

    Joined:
    Sep 1, 2016
    Posts:
    7
    Hello, again.

    Just to say that it worked fine. Thank you.
     
  25. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    I'm glad to hear that.
     
  26. profwar

    profwar

    Joined:
    Sep 1, 2016
    Posts:
    7
    Hi,

    another question: How can I integrate with others projects already made? What assets I have to import? Or integration is just possible when I start a new project with SCORM package since the beginning?
     
  27. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    It can be integrated to any existing project of course.

    You need to import the entire package.

    The unique different step it's when you use my WebGLTemplate or you have an existing template, there are some steps that chsnge but it's also documented.
     
  28. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Hi, I'm very keen to purchase your asset. Can you upload an example SCORM package generated by your asset so that I can test its compatibility with my blackboard lms. Thanks.
     
  29. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    It's ok, I explored and managed to get some basic functionality with the SCORM JS wrapper. I want to try TinCan now.
     
  30. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    If you are still interested feel free to contact me.
     
  31. yopunky

    yopunky

    Joined:
    Sep 1, 2014
    Posts:
    9
    Hi, I've been using the Scorm API for a few days and I've successfully built and uploaded an example to Scorm Cloud. I've tried to implement the Exit Method using the following code:

    Code (CSharp):
    1. exitButton.onClick.AddListener(() => {ScormAPI.Instance.Exit(ScormAPI.ExitReason.Logout);});
    However when it runs in the LMS or just in the browser it returns a Javascript error Can't find variable ScormProcessFinish (which is on line 629 of scorm.js). I can't find any other reference to ScormProcessFinish in the code or scripts. Perhaps I need to add it to the index.html file? Or perhaps I'm calling this method incorrectly? (However to get to line 629 the reset of the function Scorm.prototype.exit would have need to have been executed. Any advice appreciated.

    Screen Shot 2016-09-23 at 6.13.57 PM.png
     
  32. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Yes, there is a bug with exit method. I'm surprised that no one has notice that yet. I'll fix it and upload an update to the asset store.

    To fix it you need to:

    "scorm.js" file:

    Remove this line: "ScormProcessFinish();"

    You need to do:

    ScormAPI.Instance.Exit(ScormAPI.ExitReason.Logout);
    ScormAPI.Instance.Finish();
     
  33. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    It has been accepted a new version.

    1.1 Release Notes

    - Objectives support. Now you can set multiple scores and states.
    - WebPlayer support as requested by some users.
    - Fixed a bug related with Exit method.
     
    yopunky likes this.
  34. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    How can a mobile Unity app access an LMS?

    Thanks for any help.
     
  35. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    That is not something that you can achieve with my asset because it's the LMS that has to provide a web service or similar feature to access it externally.
     
  36. yopunky

    yopunky

    Joined:
    Sep 1, 2014
    Posts:
    9
    If anyone is interested I have a very early test version - like pre-beta (or even gamma) version of my first Unity / Scorm 2004 compliant / WebGL / WebGLMovieTextures / Animation on ScormCloud at the public link below:

    Note: If you run this module and then again after I make a change it sometimes crashes out with the not enough WebGL Memory issue - no amount of memory allocation seems to fix this issue - and I've adjusted the memory up and down several times. The only thing that seems to solve it is clearing the browser cache. I think that it has something to do with the way data is cached by WebGL and not Unity as it doesn't happen on all browsers and only happens some time but mainly after I upload a new build. So if you are interested - have a go at clearing your cache before running the course. I will attempt to delete or modify this posting as and when the course changes.

    Anyway if you do get it to work let me know what you think - good or bad - perhaps you might even learn something!

    https://cloud.scorm.com/sc/Invitati...tationId=7ed86c2d-00e5-4996-943b-79bbdf4cbfa6
     
  37. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Hi N3uRo, I just had the same issue as the others because your package doesn't contain the required "ScormTemplate" folder and this folder is not mentioned in your documentation. Now I found the thread above:

    - Assets
    --- WebGLTemplates
    ------ ScormTemplate
    --------- js
    --------- TemplateData

    it is working as it should.
     
  38. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Yes but it's intentional because in some old Unity version (that was not WebGL) JavaScript scripts of WebGL template thinks that are UnityScript files because ends with *.js and gets multiple compiler errors.

    That's why they are in zip files so you decide what version to use WebPlayer (old) or WebGL (current).

    Also I don't understand why you say that is not mentioned in docs. It's in getting started section and always has been there.
     
  39. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Hi N3uRo

    In both the online and package "Getting Started" doco, the creation of the ScormTemplate folder is not specified, unless I missed something.

    - Assets
    --- WebGLTemplates
    ------ ScormTemplate
    --------- js
    --------- TemplateData
     
  40. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Ok, if you think that it's necessary I will add it.

    Thanks for the feedback.
     
  41. simchris

    simchris

    Joined:
    Feb 16, 2016
    Posts:
    1
    Hi, how can I contact you for support? Do you have an email or skype?
    I am developing a game for a big company and I have bought your plugin.

    i get a "Scorm is not defined error" on the javascript consoler on my browser whenever I click the Init button on your example.
     
    Last edited: May 17, 2017
  42. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    In Asset Store page you have a "Support E-mail" link: https://www.assetstore.unity3d.com/en/#!/content/53523

    If you send me an email please, provide the project or a link to test it so I can see what is the problem. I'm mostly sure that it's a template configuration error on your side.
     
  43. Deviarc

    Deviarc

    Joined:
    Sep 4, 2014
    Posts:
    24
    Hey, I'm using your package. Ty a lot for doing it!
    I followed your tutorial setting up the Template, but when I try to run it with Reload Scorm 1.2 Player, I'm getting a error on something that it only displays the UNITY_WEBGL_LOADER_GLUE, I'm using your WebGL template.
    Do you prefer to talk over here or by email?
     
  44. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    In 5.6 Unity has broken WebGL templates:

    https://forum.unity3d.com/threads/breaking-changes-in-5-6.470183/

    In order to fix it you need to:

    1. Copy a Unity default template from:

    {UNITY_PATH}\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\WebGLTemplates

    To: "Assets/WebGLTemplates"

    2. Apply the instructions given on my docs ("Adding it to your own WebGL/WebPlayer template" section):

    https://docs.google.com/document/d/...3iF_UkMTEOg3IOhPM/edit#heading=h.kjtpzank4l0h

    If you have any other error I will help you resolving it.
     
  45. Deviarc

    Deviarc

    Joined:
    Sep 4, 2014
    Posts:
    24
    Ok, it look like it's working now.
    I builded your example file and tested it with the Reload Scorm Player, I get the app to load inside the environment, but it's dont appear to be working. For example, I'm pressing the Init button, but I don't get any feedback at all. Is this the default behavior or the 5.6 broke more stuff?
     
  46. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Have you tried to press F12 to open developer tools and see if there are errors in console? Chances are that in the template it has not been correctly replaced Scorm version parameter.

    You could also been affected by this Unity bug:

    https://issuetracker.unity3d.com/issues/template-custom-tag-not-being-replaced-at-build-time
     
  47. Deviarc

    Deviarc

    Joined:
    Sep 4, 2014
    Posts:
    24

    Uhn, checking the WebConsole I'm getting this error:

    SyntaxError: expected expression, got ')'

    It point's me to this line in the index.html:
    var scorm = new Scorm(Scorm.SCORM_%UNITY_CUSTOM_SCORM_VERSION%);

    I'm also getting a error from the LMSMain, but it's related with character encoding, but this is nothing I should worry about I think.
    LMSMain.html error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

    After this two erros I get some warning about asm.js beign compiled successufully.

    Anything to help?
     
  48. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    You have confirmed that you are affected with that bug.

    I don't know if it's fixed in 5.6.1.

    You can workaround it by setting it manually in template:

    var scorm = new Scorm("Scorm 1.2");

    Or:

    var scorm = new Scorm("Scorm 2004");

    The encoding error it seems that is because Unity doesn't set a default encoding in it's template. You can add it yourself:

    https://www.w3schools.com/tags/att_meta_charset.asp
     
    Last edited: Jun 10, 2017
  49. Deviarc

    Deviarc

    Joined:
    Sep 4, 2014
    Posts:
    24
    Alright, following this I got the example scene to build and initialized inside the Scorm Reload Player.
    When I press the Initialize it print's on the console. When I try to get the Learner Name or anything else I get a undefined valor, is this the default behavior for the example scene?
     
  50. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    It should print a value, not "undefined". Do you have the scorm version value correctly set as I said? Do you see any errors on console?

    You can send me your WebGL project in a zip and I can check it out.