cybercussion / SCOBot

SCORM API for Content. JavaScript library, QUnit tests and examples.
https://cybercussion.com
156 stars 34 forks source link

cmi data not saved #9

Closed coldluca closed 5 years ago

coldluca commented 6 years ago

Hi, I'm able to run a SCORM 2004 (4th edition) using the SCOBot but the cmi object is never updated. After interacting with the course I'm expecting to have some data saved into the cmi (session_time, suspend_data, interactions, ...) but it is always at the initial state.

Below my code

<script type="text/javascript" src="./js/SCOBotUtil.js"></script>
<script type="text/javascript" src="./js/SCOBot_API_1484_11.js"></script>
<script type="text/javascript" src="./js/SCOBotBase.js"></script>
<script type="text/javascript" src="./js/SCOBot.js"></script>

<script type="text/javascript">
    var scorm = new SCOBotBase({                   
            debug: true,
            exit_type: 'suspend',
            success_status: 'passed',
        }),
        SB    = new SCOBot({
            happyEnding: true
        });

Thank you

cybercussion commented 6 years ago

Hi, Initially that all looks good. Suspending should allow you to resume upon next launch. Since you have debug on, did you get much in the way of acknowledgement the LMS was connected?

Also you could try my SCOverseer Bookmarklet found at https://cybercussion.com.

coldluca commented 6 years ago

Using the bookmarklet I get the following error

Sorry, no LMS present for SCOverseer to query against. No HACP, API_1484_11 or API was located.

One more information, int the chrome console I get these messages:

SCOBotBase: I was unable to locate an API for communication SCOBotBase: If you included Local_API_1484_11 I'll mimic the LMS. If not, all SCORM calls will fail.

So basically the ScoBot is mimic the LMS. Is this the reason why the cmi is always at the initial state? Is there a way to not just mimic the LMS?

Thank you

cybercussion commented 6 years ago

Yes, the SCOBot Content API mimics with no persistence. You could extend it to hold the students CMI object as I've had some clients do either in LocalStorage or off on a mongoDB etc. Just requires you to track the 'commit' event and store it. Then when re-creating the SCO instead of using the default cmi object, you'd need to retrieve the students attempt and override the one the local API_1484_11 was going to use. https://github.com/cybercussion/SCOBot/wiki/SCORM-SCOBot-Documentation#implementation-into-your-html-or-javascript

I developed the SCOBot Runtime API for LMS at the same time I did the Content API. This is mainly licensed to integrate into existing platforms and has a more full featured setup than the basic/generic one included with this project. At minimum it gives the community a starting position understanding the LMS Runtime API and a mechanism to test/debug without round trips to the LMS developing content.

coldluca commented 6 years ago

Even if I listen for the commit event, the cmi data (suspend_data, session_time, ..) is always at his initial state so I can't resume the scorm or track the completition status.

One more thing, I'm trying to run (successfully) a Scorm package in my web app, simulating an LMS. I don't know if it could be helpful.

cybercussion commented 6 years ago

Right, so the LMS Runtime manages a few items within the CMI (Student Attempt) Object. Based on the cmi.exit type you'd have to watch for 'suspend' or 'normal' as well as 'timeout', 'logout' for example. If its suspended, the next attempt will need to be resumed. And a normal exit, typically gets a new attempt (clean cmi object). There are a lot of rules in that imsmanifest.xml that get baked into the decision making at the LMS level. This is typically why the RTE costs money. But, in interest of some management you'd have to do - cmi.entry would need to be managed 'ab-initio' latin for the beginning or 'resume' meaning the prior attempt was suspended. You also may have to (based on rules in the imsmanifest have to manage success/completion from memory. But mainly if you want to just deal with suspension and resume thats more or less it.

cybercussion commented 5 years ago

Closing this out. Let me now if you have any issue debugging.