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

LMSCommit throws JS error if network connection is lost

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5, 2.5.4, 2.6.1
    • Fix Version/s: 2.5.5, 2.6.2
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      To test this you must be able to disconnect network activity between your browser and the Moodle site - if on laptop wifi accessing a remote Moodle it's pretty easy.

      1. Login as Administrator and activate SCORM API Debugging
      2. Log into a Course, e.g. a Topics one, and Turn Editing on.
      3. Enter a Valid SCORM package - there's one on MDL-37524 if you need it)
      4. a new popup tab will be opened with the the _SCORM API Activity Log
      5. in the SCORM debugger hit LMSCommit - you should get "LMSCommit was Successful!"
      6. disconnect Network (turn off wifi or network connection)
      7. hit LMSCommit button again and you should get an error "General exception" via pop-up and in the debug log. (before this patch a JS error was thrown instead)
      Show
      To test this you must be able to disconnect network activity between your browser and the Moodle site - if on laptop wifi accessing a remote Moodle it's pretty easy. Login as Administrator and activate SCORM API Debugging Log into a Course, e.g. a Topics one, and Turn Editing on. Enter a Valid SCORM package - there's one on MDL-37524 if you need it) a new popup tab will be opened with the the _SCORM API Activity Log in the SCORM debugger hit LMSCommit - you should get "LMSCommit was Successful!" disconnect Network (turn off wifi or network connection) hit LMSCommit button again and you should get an error "General exception" via pop-up and in the debug log. (before this patch a JS error was thrown instead)
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      master_MDL-42792

      Description

      If the LMSCommit is called without a network connection a JavaScript error is thrown. The error is "XMLHttpRequest: Network Error 0x2ee7..."

      The error is triggered by httpReq.send(param) which is called by DoRequest from within the function StoreData.

      The httpReg.send should be wrapped in a try/catch and if there is an error LMSCommit should return false as per the SCORM guidelines.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Mar/14