mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-61709 mod_scorm: use student fullname when not in standards mode
Changed the scorm12standard setting for SCORM 1.2 in a more generic 'use SCORM Standards' setting. New setting is off by default. The student name passed into the module is formatted as $USER->lastname .', '. $USER->firstname and thus ignores the fullnamedisplay. This is per SCORM1.2 standards. If setting 'use SCORM Standards' is disabled fullname will be used instead.
This commit is contained in:
parent
2bd2660751
commit
9376f7d68e
@ -43,7 +43,7 @@ if ($scoes = $DB->get_records('scorm_scoes', array('scorm' => $scorm->id), 'sort
|
||||
}
|
||||
|
||||
// If SCORM 1.2 standard mode is disabled allow higher datamodel limits.
|
||||
if (intval(get_config("scorm", "scorm12standard"))) {
|
||||
if (intval(get_config("scorm", "scormstandard"))) {
|
||||
$cmistring256 = '^[\\u0000-\\uFFFF]{0,255}$';
|
||||
$cmistring4096 = '^[\\u0000-\\uFFFF]{0,4096}$';
|
||||
} else {
|
||||
|
@ -29,7 +29,11 @@ function get_scorm_default (&$userdata, $scorm, $scoid, $attempt, $mode) {
|
||||
global $USER;
|
||||
|
||||
$userdata->student_id = $USER->username;
|
||||
$userdata->student_name = $USER->lastname .', '. $USER->firstname;
|
||||
if (empty(get_config('scorm', 'scormstandard'))) {
|
||||
$userdata->student_name = fullname($USER);
|
||||
} else {
|
||||
$userdata->student_name = $USER->lastname .', '. $USER->firstname;
|
||||
}
|
||||
|
||||
if ($usertrack = scorm_get_tracks($scoid, $USER->id, $attempt)) {
|
||||
foreach ($usertrack as $key => $value) {
|
||||
|
@ -1193,7 +1193,11 @@ function get_scorm_default (&$userdata, $scorm, $scoid, $attempt, $mode) {
|
||||
global $DB, $USER;
|
||||
|
||||
$userdata->student_id = $USER->username;
|
||||
$userdata->student_name = $USER->lastname .', '. $USER->firstname;
|
||||
if (empty(get_config('scorm', 'scormstandard'))) {
|
||||
$userdata->student_name = fullname($USER);
|
||||
} else {
|
||||
$userdata->student_name = $USER->lastname .', '. $USER->firstname;
|
||||
}
|
||||
|
||||
if ($usertrack = scorm_get_tracks($scoid, $USER->id, $attempt)) {
|
||||
// According to SCORM 2004(RTE V1, 4.2.8), only cmi.exit==suspend should allow previous datamodel elements on re-launch.
|
||||
|
@ -55,5 +55,12 @@ function xmldb_scorm_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.4.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2018032300) {
|
||||
set_config('scormstandard', get_config('scorm', 'scorm12standard'), 'scorm');
|
||||
unset_config('scorm12standard', 'scorm');
|
||||
|
||||
upgrade_mod_savepoint(true, 2018032300, 'scorm');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -343,9 +343,8 @@ $string['results'] = 'Results';
|
||||
$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['scormstandard'] = 'SCORM standards mode';
|
||||
$string['scormstandarddesc'] = 'When disabled, Moodle allows SCORM 1.2 packages to store more than the specification allows, and uses Moodle full name format settings when passing the users name to the SCORM package.';
|
||||
$string['scoes'] = 'Learning objects';
|
||||
$string['score'] = 'Score';
|
||||
$string['scorm:addinstance'] = 'Add a new SCORM package';
|
||||
|
@ -129,8 +129,8 @@ if ($ADMIN->fulltree) {
|
||||
// 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/scormstandard', get_string('scormstandard', 'scorm'),
|
||||
get_string('scormstandarddesc', 'scorm'), 0));
|
||||
|
||||
$settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternal', get_string('allowtypeexternal', 'scorm'), '', 0));
|
||||
|
||||
|
@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017111300; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2018032300; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2017110800; // Requires this Moodle version.
|
||||
$plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics).
|
Loading…
x
Reference in New Issue
Block a user