Giter VIP home page Giter VIP logo

Comments (3)

cybercussion avatar cybercussion commented on September 27, 2024

Hi,
Apologies, I didn't catch a notification from github that this was opened.
Reading through your code, it looks like we need to take a closer look at the 'unload' event stack.
Although, I do see happyEnding is set and committed on the 'load' function. This would imply something else is interfering on exit.

player.exit(); isn't known in the code here, so I'm not sure what its doing, but knowing what SCOBot does I'll itemize here to hopefully help you isolate.

'unload' event gets triggered and SCOBot internally will call exitSCO(). You'll see a trace like "SCO is being unloaded, forcing exit...". After that, you should see a completion and success status trace.
If the connection is active, it will internally trigger the 'unload' event your listening to above.
This means -

  1. Your player.exit() is called
  2. SB.happyEnding();
  3. SB.finish();
    Then, SCOBot will look at your default exit type can call finish based on your settings. Worst case, this is just doubling up calls, but shouldn't trigger any scoring/status changes.

Exit issues are hard to trace down unless you can persist the console tracing. You could also try the bookmarklet - https://www.cybercussion.com/bookmarklets/SCORM/. This would monitor the LMS API while you interact with it.

General Button behavior tip:

I've seen cases where a button click needs to return false, or it changes the DOM and causes a refresh of your whole SCO due to placing a '#" in the URL (http://stackoverflow.com/questions/1878264/how-do-i-make-an-html-button-not-reload-the-page). This would essentially reload the page and re-initialize SCOBot as the browser is exiting. Since exit type is 'finish' the LMS behavior is to start a new attempt which could be erasing your prior attempt with the proper status/scoring.
In SCORM 2004 a 'cmi.exit' of normal will end the attempt.

I suspect this may be why your having to do the exitAll call to force the LMS to stop your SCO from reloading.

from scobot.

drakni avatar drakni commented on September 27, 2024

Hey,

We did further investigations, and it seems SB.happyEnding(); isn't working for us. We solved our problem by replacing this call with cmi.complete_status, cmi.success_status, etc. on the exit button click event, as we just needed to set a complete status when a user launches a course:

We added a self.close() function to force the window to shut down in some cases.

from scobot.

cybercussion avatar cybercussion commented on September 27, 2024

Hi,
Ok, I did a quick test with https://dl.dropboxusercontent.com/u/3459294/HPPYENDTST-2004-4th-Edition.zip on cloud.scorm.com, and things seemed to work ok. But, at least you found a workaround for your situation.

With a SB.finish call it will actually set the 'adl.nav.request' for you if it doesn't equal 'none' by default too; since you have set that up in the default parameters instantiating SCOBot.

from scobot.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.