Permalink
Browse files

MDL-41476 scorm settings- SCORM1.2 standard mode and CMIString length

Adding SCORM 1.2 standard mode checkbox in scorm admin panel. By default it will be enabled
(i.e: config name = `scorm12standard`, plugin name = `scorm`, value = `1`)
If `scorm12standard` is `1` CMIString256 is of length 256 and CMIString4096 is of length is 4096
if `scorm12standard` is `0` CMIString256 and CMIString4096 are of length is 64000
  • Loading branch information...
1 parent 0678d09 commit e3528983f277e4f3060b8e05695a450ce1b5fba3 @nobelium nobelium committed with marinaglancy Mar 12, 2014
Showing with 16 additions and 2 deletions.
  1. +11 −2 mod/scorm/datamodels/scorm_12.js.php
  2. +3 −0 mod/scorm/lang/en/scorm.php
  3. +2 −0 mod/scorm/settings.php
@@ -30,14 +30,23 @@
if (!isset($currentorg)) {
$currentorg = '';
}
+
+// If SCORM 1.2 standard mode is disabled allow higher datamodel limits.
+if (intval(get_config("scorm", "scorm12standard"))) {
+ $cmistring256 = '^[\\u0000-\\uFFFF]{0,255}$';
+ $cmistring4096 = '^[\\u0000-\\uFFFF]{0,4096}$';
+} else {
+ $cmistring256 = '^[\\u0000-\\uFFFF]{0,64000}$';
+ $cmistring4096 = $cmistring256;
+}
?>
//
// SCORM 1.2 API Implementation
//
function SCORMapi1_2() {
// Standard Data Type Definition
- CMIString256 = '^[\\u0000-\\uffff]{0,255}$';
- CMIString4096 = '^[\\u0000-\\uffff]{0,4096}$';
+ CMIString256 = '<?php echo $cmistring256 ?>';
+ CMIString4096 = '<?php echo $cmistring4096 ?>';
CMITime = '^([0-2]{1}[0-9]{1}):([0-5]{1}[0-9]{1}):([0-5]{1}[0-9]{1})(\.[0-9]{1,2})?$';
CMITimespan = '^([0-9]{2,4}):([0-9]{2}):([0-9]{2})(\.[0-9]{1,2})?$';
CMIInteger = '^\\d+$';
@@ -314,6 +314,9 @@
$string['review'] = 'Review';
$string['reviewmode'] = 'Review mode';
$string['rightanswer'] = 'Right answer';
+$string['scorm12standard'] = 'Enable SCORM 1.2 standard mode';
+$string['scorm12standarddesc'] = 'Disabling this setting allows Moodle to store more data than the SCORM 1.2 specification allows.
+If your SCORM packages allow users to enter large amounts of text or if your package tries to store large amounts of data in the suspend_data field disable this.';
$string['scoes'] = 'Learning objects';
$string['score'] = 'Score';
$string['scorm:addinstance'] = 'Add a new SCORM package';
View
@@ -123,6 +123,8 @@
//admin level settings.
$settings->add(new admin_setting_heading('scorm/adminsettings', get_string('adminsettings', 'scorm'), ''));
+ $settings->add(new admin_setting_configcheckbox('scorm/scorm12standard', get_string('scorm12standard', 'scorm'), get_string('scorm12standarddesc', 'scorm'), 1));
+
$settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternal', get_string('allowtypeexternal', 'scorm'), '', 0));
$settings->add(new admin_setting_configcheckbox('scorm/allowtypelocalsync', get_string('allowtypelocalsync', 'scorm'), '', 0));

0 comments on commit e352898

Please sign in to comment.