MDL-42588 mod_scorm: option for displaying activity name

Added option to display or hide activity name on SCORM player.
This commit is contained in:
Jetha Chan 2014-03-26 15:12:57 +08:00
commit 0326b83149
7 changed files with 13 additions and 4 deletions

View File

@ -65,6 +65,10 @@ class restore_scorm_activity_structure_step extends restore_activity_structure_s
$data->timeclose = $this->apply_date_offset($data->timeclose);
$data->timemodified = $this->apply_date_offset($data->timemodified);
if (!isset($data->displayactivityname)) {
$data->displayactivityname = true;
}
// insert the scorm record
$newitemid = $DB->insert_record('scorm', $data);
// immediately after inserting "activity" record, call this

View File

@ -95,7 +95,7 @@ $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['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 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.';

View File

@ -133,6 +133,7 @@ class mod_scorm_mod_form extends moodleform_mod {
// 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();

View File

@ -166,7 +166,7 @@ $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();
if ($scorm->displayactivityname) {
if (!empty($scorm->displayactivityname)) {
echo $OUTPUT->heading(format_string($scorm->name));
}

View File

@ -32,6 +32,9 @@ 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)));

View File

@ -68,7 +68,8 @@ class mod_scorm_generator extends testing_module_generator {
'forcenewattempt' => $cfgscorm->forcenewattempt,
'lastattemptlock' => $cfgscorm->lastattemptlock,
'forcecompleted' => $cfgscorm->forcecompleted,
'auto' => $cfgscorm->auto
'auto' => $cfgscorm->auto,
'displayactivityname' => $cfgscorm->displayactivityname
);
// The 'packagefile' value corresponds to the draft file area ID. If not specified, create from packagefilepath.

View File

@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014031700; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2014032600; // 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;