Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[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,016
    In the latest version (2.x) it doesn't come with a custom webgl template so that error should not be related to this asset.
     
  2. Who-am-I

    Who-am-I

    Joined:
    Mar 29, 2014
    Posts:
    73
    Hi @bdovaz

    I have purchased your fantastic plugin, everything is working fine. But,
    I am facing a problem while I go for exit from the Scorm package.


    Code (CSharp):
    1.         public void Exit()
    2.         {
    3.             int sessionTime = (int)((Time.time - startTime) * 1000);
    4.  
    5.             scormService.SetSessionTime(sessionTime);
    6.  
    7.             scormService.SetExitReason(ExitReason.Logout);
    8.  
    9.             scormService.Commit();
    10.         }
    I am using this code. Code is executing fine but the browser window does not close.

    Please help me

    Thank you
     
    Last edited: May 31, 2021
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    This code doesn't close a browser tab. My asset doesn't take any action regarding this.

    Search on Google for this:

    https://www.thesitewizard.com/javascripts/close-browser-tab-or-window.shtml#void
     
    Who-am-I likes this.
  4. Dr_Ben_Peters

    Dr_Ben_Peters

    Joined:
    Jan 19, 2021
    Posts:
    2
    Hi Bdovaz,

    I am fairly new at programing. I have developed a small educational game a published it on android. I wanted to upload it onto Blackboard LMS and came across your package. I have bought it but I don't know how to implement it so that I can build it as a SCORM package for blackboard. Do you have a tutorial that I could follow?

    I have already swapped the build over to WebGL

    Thanks!
     
  5. ssaxrpaul

    ssaxrpaul

    Joined:
    Mar 18, 2021
    Posts:
    3
    Hello, where can I add the value of succession? is that even possible instead of having an unkown result?
    upload_2021-7-13_12-5-55.png
     
  6. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    You have online docs: https://docs.google.com/document/d/1B3dysl1bG2-qo0IR50X4Tl-spP3iF_UkMTEOg3IOhPM/

    You also have a complete example scene of the available API.

    You have generic getters and setters for cases like this: https://docs.google.com/document/d/...P3iF_UkMTEOg3IOhPM/edit#heading=h.c5qxbgwmuec

    scormApi.SetValue("cmi.success_status", "passed");
     
  7. Dr_Ben_Peters

    Dr_Ben_Peters

    Joined:
    Jan 19, 2021
    Posts:
    2
    Hi bdovaz,

    Thank you so much for this asset. I created a blank project and went through the sample scene. In the end, the reason I couldn't even get started is that I was looking in the wrong place for the export options. I was expecting to find it in the SCORM API folder but it was in the resources folder. If anyone else is as much of a noob as me, that might help them!

    Now I have successfully added my game into the Blackboard Learn LMS.

    Thanks!
     
    bdovaz likes this.
  8. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    Yes, it was already documented:

    https://docs.google.com/document/d/...P3iF_UkMTEOg3IOhPM/mobilebasic#h.rery3shnk2qo
     
  9. cdauphin

    cdauphin

    Joined:
    Mar 16, 2018
    Posts:
    17
    Hello,

    If I understand correctly, this asset is made to communicate to every LMS from a webgl project and the Moodle API asset is made to communicate to Moodle LMS from any type of project ?

    I am asking this because I am looking for a way to communicate to a LMS (scorm cloud in the begining) from a VR app.

    Would that be possible ?

    Also, could a WebGL VR project possible ?

    Thanks.
     
  10. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    Yes to all.

    About WebGL VR I speak only for the Moodle API or Scorm API asset compatibility. I don't have experience on WebGL VR projects.

    But keep in mind that Moodle API asset only works for Moodle not for any LMS like Scorm API asset. In your case you will need Scorm API.
     
    cdauphin likes this.
  11. cdauphin

    cdauphin

    Joined:
    Mar 16, 2018
    Posts:
    17
    Thanks.

    Do you handle the diffèrent scorm 2004 editions or is that just Scorm 1.2 / Scorm 2004 ?
     
  12. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
  13. VirtualPierogi

    VirtualPierogi

    Joined:
    Sep 3, 2012
    Posts:
    54
    Hello bdovaz, ive bought your addon, and im currently making a course to test it on scorm cloud, im having a problem where score and status aren't reported to the lms but the set score function and commit in debug record are showing as true. What should i do?
    upload_2021-7-27_16-39-12.png
    upload_2021-7-27_16-38-7.png
     

    Attached Files:

  14. Capnkilo

    Capnkilo

    Joined:
    Jun 25, 2018
    Posts:
    4
    Hello! I bought the plugin today and I'm getting the identical error (the uncaught SyntaxError and uncaught ReferenceError) reported by psavalia. I'm not using any of my code; this is compiling the example code straight out of the package unchanged. I don't get any errors in building; these errors appear when trying to execute the lesson in the LMS. I get the same error in Scorm Cloud and in the Canvas LMS.

    Has anyone resolved the issue?

    Many thanks!
    Kilo
     
  15. Capnkilo

    Capnkilo

    Joined:
    Jun 25, 2018
    Posts:
    4
    Annnnd, I think I see the problem. There is a bug in Unity 2020.3.18f1 that requires you to disable compression in Player settings. It is mentioned (for a slightly earlier version of Unity) here: https://forum.unity.com/threads/unc...htmlscriptelement-script-onload-webgl.803967/

    The fix is to go to File|Build Settings... then Player Settings, Publishing Settings, Compression Format "Disabled".

    Alternatively, you can leave Compression Format as "Gzip" but also check "Decompression Fallback". Either will work (tested in Canvas LMS and Scorm Cloud).

    Hopefully this will help someone else!

    Regards,
    Kilo
     
    Last edited: Sep 24, 2021
    bdovaz likes this.
  16. ibouseck85

    ibouseck85

    Joined:
    Oct 25, 2021
    Posts:
    3
    Hello i'm new and i use your asset but i don't understand how to do for create script to send data to Moodle ex: score, i had import asset but i don't know where to beggin. I have read the online documentation
     
  17. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    You have a complete example scene of the available API.
     
  18. ibouseck85

    ibouseck85

    Joined:
    Oct 25, 2021
    Posts:
    3
    Yes I see but i don't know where I eimplement it (in what folder or files)
     
  19. ibouseck85

    ibouseck85

    Joined:
    Oct 25, 2021
    Posts:
    3
    I see the example but i want just know how to use it in what file or folders? please help
     
  20. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    I don't understand the question. What do you mean by "in what file or folders"? You need some basic C# skills in order to use this asset.
     
  21. mjamie

    mjamie

    Joined:
    Sep 4, 2017
    Posts:
    11
    Hi,

    Was wondering is it possible to implement Blackboards Leaderboard system using the API? The user would come back to same module and add points to the leaderboard each time they finish a new exercise in the module.
     
  22. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    If what you are talking about is an API specific to that particular LMS I doubt it is possible since Scorm is a standard that is LMS agnostic.
     
  23. parvez-sulemaan

    parvez-sulemaan

    Joined:
    Dec 9, 2015
    Posts:
    9
    Hello guy's
    I was implementing Scorm with unity3d.
    I want to know what is SuspendData
     
  24. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
  25. parvez-sulemaan

    parvez-sulemaan

    Joined:
    Dec 9, 2015
    Posts:
    9
    Hello Guy's

    Any scorm Developer here? who have worked on scorm with unity
    I am passing setting score...but it is not reflecting on LM
     
  26. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    Check your LMS debug or developer settings to see what is happening.
     
  27. tarmo-jussila

    tarmo-jussila

    Joined:
    Jun 4, 2015
    Posts:
    42
    I'm using Moodle as the LMS platform. I'm trying to make the default settings for the SCORM activity as good as possible so that once a SCORM activity is created, everything would work nicely out of the box. However, I'm having an issue with a specific setting that I would love to override in the SCORM package somehow (if it is possible).

    The issue seems to be related to the appearance setting called "Display course structure in player". By default that is set to the value "To the side", which displays an app module sidebar alongside the embedded Unity WebGL window. The sidebar is quite unnecessary and obstructs the view for the user. It can be hidden and can be even disabled in the activity appearance settings. However, I would like to automatically set this is either "Hidden" or "Disabled" in the SCORM activity settings so that this value does not need to be set each time a new activity is created.

    Is this possible?
    course-structure-player.png
    course-structure-player.png
     
  28. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    What you show is a specific setting of a specific LMS form (Moodle).

    Scorm is a standard that is independent of the LMS in which it is integrated and that is why it is obviously not going to know configurations like the one you mention. That configuration in one LMS is called in one way, in another one in another way and in some of them it does not exist.

    The Scorm API (I mean the protocol, not my asset) is what it is, there is nothing outside of what is defined that can be done.
     
  29. sbarkevich_unity

    sbarkevich_unity

    Joined:
    Sep 14, 2021
    Posts:
    2
    Hello,

    I am a teacher who is new to Unity and C#. I was excited to see a SCORM utility for Unity games because it is my hope to make some basic games that incorporate the content I teach and integrate them into our Learning Management System. I've created traditional SCORM content for our LMS with Adobe Captivate and with Camtaisia, but I really want to go the game route too.

    The problem I am running into is that because I am so new to C# and to Unity, I'm not exactly sure how to follow the directions provided for your SCORM API Asset...and I'm definitely not sure how to combine the SCORM packager with a game I've created using a game engine or game template.

    I am currently trying to figure out how to use your asset with Syntax Machine to make a vocabulary game that has scrambled the words in the definitions so the students have to rearrange them into the correct order. My hope is that I can set this up so that the player's game points are sent up to the LMS as the student's grade.

    Would you be able to help me better understand how to use your SCORM API?

    Best,
    Sandra
     
  30. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    Have you seen the example scene and the accompanying code? From that scene you should be able to understand how to use it.

    After watching the example scene and if you have any specific questions, don't hesitate to ask.
     
    sbarkevich_unity likes this.
  31. hsabo2905

    hsabo2905

    Joined:
    Feb 21, 2022
    Posts:
    2
    Hello. I just purchased your asset - thank you! There is nothing else like it out there. However, as someone who is not a programmer, I have no idea how to implement this. I added the asset to my scene. I saw your sample scene, but I do not know how to use it with my own scene. There is no custom panel or menu that helps me easily export the scorm file. Can you tell me what to do, if I have an scene, and I have imported your asset, to export the file and get my scorm zip file? Should I simply build to web GL? Thanks!
     
    sbarkevich_unity likes this.
  32. hsabo2905

    hsabo2905

    Joined:
    Feb 21, 2022
    Posts:
    2
    Nevermind. Figured it out. When you import the asset into your scene (Component>Packet Manager>Your Assets> Scorm API) go to the Project section. Find the Resources folder. Select "Scorm Publish Settings." Go to the Inspector section. Fill out each field as instructed on the help docs included with the file. Once that is set up, go to File> Build Settings. Select your scenes. Click on WebGL5. On the bottom left of this window click on Player Settings. Go to Player section> Publishing Settings. Either Leave "Gzip" AND check Decompression Fallback OR Select "Disabled" and uncheck Decompression Fallback. close this window, and hit build. Once its finished, you can go to the folder in which you specified you wanted your zip file. You can test it either on SCORM cloud or your LMS. I did this for Talent LMS and it worked!

    My new issue is figuring out how to prompt the system to know when the course is completed. Any help?
     
  33. jesklash

    jesklash

    Joined:
    Feb 8, 2019
    Posts:
    1
    Hey there, I'm trying to use the Example game in D2L (Brightspace) and just get it to initialize, I'm getting some errors that are a little over my head. I uploaded the WebGL game itself in a separate place and then imported the Scorm.zip into my course directly, this is the error I'm getting when I click Initialize:

    Is this an issue with the LMS blocking where I'm hosing the WebGL index/build/template?

    EDIT: Figured it out, thank you!
     
    Last edited: Mar 22, 2022
  34. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    It has to be a specific problem with that lms and the way it's hosting your content.

    It seems that you have a CORS problem.
     
  35. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Hi @bdovaz ,

    Thanks for making this plugin. We are currently using this in a project, but I'm having some issues with understanding how to send certain data types. Specifically the CMITime that is used for the Interactions.n.time parameter.

    For setting the session time, I'm using (int)Time.time * 1000. However, A) this is a CMITimeSpan, not a CMITime and B) this still doesn't work. How should one properly complete send the time at which an interaction is performed?

    EDIT: the answer is that CMITime value for the interactions seems to be a string in the format of HH:MM:SS (I believe...). Got a clue for this through a random buried thread somewhere, lol.

    Mike
     
    Last edited: Apr 28, 2022
    sbarkevich_unity and bdovaz like this.
  36. AndreaGiulianoK

    AndreaGiulianoK

    Joined:
    Mar 11, 2015
    Posts:
    6
    To format the latency value of the interactions you need to use two different formats according to the version of the scorm. "hh \: mm \: ss \ .ff" for version 1.2 and XML for version 2004.
    example code:

    Code (CSharp):
    1. System.TimeSpan timeSpan = System.TimeSpan.FromSeconds(time);
    2. if(version == Scorm.Version.Scorm_1_2){
    3.     latency = timeSpan.ToString(@"hh\:mm\:ss\.ff");
    4. }else{
    5.     latency = System.Xml.XmlConvert.ToString(timeSpan);
    6. }
    For all those who are interested in the implementation of any additional functionality I recommend using as a reference the guide on the scorm runtime environment where the types of values accepted for each value are explained in detail.
    If you publish the scrom on moodle or other LMS there may be some differences with "Scorm Cloud" which is always perfect in its functioning.

    This package is really great and allows easy use of the scorm with unity. Super Recommended!

    But it lacks one feature: managing interactions as objects, to save and read them from the LMS.
    Note: if you want the interactions reports created by the LMS (Moodle) to be consistent, you must save and read them progressively, otherwise the order of the answers will be inconsistent; moreover it is necessary to create a loop that assigns a unique progressive id to the interactions (from 0 to n) and that sets the interactions progressively from 0 to n otherwise there will be a response error from the LMS and all the interactions will not be saved.

    I have attached the RTE for v1.2 and 2004 and the extension script for the interactions.

    usage example:

    Code (CSharp):
    1.     void InteractionExample()
    2.     {
    3.         //Initialize Scorm Service
    4.         var _scormService = new ScormService();
    5.         _scormService.Initialize(Version.Scorm_1_2);
    6.         //Instantiate new Interaction object defined in the extension class
    7.         var interaction =  new Scorm.Interaction(0,"id",InteractionType.tf, "description",1);
    8.         //Set Interaction Response
    9.         interaction.SetResponse(new List<int>(){1,2,3}, true, 23, Version.Scorm_1_2);
    10.         //Send interaction to LMS with extended method
    11.         _scormService.SetInteraction(interaction);
    12.         //Commit data
    13.         _scormService.Commit();
    14.         //Close service
    15.         _scormService.Finish();
    16.     }
     

    Attached Files:

    bdovaz likes this.
  37. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Hi @AndreaGiulianoK,

    Many thanks for the reply - that helps with my issue.

    I was actually using the SCORM run-time reference guide (link), but found it a bit vague - especially in reference to the above 'CMITime'. I didn't see anything that gave anything like the detail you mentioned, therefore I assume I wasn't looking in the right place (facepalm). May I ask where I should've been looking for such information on the CMITime type?

    Kind regards,

    Mike

    P.S. I'm asking about where I should've been looking to make sure that I'm not being unecessarily reliant on others in the future, and to provide more answers than questions in future forum posts.
     
    Last edited: Jul 20, 2022
    bdovaz likes this.
  38. AndreaGiulianoK

    AndreaGiulianoK

    Joined:
    Mar 11, 2015
    Posts:
    6
    The guide found on that site is very vague and not technically exhaustive, useless for a developer.
    I had to search the internet for the original document that defines the SCORM protocol. unfortunately the site has been offline for many years (http://www.adlnet.org/) but the document is still found with a google search. knowing that this information is difficult to find, I've attached the pdf to my previous post.

    the time specification is indicated on page 59 of the pdf: "SCORM-12-RunTimeEnv.pdf"
     
    Tset_Tsyung likes this.
  39. sbarkevich_unity

    sbarkevich_unity

    Joined:
    Sep 14, 2021
    Posts:
    2
    Hi! For some reason, I never saw a notification that you'd replied to me so quickly. Sorry I didn't get back before now. I did try to review the example, but I think because I really know next to nothing about C# I'm not really sure what I'm looking at. If there is any way that I could get a more rudimentary explanation in non-coding terminology, I might better understand.

    However, I do see that there are quite a few posts after mine, and perhaps my answer is in one of them, so I'll be reading through them as well.

    Thank you again for your very quick response back when I posted my question.

    Best,
    Sandra
     
  40. mindsting

    mindsting

    Joined:
    Jul 1, 2014
    Posts:
    6
    I managed to get your pre-published 1.2 sample to work in our LMS just fine, but when I try to publish it myself from Unity as WebGL, I get the error shown in the screenshot. I also took a look at my zip file and noticed that my Build folder contains different files compared to what you have in the Build folder in your pre-published 1.2 sample. Am I doing something wrong when publishing in Unity for WebGL for this plugin? Are there specific Publishing settings in Player Settings that are ideal for this plug in? Are there other settings I need to check in the Inspector?

    Screenshot of error message:
    upload_2022-8-5_16-21-14.png

    My 1.2 SCORM zip has different files in the Build folder in your sample. This is what mine generated:

    upload_2022-8-5_16-19-57.png

    This is what is in the Build folder in your sample (yours all start with Publish. and the loader has a different name):
    upload_2022-8-5_16-26-49.png
    These were my WEBGL Publishing Settings:
    upload_2022-8-5_16-23-47.png
     
  41. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
  42. mindsting

    mindsting

    Joined:
    Jul 1, 2014
    Posts:
    6
    But the error happened when I launched it in my LMS using your sample that I published from Unity. Are there ideal WEBGL Publishing settings for this asset? Gzip? Data caching checked or unchecked? Decompression fallback checked or unchecked? What settings have you used or other used to get past this error?
     
  43. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    Something strange is happening on your side because it says that it is trying to load with the protocol file:// and not http(s)://.

    It has to be something in your browser, server configuration or project publishing options that the server doesn't like.

    But in any case, it has nothing to do with this asset since it doesn't do or require anything special. That is to say, you may have this problem with a Hello world in webgl.
     
    Last edited: Aug 8, 2022
  44. mindsting

    mindsting

    Joined:
    Jul 1, 2014
    Posts:
    6
    Thanks. So, the WEBGL publish settings don't matter for this asset. Good to know. Must be something weird going on with Unity. I'll reinstall it and keep troubleshooting. If I find a solution, I'll share it here.
     
    bdovaz likes this.
  45. AndreaGiulianoK

    AndreaGiulianoK

    Joined:
    Mar 11, 2015
    Posts:
    6
    the message appears when the page is opened locally and not on the internet through an LMS site. did you install an lms on a local apache server?
    You can try to upload the zip to scorm cloud: https://app.cloud.scorm.com/
    if it works it is not a problem attributable to unity, webgl setitngs or the scorm package but it is a problem with the LMS server you are using.
     
    bdovaz likes this.
  46. mindsting

    mindsting

    Joined:
    Jul 1, 2014
    Posts:
    6
    Quick update on my troubleshooting. I managed to get my published sample to work with no error using the 2019 version of Unity. The error only happens in the 2020 version so far. I'll skip to 2022 version and test that out. Main difference I noticed is the WebGL export of Unity changed after 2019. 2019 exports include a JSON file and 2020 exports do not. Very much a Unity WebGL publishing change causing this mess. Hopefully it's a simple matter of choosing the right Publishing Settings for 2022. If/when I determine the ideal settings (gzip, fallback. throw, etc.), I'll share the settings here.
     
    bdovaz likes this.
  47. mindsting

    mindsting

    Joined:
    Jul 1, 2014
    Posts:
    6
    Good news! I was able to get my published sample to run in my LMS from Unity 2022. The key thing to do is to check Decompression Fallback. Looking forward to making great learning games with Unity accessible to audiences via our LMS! Thanks to the developer for creating such a useful asset.
    upload_2022-8-9_11-10-16.png
     
    bdovaz and AndreaGiulianoK like this.
  48. dfusion

    dfusion

    Joined:
    Feb 9, 2020
    Posts:
    2
    Hello @bdovaz !

    Thank you for the great asset. I'm fairly new to SCORM development, and this has been so helpful!

    My question is: Is it possible to share data between different SCOs? I'm saving and loading some simple strings to cmi.suspend_data, and that works inside of 1 SCO, but I would like to share that data to a different SCO in the same course. Is this possible using your plugin?

    Thank you!
     
  49. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,016
    What you are asking is not related to my asset but to the Scorm standard and as far as I understand, it is not possible.

    This is the official explanation of that field:

    What you would need would be an API of your own specific LMS that would allow you to get the information you need but outside of the Scorm standard.
     
  50. JCIPL

    JCIPL

    Joined:
    Jul 13, 2018
    Posts:
    14
    Hello @bdovaz

    LMS Error: We are getting errors in 2021.3.8f LTS using Scrom API Version 2.3 " Unable to load file Build/webglbuild.framework.js.gz! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)" While uploading the Scorm package in LMS.

    WebGL Issue: While hosting WebGL Build in server we are getting this error " Unable to parse Build/webglbuild.framework.js.gz! This can happen if build compression was enabled but the web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: gzip" present. Check browser Console and Devtools Network tab to debug." we have also tested using local server "Servez" in this case it's Screenshot LMS Scrom Error.png Screenshot WebGL Error.png working.
    Please find the attachments for error snapshots