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

JavaScript Error on Session Resume

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.9
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      Debian Linux
    • Database:
      MySQL
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      When we load a SCORM 2004 conformant package in Moodle we experience a JavaScript error on first content load. This happens within the following script written by /mod/scorm/api.php:

      cmi.interactions.N0 = new Object();
      cmi.interactions.N0.objectives = new Object();
      cmi.interactions.N0.objectives._children = objectives_children;
      cmi.interactions.N0.correct_responses = new Object();
      cmi.interactions.N0.correct_responses._children = correct_responses_children;
      cmi.interactions.N0.type = 'true-false';
      cmi.interactions.N0.weighting = '1';
      cmi.interactions.N0.correct_responses = new Object();
      cmi.interactions.N0.correct_responses.N0 = new Object();
      cmi.interactions.N0.correct_responses.N0.pattern = 'false';
      cmi.interactions.N0.result = 'incorrect';
      cmi.interactions.N0.timestamp = '2009-02-10T11:03:38';
      cmi.interactions.N0.description = 'The movement of a hydraulic actuator is limited to linear motion. Is this true?';
      cmi.interactions.N0.id = 'urn:LJCreate:Interaction-M2582801-C004-2_1';
      cmi.interactions_N0.correct_responses._count = 1; // 'interactions_N0.correct_responses' is null or not an object !
      cmi.interactions.N0.objectives = new Object();
      cmi.interactions.N0.objectives.N0 = new Object();
      cmi.interactions.N0.objectives.N0.id = 'urn:LJCreate:Objective-M2582801-C004-1';
      cmi.interactions_N0.objectives._count = 1; // Will happen here too!

      It appears that an underscore has not been correctly substituted for a dot when resolving the JavaScript object hierarchy.

      The above script was created by the /mod/scorm/datamodels/scorm_13.js.php file.

      Our test package can be downloaded from the following URL (25.4 MB)
      http://download.ljgroup.com/users/SCORM/M2582801_C004-Hydraulics._Engineering_-Actuators.zip

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              danmarsden Dan Marsden
              Reporter:
              pinkduck Peter Chamberlin
              Participants:
              Component watchers:
              Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Jun/10