Search Unity

[RELEASED] Scorm 1.2 / 2004 API

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

  1. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    Hello. I am enjoying this plug-in so far, but ran into a build issue when sharing a project with a colleague using Unity Collaborate. I was making successful zipped SCORM builds earlier, but after a recent commit from my partner, I notice that I get a build error, which results in a working WebGL build, but no SCORM zip file.

    The error message reads:
    DirectoryNotFoundException: Could not find a part of the path "C:\Users\DELL\Documents\ <edited> \DotNetZip-hkneb2jk.tmp".

    I recognize that this path does not exist on my computer, it belongs to my partner who I am sharing the Unity Collaborate project with. I'm guessing this path must be getting stored and shared when we publish / update our project.

    This is preventing me from making builds with the plugin. Any idea how I can avoid this?
     
  2. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    Ok, figured it out... I spent a couple of seconds poking around and found the ScormPublishSettings file in the resources folder, which is where this value gets set.
     
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    That's right.

    You also have "ScormPostprocessor.cs" script that handle's the *.zip creation with that data.
     
  4. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    Thanks for the quick reply! I'm new to SCORM, so I may have a few questions to ask.

    Right now I'm working on a lesson that has multiple 'parts' that I want to track. I see that I can store progress for each inside of a ObjectiveData object, which I can send to and from the LMS.

    But the ObjectiveData API only has 'get' accessors, so the only way to store values is on instantiation. If the user returns to the same 'objective', and I need to update the status or score of the objective, am I expected to instantiate and run SetObjective on a new (duplicate) objective with the same ID? Does the LMS know to overwrite duplicate objectives with the same ID?

    I can edit ObjectiveData code to allow write access, but curious, is there a good reason to restrict write access to ObjectiveData properties?

    (using SCORM ver 1.2, using Docebo for LMS )
     
  5. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    So I did modify the ObjectiveData class to allow the properties to be written to. I wrote a quick test that creates some dummy ObjectiveData objects, and has some UI controls to modify the properties and then Get / Set the ObjectiveData objects back and forth to/from the LMS.

    Using this test, it appears that some of the properties of the ObjectiveData do consistently get set in the LMS, and some consistently do not. If I change the RawScore value, commit it, and then get it back, the returned value is the same as the one I set. But If I do this for Description, I always get an empty string when I get the ObjectiveData back from the LMS.

    Here are the properties that return the same after getting committed to the LMS:
    Id
    RawScore
    SuccessStatus

    Here are the properties that do not return the same after getting committed to the LMS:
    ProgressMeasure
    Description
    CompletionStatus

    I experienced this same result in both Docebo and SCORM Cloud. I'm using Unity 2017.3, platform: WebGL, SCORM ver 1.2.
     
  6. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Are you able to see some debug info of the SCORM track? Almost all LMS have a way to see a log of all the LMSSetValue and LMSGetValue calls.

    We need first to see where the problem is.
     
  7. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    Here's is a log from SCORM Cloud test:
    https://cloud.scorm.com/sc/guest/Vi...3758&courseTitle=SCORM+Test+-+22+-+Objectives

    - At the beginning of the log, there are 8 'Objectives' that get pulled from the LMS.
    - Then I set new values for each property of the the first Objective (0) and Set / Commit back to the server
    - Then I retrieve all 8 'Objectives' back from the server to see if my changes persist


    It appears that the API call to scormService.SetObjective() does not result in certain ObjectiveData properties getting set. In the Debug link I provided, I can see that there is no SetValue call that relates to these ObjectiveData proprieties
    • ProgressMeasure
    • Description
    • CompletionStatus
     
  8. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Sorry I didn't read a very important thing you said. You are using SCORM 1.2.

    If you see the API differences between 1.2 and 2004 you will see that in 1.2 that three values don't exist.

    https://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/

    I should make it clear in docs.
     
  9. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    Ok, I see whats happening here... I was getting errors when making builds as ver 2004, telling me that my objectives.n.success_status value "not attempted" was invalid. That makes sense now that I'm looking at this reference, because I see that in ver 2004, objectives.n.success_status doesn't allow "not attempted" as an option.

    Now that I know this, I can know to avoid setting these values.
     
  10. eshahsavand

    eshahsavand

    Joined:
    Sep 30, 2018
    Posts:
    2
    Hi
    Sorry, I have bought the plug-in yesterday, but looking at the documents I really don't understand how to use this plug-in. Is there any step-by-step instruction available?
    Thank you
     
  11. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    The API it's really easy to use and you have also many examples. If you have specific questions you can ask them here.

    I suppose that you refer to the deploy process, I mean uploading it to a LMS. Do you know what LMS are you targeting? Do you have experience with it? I can help you with Moodle. In Moodle you need to create a course, inside of it an activity of type Scorm and upload the generated *.zip.
     
  12. Luke_Fenturi

    Luke_Fenturi

    Joined:
    Jul 18, 2018
    Posts:
    21
    A video showing it being imported and set up in an existing scene then uploading it to something like scorm cloud would be the best way of showing how to impliment this API as it took me several days to work it out.
     
    fimam and eshahsavand like this.
  13. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Ok thanks I will consider writing a more precise steps on how to get started.
     
    eshahsavand likes this.
  14. eshahsavand

    eshahsavand

    Joined:
    Sep 30, 2018
    Posts:
    2
    Thank you very much Luke and N3uRo, I agree that a step by step would be great for beginners like myself :), we use a bespoke LMS but I believe if I can generate a scorm package from a unity scene/experience, we should be able to use it then. Thank you again for the useful app.
    Kind regards
     
    Juanda31 likes this.
  15. Luke_Fenturi

    Luke_Fenturi

    Joined:
    Jul 18, 2018
    Posts:
    21
    It can indeed be used for anything that accepts scorm with a little tweeking and a step by step would help users discover that. That said, this is an excellent tool, thank you for developing it!
     
  16. iwhiziq863

    iwhiziq863

    Joined:
    Nov 26, 2018
    Posts:
    3
    Hi There,

    My team have been experiencing a problem with your package. The problem is that every time we try to build, the zipping process gets ignored. This is a random problem. Sometimes it will build, most of the time it won't (we have to try like 5 times or more). This is a recent problem we have been experiencing.

    However, the zipping process on one of our teammates machine works completely fine (OS X 10.9.5).

    There are no error logs produced.

    The machines we are using are OS X 10.9.5, OS X 10.14.1, and Windows 10.
     
  17. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    You are the first one having problems with this. That logic it's triggered by "ScormPostprocessor.cs" script. In that script the only condition that can have that behaviour is having ScormPublishSettings "enabled" parameter being false. I suppose that you have it set to "true" in all machines.

    As a final workaround you could comment "if (!settings.Enabled) return;" line on "ScormPostprocessor.cs" script.
     
  18. infoegroup

    infoegroup

    Joined:
    Nov 23, 2018
    Posts:
    1
    Hello N3uRo

    i have been digging around everything related with your asset.

    I have made a few tests and it works fine, I was wondering if you know any way it could works for mobiles, I tested the sample scene and it works just fine in browser but in mobile it didnt show up correcltly. It is not responsive and shows an alert at the beginning for webgl compatibility through mobile devices.

    I know it is not about your asset but maybe you can help me a little bit with that.
     
  19. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    As you said it's not related to my asset but I will help you. Unity WebGL is not guaranteed to work on mobile devices so Unity shows an alert to reflect this but it can be disabled. In the following link you have many answers of people having the same problem as you:

    https://answers.unity.com/questions/1339261/unity-webgl-disable-mobile-warning.html

    Your layout responsive problems has to do with Unity's default templates that are not responsive by default, you need to tweak them.
     
  20. iwhiziq863

    iwhiziq863

    Joined:
    Nov 26, 2018
    Posts:
    3
    Thank you for the reply. I have no experience with Scorm (I've just started using it recently). It was working perfectly fine until recently. I will try your recommendation and if that does not help, I will try to isolate the problem further and continue testing.

    Regards.
     
  21. iwhiziq863

    iwhiziq863

    Joined:
    Nov 26, 2018
    Posts:
    3
    I've been testing today and have successfully created my first Scorm build. I think my other teammates have been doing something incorrectly. I will test out on their machines again later today and see if it works correctly.

    Regards.
     
  22. PanayotisLampitsakis

    PanayotisLampitsakis

    Joined:
    Nov 1, 2018
    Posts:
    1
    Is there a tutorial like a video that shows implementation in detail
     
    fimam likes this.
  23. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    There is no video, as I answered in a PM you have online docs with many information and a complete example scene and scripts included in the package.
     
  24. sebitunity

    sebitunity

    Joined:
    Jul 16, 2018
    Posts:
    3
    Hi, we a have product written with UNİTY 4x and we use Scorm 1.2. Now, we are planning to update this product with Unity 2018 but we should use Scorm 1.2. And product will mostly work on Web-GL. Do yo have any idea about running Scorm 1.2 on Unity 2018? Is it supported?

    Thank you!
     
  25. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Of course there is no problem with that. Scorm version has nothing to do with Unity version it can run in any Unity version starting with 5.6.0
     
  26. sebitunity

    sebitunity

    Joined:
    Jul 16, 2018
    Posts:
    3
    Thanks for quick reply. What about the older versions? I mean before Unity 5.6? Because our product is in Unity 4x right now and Scorm 1.2 still works except webplayer and IOS platforms.
     
  27. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    But as I understand if you upgrade your project you will upgrade the editor at least to 5.6 that it's more than 2 years old. You also have said that you are thinking of upgrading to a 2018.x version.

    It doesn't make sense to update a 4.x project to a version older than 5.6 nowadays.
     
  28. sebitunity

    sebitunity

    Joined:
    Jul 16, 2018
    Posts:
    3
    Sorry for misunderstanding.. I am asking that what is there any known issues with Scorm API and Unity versions older 5.6?
     
  29. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Nowadays no one starts a new project or updates to a version prior to 5.6 so I don't know maybe I use APIs that weren't available in pre 5.6..

    My recomendation is that if you are going to make an effort to update a 4.x project, do it at least to 5.6.x version because it's the newest in the 5.x branch. Unity 5.6.6 it's from May.

    Here you can see how old is each 5.x version:

    https://unity3d.com/es/get-unity/download/archive

    If you want to update to a version pre 5.6 I can help you fixing the asset in order to work on a Unity version between 5.3.x (my asset was originally compatible with this version when WebPlayer was available) and 5.6.x
     
  30. SteveDClarke

    SteveDClarke

    Joined:
    Aug 15, 2017
    Posts:
    6
    Hi. Can anyone tell me if this works on 2018.2 or preferably 2018.3?

    It doesn't appear that the build post processor is doing anything, (made a WebGL build of the example). I hope I'm just doing something wrong. I've been asked to integrate a prettymuch complete 2018.3 project with the client's LMS.
     
  31. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    I've tried in 2018.3.1f1 (latest version) and it works correctly. I see the generated zip.

    Have you added a Debug.Log inside that script to check if it's getting called? As you can see in that script the only two conditions that could not trigger it are that the target platform it's not WebGL or that ScormSettings "enabled" property is false.

    I have to update the asset so in 2018.3.x uses "IPostprocessBuildWithReport" instead of deprecated "IPostprocessBuild" but it should still work with the deprecated one.

    Please give me updates on this so I can discard a bug (from Unity or mine) on that version.
     
  32. SteveDClarke

    SteveDClarke

    Joined:
    Aug 15, 2017
    Posts:
    6

    So I came back to this fresh in the morning and realized that I missed the ScormPublishSettings scriptable object, (even though it is front and center in the doc, so I have zero excuse).

    Everything works perfectly and I got a test version of the app up running.

    Thank you so much for this asset. It has 100% saved my butt.
     
  33. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    I'm glad everything's been sorted out.
     
  34. DZeb

    DZeb

    Joined:
    Sep 17, 2015
    Posts:
    10
    Hello, great asset, everything works great out of the box. Just a little detail I could use your help to sort out.
    Shouldn't the GetCommentsFromLms() get the <adlcp:datafromlms> field from the imsmanifest.xml? Because I can't seem to be able to get it, maybe it refers to something else.
     
  35. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Honestly there is not much information on the internet about this specific field, it doesn't seem to be used much.

    As far as I understand it is a field that comes from the LMS (for example: Moodle) so the LMS has to support it and establish it (through a form I suppose).

    The official documentation does not say much either. The following sentence relates to Scorm 1.2:

    https://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/#section-2
     
  36. DZeb

    DZeb

    Joined:
    Sep 17, 2015
    Posts:
    10
    Yeah, besides that and this question with a rather useful answer I didn't find much either. Well I ended up finding a workaround yesterday so I don't need to use it after all, I just left the link in case someone else needs to take a shot at it. Thanks for the fast response.
     
  37. mKleinIQ

    mKleinIQ

    Joined:
    May 16, 2017
    Posts:
    10
    Is it possible to write scores to an LMS through an exe file? Or must it be webgl?
     
  38. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
  39. mKleinIQ

    mKleinIQ

    Joined:
    May 16, 2017
    Posts:
    10
  40. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    That package it's only for Moodle as it's uses Moodle specific API.

    If there was an API for all LMS I would use it. That "API" it's SCORM but the downside is that it's web only.
     
    mKleinIQ likes this.
  41. mKleinIQ

    mKleinIQ

    Joined:
    May 16, 2017
    Posts:
    10
    Oh ok, thanks.
     
  42. mic474

    mic474

    Joined:
    May 7, 2017
    Posts:
    4
    Where do I put the 'geting started' code? How do you easily integrate it in an existing unity project?
     
  43. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    In a MonoBehaviour scripts Awake or Start method for example.

    See demo scene.
     
  44. danflores5

    danflores5

    Joined:
    Dec 13, 2017
    Posts:
    3
    Hi, i want to create a course with SCORM in Unity 5.6 and WEBGL. Can someone help how to integrate in my project, thanks
     
  45. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    I have replied to your PM.
     
  46. Digi001

    Digi001

    Joined:
    May 29, 2015
    Posts:
    5
    Hi, is this package unity 2018 compatible? I get a host of errors when I import.
     
  47. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Errors about NUnit? Delete "Tests" folder.

    If not post me a screenshot of that errors.

    Thanks.
     
  48. Digi001

    Digi001

    Joined:
    May 29, 2015
    Posts:
    5
    Hi, thanks for your reply, but I managed to get it fixed. Not sure what I did, but here are some things:

    - renamed ScormAPI folder to Scorm
    - Changed runtime ver to .net4.x
    - changed build settings to windows, then back to WebGL
    - Restarted Unity

    Working without errors now:)
     
  49. Digi001

    Digi001

    Joined:
    May 29, 2015
    Posts:
    5
    Sorry, I should not have changed the scormAPI folder name, changed it back...
     
  50. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    I don't understand why you had to do all that because it shouldn't be needed at all. I don't have any users who have had such problems.

    Anyway, I'm glad you fixed it.