Closed drakni closed 8 years ago
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 -
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.
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.
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.
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.
Hi,
We're experiencing a problem with the completion status when leaving an SCO. Our SCO is made of a web page where we add an exit button. When we use this button to leave the course, the "happy ending" is well sent to the LMS (with success as "passed", status as "completed" and score as "100%"), but if we leave the course by closing the window, only the "passed" is correctly returned, while the status is set as "incomplete" and score as "unknown".
Here is the custom integration we're using:
We've set the nav.request value to exitAll because we have only one SCO per course, and using any other value caused some LMS to relaunch the same SCO when close it via the custom exit button.
I've tried forcing the datas to be commited on launch, but it does not seem to work either.
Any idea of what could be wrong here?
Thanks for your help!