Moodle

JavaScript Error on Session Resume

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor 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

Issue Links

Activity

Hide
Dan Marsden added a comment -

Hi Peter,

I've just had a look to see if I can reproduce this in 2.0 - but the SCORM object doesn't appear to be valid anymore - looks like there's some form of expiry function within the SCORM object. - can you please provide a new object that would allow us to reproduce?

thanks,

Show
Dan Marsden added a comment - Hi Peter, I've just had a look to see if I can reproduce this in 2.0 - but the SCORM object doesn't appear to be valid anymore - looks like there's some form of expiry function within the SCORM object. - can you please provide a new object that would allow us to reproduce? thanks,
Hide
Peter Chamberlin added a comment -

I have recreated the SCORM 2004 package and removed its expiry date.

It is now available from:
http://download.ljgroup.com/users/SCORM/M2582801_C004-Hydraulics.(Engineering)-Actuators.zip

Show
Peter Chamberlin added a comment - I have recreated the SCORM 2004 package and removed its expiry date. It is now available from: http://download.ljgroup.com/users/SCORM/M2582801_C004-Hydraulics.(Engineering)-Actuators.zip
Hide
Dan Marsden added a comment -

duplicate bug - if I'm missing something here let me know!

thanks,

Show
Dan Marsden added a comment - duplicate bug - if I'm missing something here let me know! thanks,

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: