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

          Activity

          Hide
          danmarsden Dan Marsden added a comment -

          Thanks Ron - I'll try to get to this at some point soon.

          Show
          danmarsden Dan Marsden added a comment - Thanks Ron - I'll try to get to this at some point soon.
          Hide
          fred Frédéric Massart added a comment -

          That looks good to me Dan, pushing for integration.

          Show
          fred Frédéric Massart added a comment - That looks good to me Dan, pushing for integration.
          Hide
          poltawski Dan Poltawski added a comment -

          Thanks Dan, integrated to master, 26 and 25.

          Just a note that the first line of the commit message was quite long and it would've been preferable to split it onto further lines to display better in git tools. Cheers!

          Show
          poltawski Dan Poltawski added a comment - Thanks Dan, integrated to master, 26 and 25. Just a note that the first line of the commit message was quite long and it would've been preferable to split it onto further lines to display better in git tools. Cheers!
          Hide
          ankit_frenz Ankit Agarwal added a comment -

          Works as described, thanks

          Show
          ankit_frenz Ankit Agarwal added a comment - Works as described, thanks
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Well done is better than well said.

          Closing, big thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Well done is better than well said. Closing, big thanks!

            People

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

              Dates

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