Commit 97fb0605 authored by Peter Dias's avatar Peter Dias
Browse files

MDL-73448 scorm: Remove displayactivityname in scorm.

parent 8f16a4d9
......@@ -46,7 +46,7 @@ class backup_scorm_activity_structure_step extends backup_activity_structure_ste
'auto', 'popup', 'options', 'width',
'height', 'timeopen', 'timeclose', 'timemodified',
'completionstatusrequired', 'completionscorerequired',
'completionstatusallscos', 'displayactivityname',
'completionstatusallscos',
'autocommit'));
$scoes = new backup_nested_element('scoes');
......
......@@ -66,9 +66,6 @@ class restore_scorm_activity_structure_step extends restore_activity_structure_s
$data->timeopen = $this->apply_date_offset($data->timeopen);
$data->timeclose = $this->apply_date_offset($data->timeclose);
if (!isset($data->displayactivityname)) {
$data->displayactivityname = true;
}
if (!isset($data->completionstatusallscos)) {
$data->completionstatusallscos = false;
}
......
......@@ -726,7 +726,7 @@ class mod_scorm_external extends external_api {
'forcenewattempt', 'lastattemptlock', 'displayattemptstatus', 'displaycoursestructure',
'sha1hash', 'md5hash', 'revision', 'launch', 'skipview', 'hidebrowse', 'hidetoc', 'nav',
'navpositionleft', 'navpositiontop', 'auto', 'popup', 'width', 'height', 'timeopen',
'timeclose', 'displayactivityname', 'scormtype', 'reference');
'timeclose', 'scormtype', 'reference');
// Check additional permissions for returning optional private settings.
if (has_capability('moodle/course:manageactivities', $context)) {
......@@ -808,8 +808,6 @@ class mod_scorm_external extends external_api {
'height' => new external_value(PARAM_INT, 'Frame height', VALUE_OPTIONAL),
'timeopen' => new external_value(PARAM_INT, 'Available from', VALUE_OPTIONAL),
'timeclose' => new external_value(PARAM_INT, 'Available to', VALUE_OPTIONAL),
'displayactivityname' => new external_value(PARAM_BOOL, 'Display the activity name above the player?',
VALUE_OPTIONAL),
'scormtype' => new external_value(PARAM_ALPHA, 'SCORM type', VALUE_OPTIONAL),
'reference' => new external_value(PARAM_NOTAGS, 'Reference to the package', VALUE_OPTIONAL),
'protectpackagedownloads' => new external_value(PARAM_BOOL, 'Protect package downloads?',
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/scorm/db" VERSION="20180315" COMMENT="XMLDB file for Moodle mod/scorm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
<XMLDB PATH="mod/scorm/db" VERSION="20220127" COMMENT="XMLDB file for Moodle mod/scorm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="scorm" COMMENT="each table is one SCORM module and its configuration">
......@@ -46,7 +46,6 @@
<FIELD NAME="completionstatusrequired" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="completionscorerequired" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="completionstatusallscos" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="displayactivityname" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="autocommit" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
......@@ -224,4 +223,4 @@
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
</XMLDB>
......@@ -59,5 +59,14 @@ function xmldb_scorm_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2021052501) {
$table = new xmldb_table('scorm');
$field = new xmldb_field('displayactivityname');
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}
upgrade_mod_savepoint(true, 2021052501, 'scorm');
}
return true;
}
info,mod_scorm
displayactivityname,mod_scorm
displayactivityname_help,mod_scorm
......@@ -114,8 +114,6 @@ $string['details'] = 'Track details';
$string['directories'] = 'Show the directory links';
$string['disabled'] = 'Disabled';
$string['display'] = 'Display package';
$string['displayactivityname'] = 'Display activity name';
$string['displayactivityname_help'] = 'Whether or not to display the activity name above the SCORM player.';
$string['displayattemptstatus'] = 'Display attempt status';
$string['displayattemptstatus_help'] = 'This preference allows a summary of the users attempts to show in the course overview block in Dashboard and/or the SCORM entry page.';
$string['displayattemptstatusdesc'] = 'Whether a summary of the user\'s attempts is shown in the course overview block in Dashboard and/or the SCORM entry page.';
......@@ -458,3 +456,5 @@ $string['youmustselectastatus'] = 'You must select a status to require';
// Deprecated since Moodle 4.0.
$string['info'] = 'Info';
$string['displayactivityname'] = 'Display activity name';
$string['displayactivityname_help'] = 'Whether or not to display the activity name above the SCORM player.';
......@@ -130,11 +130,6 @@ class mod_scorm_mod_form extends moodleform_mod {
$mform->hideIf('winoptgrp', 'popup', 'eq', 0);
$mform->setAdvanced('winoptgrp', $cfgscorm->winoptgrp_adv);
// Display activity name.
$mform->addElement('advcheckbox', 'displayactivityname', get_string('displayactivityname', 'scorm'));
$mform->addHelpButton('displayactivityname', 'displayactivityname', 'scorm');
$mform->setDefault('displayactivityname', $cfgscorm->displayactivityname);
// Skip view page.
$skipviewoptions = scorm_get_skip_view_array();
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), $skipviewoptions);
......
......@@ -195,9 +195,7 @@ $headerconfig = [
'description' => '',
'hidecompletion' => true
];
if ($activityheader->is_title_allowed() && empty($scorm->displayactivityname)) {
$headerconfig['title'] = '';
}
$activityheader->set_attrs($headerconfig);
echo $OUTPUT->header();
......
......@@ -32,9 +32,6 @@ if ($ADMIN->fulltree) {
get_string('display', 'scorm'), get_string('displaydesc', 'scorm'),
array('value' => 0, 'adv' => false), scorm_get_popup_display_array()));
$settings->add(new admin_setting_configcheckbox('scorm/displayactivityname',
get_string('displayactivityname', 'scorm'), get_string('displayactivityname_help', 'scorm'), 1));
$settings->add(new admin_setting_configtext_with_advanced('scorm/framewidth',
get_string('width', 'scorm'), get_string('framewidth', 'scorm'),
array('value' => '100', 'adv' => true)));
......
......@@ -677,7 +677,7 @@ class mod_scorm_external_testcase extends externallib_advanced_testcase {
'grademethod', 'whatgrade', 'maxattempt', 'forcecompleted', 'forcenewattempt', 'lastattemptlock',
'displayattemptstatus', 'displaycoursestructure', 'sha1hash', 'md5hash', 'revision', 'launch',
'skipview', 'hidebrowse', 'hidetoc', 'nav', 'navpositionleft', 'navpositiontop', 'auto',
'popup', 'width', 'height', 'timeopen', 'timeclose', 'displayactivityname', 'packagesize',
'popup', 'width', 'height', 'timeopen', 'timeclose', 'packagesize',
'packageurl', 'scormtype', 'reference');
// Add expected coursemodule and data.
......
......@@ -68,8 +68,7 @@ class mod_scorm_generator extends testing_module_generator {
'lastattemptlock' => $cfgscorm->lastattemptlock,
'forcecompleted' => $cfgscorm->forcecompleted,
'masteryoverride' => $cfgscorm->masteryoverride,
'auto' => $cfgscorm->auto,
'displayactivityname' => $cfgscorm->displayactivityname
'auto' => $cfgscorm->auto
);
if (empty($record['packagefilepath'])) {
$record['packagefilepath'] = $CFG->dirroot.'/mod/scorm/tests/packages/singlescobasic.zip';
......
This files describes API changes in the mod_scorm code.
=== 4.0 ===
* Setting 'displayactivityname' has been removed from scorm. This will be handled by activityheader and is theme dependent.
=== 3.6 ===
* The following renamed classes have been completely removed:
......
......@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052500; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2021052501; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.
$plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics).
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment