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

Error when viewing an SCO with a saved objective or interaction in a SCORM 1.2 package

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.5.1, 3.5.2
    • Fix Version/s: None
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      Steps to reproduce (confirmed on the demo sandbox):

      1. Add this SCORM 1.2 debugger package to a course: https://github.com/moodle/moodle/blob/master/mod/scorm/tests/packages/complexscorm.zip
      2. View any SCO in the package.
      3. Create an interaction or objective and then commit the changes.
      4. View a different SCO and then return to the previous SCO.
      5. An exception occurs and the SCO is left in a broken state.

      See attached GIF demonstrating this bug.

      Show
      Steps to reproduce (confirmed on the demo sandbox): Add this SCORM 1.2 debugger package to a course: https://github.com/moodle/moodle/blob/master/mod/scorm/tests/packages/complexscorm.zip View any SCO in the package. Create an interaction or objective and then commit the changes. View a different SCO and then return to the previous SCO. An exception occurs and the SCO is left in a broken state. See attached GIF demonstrating this bug.
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      In a SCORM 1.2 package, if you complete an SCO that saves an objective or interaction and then later revisit that SCO, an exception such as the following occurs in LMSInitialize:

      Uncaught TypeError: Cannot read property 'score' of undefined
       at eval (eval at initdatamodel (scorm_12.js:2), <anonymous>:1:18)
       at initdatamodel (scorm_12.js:2)
       at SCORMapi1_2.LMSInitialize (scorm_12.js:4)
       at initAPI (VM684 debugger.js:33)
       at HTMLDocument.<anonymous> (VM684 debugger.js:316)
       at fire (VM680 jquery.min.js:3048)
       at Object.fireWith [as resolveWith] (VM680 jquery.min.js:3160)
       at Function.ready (VM680 jquery.min.js:433)
       at HTMLDocument.completed (VM680 jquery.min.js:104)

      This can cause the SCO to fail to load properly.

      The function raising the exception (initdatamodel) doesn't appear to initialize objective and interaction data properly. For example, it will do an eval to perform the assignment cmi.objectives_0.score._children = "" but doesn't ensure that cmi.objectives_0 and cmi.objectives_0.score actually exist beforehand.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jmabey Jimmy Mabey
              Participants:
              Component watchers:
              Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: