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

LMSCommit throws JS error if network connection is lost

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5, 2.5.4, 2.6.1
    • 2.5.5, 2.6.2
    • SCORM
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • master_MDL-42792
    • 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)

    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.

      Attachments

        Activity

          People

            danmarsden Dan Marsden
            rmeske Ron Meske
            Dan Poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Dan Marsden, Matteo Scaramuccia, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Mar/14