Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-83243

SCORM keep-alive aligned with session timeout

    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-83243_404
    • MDL-83243_405
    • MDL-83243_main
    • Moderate
    • Hide

      (difficulty: medium, requires limited use of the browser console)

      For each of the scenarios, start by following steps 1-3 before proceeding to the steps in the scenario.

      1. Create a course.
      2. Create a SCORM activity in the course. Configure the SCORM to open in the same window.
      3. Visit the SCORM activity and click "Enter" to enter the SCORM player page.

      Scenario 1: Lost connection

      1. Lose your network connection. You can simulate this by opening your browser's developer tools (often pressing F12 will do this), going to the "Network" tab, and changing the "Throttling" setting to "Offline". Alternatively, you could disable your computer's internet access.
      2. Confirm that sometime in the next 30 seconds a modal appears warning you about your unstable connection. Confirm that you can close the modal and continue with the SCORM activity.
      3. Confirm that after another 30 seconds have passed the modal reappears (if it was closed) and that the "Cancel" button is no longer visible. Confirm that closing the modal in any way (clicking outside of it, pressing the "Leave activity" button, or pressing the "X" button) immediately redirects you back to the SCORM module's view page. (If your internet connection hasn't been restored yet, restore it to verify that you are redirected to the correct page.)

      Scenario 2: Intermittent connection

      1. Lose your network connection (following instructions in step 1 in Scenario 1).
      2. Confirm that sometime in the next 30 seconds a modal appears warning you about your unstable connection. Close the modal.
      3. Restore your network connection immediately after the modal appears. Wait for at least 30 seconds. Confirm that another modal does not appear during that time.
      4. Lose your network connection again.
      5. Confirm that the modal with the "Cancel" button appears within 30 seconds of losing your connection. Confirm that you can close the modal and still continue with the SCORM activity.
      6. After another 30 seconds have passed, confirm that the modal is shown again (if not still visible) and no longer shows the "Cancel" button. Confirm that closing the modal in any way redirects you to the SCORM view page.
      Show
      (difficulty: medium, requires limited use of the browser console) For each of the scenarios, start by following steps 1-3 before proceeding to the steps in the scenario. Create a course. Create a SCORM activity in the course. Configure the SCORM to open in the same window. Visit the SCORM activity and click "Enter" to enter the SCORM player page. Scenario 1: Lost connection Lose your network connection. You can simulate this by opening your browser's developer tools (often pressing F12 will do this), going to the "Network" tab, and changing the "Throttling" setting to "Offline". Alternatively, you could disable your computer's internet access. Confirm that sometime in the next 30 seconds a modal appears warning you about your unstable connection. Confirm that you can close the modal and continue with the SCORM activity. Confirm that after another 30 seconds have passed the modal reappears (if it was closed) and that the "Cancel" button is no longer visible. Confirm that closing the modal in any way (clicking outside of it, pressing the "Leave activity" button, or pressing the "X" button) immediately redirects you back to the SCORM module's view page. (If your internet connection hasn't been restored yet, restore it to verify that you are redirected to the correct page.) Scenario 2: Intermittent connection Lose your network connection (following instructions in step 1 in Scenario 1). Confirm that sometime in the next 30 seconds a modal appears warning you about your unstable connection. Close the modal. Restore your network connection immediately after the modal appears. Wait for at least 30 seconds. Confirm that another modal does not appear during that time. Lose your network connection again. Confirm that the modal with the "Cancel" button appears within 30 seconds of losing your connection. Confirm that you can close the modal and still continue with the SCORM activity. After another 30 seconds have passed, confirm that the modal is shown again (if not still visible) and no longer shows the "Cancel" button. Confirm that closing the modal in any way redirects you to the SCORM view page.
    • Hide

      Fails against automated checks.

      Checked MDL-83243 using repository: https://github.com/sam-smucker/sam_moodle

      Should these errors be fixed?

      Built on: Fri Apr 11 19:48:36 UTC 2025

      Show
      Fails against automated checks. Checked MDL-83243 using repository: https://github.com/sam-smucker/sam_moodle MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-83243_404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-83243_405 | CI Job ] main (1 errors / 0 warnings) [branch: MDL-83243_main | CI Job ] overview (0/0) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (1/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Should these errors be fixed? Built on: Fri Apr 11 19:48:36 UTC 2025

      This enhancement is to address a situation that several of our clients encounter when deploying SCORM packages, and which is articulated in this Moodle forum:

      The user opens the package, walks away, comes back several hours later (without intervening Moodle or SCORM activity) and continues, and by then the Moodle session has timed out, so nothing is recorded back in Moodle... but it appears to the user that they've completed it.

      The suggested solution is to leverage the existing "unstable connection" modal, so that closing out the modal forces a user back to the SCORM activity page. If session timeout has not yet occurred (because the communication failure is due to unstable internet connection), the learner can relaunch the SCORM; if timeout has occurred, the user will be directed to log in again.

      Acceptance criteria
      As a learner in a Moodle site, I will know this is done when:

      • I have launched a SCORM package in one of the following ways: 
        • Standard window, in which the SCORM is embedded within the Moodle frame
        • New window via Moodle SCORM setting, in which the SCORM is actually inside a 100% width/height iframe wrapped inside the player.php file.
      • If communication between the SCORM package and Moodle fails—either because of unstable internet connection or a system timeout—I see a modal with the following message while in the launched SCORM package:
        • "Due to an unstable internet connection or system timeout, learning progress is now at risk. To ensure your progress is saved, you should exit and relaunch this activity.”
      • The options presented to me by the modal will depend on whether I have experienced multiple communication failures during my user session:  
        • If I am experiencing the first failure during my user session, the modal will display a choice of two buttons: 
          • Continue (I remain in package)
          • Exit (I relaunch package or, if system timeout has already occurred, log in to the site again)
        • If I am experiencing a second consecutive failure in my user session, the modal will only display an "Exit" button. When I close the modal in any way (clicking "Exit," clicking the close button, clicking outside the modal) I am immediately redirected to the SCORM activity view.php page, which will force me to re-enter the SCORM activity before proceeding; if timeout has occurred, I will be redirected to the login page.

            sam.smucker@moodle.com Sam Smucker
            jim.mezzanotte@moodle.com Jim Mezzanotte
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 56 minutes
                56m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.