Moodle

SCORM 2004 Data Model Validation Incorrect

Details

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

Description

In /mod/scorm/datamodels/scorm_13.js.php there are the following regular expressions defined for validating data model string values:

var CMIString200 = '^.{0,200}$';
var CMIString250 = '^.{0,250}$';
var CMIString1000 = '^.{0,1500}$';
var CMIString4000 = '^.{0,4000}$';
var CMIString64000 = '^.{0,64000}$';

The dot in a regular expression matches any character EXCEPT a newline (unless newline inclusion is enabled as an option of the regular expression engine used).

The SCORM 2004 3rd Edition standard requires characters from ISO 10646 (basis of Unicode Standard), thus the regex patterns should be:

var CMIString200 = '^\\u0000-\\uFFFF{0,200}$';
var CMIString250 = '^\\u0000-\\uFFFF{0,250}$';
var CMIString1000 = '^\\u0000-\\uFFFF{0,1500}$'; // Why is this 1,500 instead of 1,000?
var CMIString4000 = '^\\u0000-\\uFFFF{0,4000}$';
var CMIString64000 = '^\\u0000-\\uFFFF{0,64000}$';

Activity

Hide
Dan Marsden added a comment -

Thanks Peter - Piers would you mind having a look at this one? - Peter helped out with the regex stuff for SCORM 1.2 in MDL-12872 a while back.

Peter - there is a lot of work to be done in the SCORM 2004 stuff - feel free to create lots more tracker issues with any inconsistencies! - We don't currently have any funding to keep working through it, but issues like this with small fixes are trivial for us to patch.

thanks!

Show
Dan Marsden added a comment - Thanks Peter - Piers would you mind having a look at this one? - Peter helped out with the regex stuff for SCORM 1.2 in MDL-12872 a while back. Peter - there is a lot of work to be done in the SCORM 2004 stuff - feel free to create lots more tracker issues with any inconsistencies! - We don't currently have any funding to keep working through it, but issues like this with small fixes are trivial for us to patch. thanks!
Hide
Piers Harding added a comment -

thanks Peter - I've had a look at the 2004 SCORM specification and the CMIString1000 - most definitely should be 1000 wchars - it belongs to cmi.location.

I'll make the changes in HEAD, and it could do with some testing (other than mine) if you can manage the time.

Cheers,
Piers Harding.

Show
Piers Harding added a comment - thanks Peter - I've had a look at the 2004 SCORM specification and the CMIString1000 - most definitely should be 1000 wchars - it belongs to cmi.location. I'll make the changes in HEAD, and it could do with some testing (other than mine) if you can manage the time. Cheers, Piers Harding.
Hide
Piers Harding added a comment -

Commit fix to HEAD.

Show
Piers Harding added a comment - Commit fix to HEAD.
Hide
Piers Harding added a comment -

Hi - I have backported this to 1.9. Please review.

Show
Piers Harding added a comment - Hi - I have backported this to 1.9. Please review.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: