mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-42588 mod_scorm: display activity name
Added option to display or hide activity name on SCORM player.
This commit is contained in:
parent
c0e88129d1
commit
74ecabb8aa
@ -45,7 +45,8 @@ class backup_scorm_activity_structure_step extends backup_activity_structure_ste
|
||||
'skipview', 'hidebrowse', 'hidetoc', 'nav', 'navpositionleft', 'navpositiontop',
|
||||
'auto', 'popup', 'options', 'width',
|
||||
'height', 'timeopen', 'timeclose', 'timemodified',
|
||||
'completionstatusrequired', 'completionscorerequired'));
|
||||
'completionstatusrequired', 'completionscorerequired',
|
||||
'displayactivityname'));
|
||||
|
||||
$scoes = new backup_nested_element('scoes');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/scorm/db" VERSION="20130924" COMMENT="XMLDB file for Moodle mod/scorm"
|
||||
<XMLDB PATH="mod/scorm/db" VERSION="20140317" COMMENT="XMLDB file for Moodle mod/scorm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -44,6 +44,7 @@
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="completionstatusrequired" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="completionscorerequired" TYPE="int" LENGTH="2" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="displayactivityname" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
|
@ -251,6 +251,30 @@ function xmldb_scorm_upgrade($oldversion) {
|
||||
|
||||
upgrade_mod_savepoint(true, 2014021700, 'scorm');
|
||||
}
|
||||
|
||||
if ($oldversion < 2014031700) {
|
||||
// Define field displayactivityname to be added to scorm.
|
||||
$table = new xmldb_table('scorm');
|
||||
$field = new xmldb_field(
|
||||
'displayactivityname',
|
||||
XMLDB_TYPE_INTEGER,
|
||||
'4',
|
||||
null,
|
||||
XMLDB_NOTNULL,
|
||||
null,
|
||||
'1',
|
||||
'completionscorerequired'
|
||||
);
|
||||
|
||||
// Conditionally launch add field displayactivityname.
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Scorm savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2014031700, 'scorm');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,8 @@ $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.';
|
||||
$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 My home and/or the SCORM entry page.';
|
||||
$string['displayattemptstatusdesc'] = 'Whether a summary of the user\'s attempts is shown in the course overview block in My home and/or the SCORM entry page.';
|
||||
|
@ -130,6 +130,10 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->disabledIf('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');
|
||||
|
||||
// Skip view page.
|
||||
$skipviewoptions = scorm_get_skip_view_array();
|
||||
if ($COURSE->format == 'singleactivity') { // Remove option that would cause a constant redirect.
|
||||
@ -337,7 +341,6 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
if (!isset($defaultvalues['completionscorerequired']) || !strlen($defaultvalues['completionscorerequired'])) {
|
||||
$defaultvalues['completionscoredisabled'] = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function validation($data, $files) {
|
||||
|
@ -166,7 +166,9 @@ $PAGE->requires->data_for_js('scormplayerdata', Array('launch' => false,
|
||||
$PAGE->requires->js('/mod/scorm/request.js', true);
|
||||
$PAGE->requires->js('/lib/cookies.js', true);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($scorm->name));
|
||||
if ($scorm->displayactivityname) {
|
||||
echo $OUTPUT->heading(format_string($scorm->name));
|
||||
}
|
||||
|
||||
$PAGE->requires->string_for_js('navigation', 'scorm');
|
||||
$PAGE->requires->string_for_js('toc', 'scorm');
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2014021701; // The current module version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2013110500; // Requires this Moodle version
|
||||
$plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->cron = 300;
|
||||
$module->version = 2014031700; // The current module version (Date: YYYYMMDDXX).
|
||||
$module->requires = 2013110500; // Requires this Moodle version.
|
||||
$module->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics).
|
||||
$module->cron = 300;
|
||||
|
Loading…
x
Reference in New Issue
Block a user