Preventing Session Closure in SCORM Until Course Completion

Hi everyone,

I’m currently working on a SCORM course integration and am facing an issue with properly managing session closure. Here’s the situation:

  1. I’ve implemented a mechanism that sends an Terminate message if the course is idle for too long. This successfully saves the session, but the user is then forced to close the window. When they re-open the course, the progress resumes correctly.
  2. However, I cannot achieve the same result when the user reloads the page or closes the window/tab because the onunload event does not allow for asynchronous requests, and a synchronous Terminate is not reliable in modern browsers.
  3. SCORM requires the session to be properly closed to allow resumption. If the session isn’t closed and the user reloads or re-opens the course, the SCORM connection is severed. The course progress isn’t saved, and the course might be marked as completed, forcing the learner to start a new attempt.

Here’s my challenge:

  • I need the SCORM session to remain “open” until the learner has completed or failed the course.
  • I want to prevent the session from closing prematurely due to reloads or window/tab closures.

What’s the best approach to handle this? Is there a way to manage progress-saving without requiring the session to close, or a reliable method to keep the session alive across page reloads or browser events? Any insights or solutions would be greatly appreciated!

Thank you!