Skip to content

Commit

Permalink
MDL-42588 mod_scorm: option for displaying activity name
Browse files Browse the repository at this point in the history
Added option to display or hide activity name on SCORM player.
  • Loading branch information
Jetha Chan committed Mar 26, 2014
2 parents 3233f32 + 74d2a9d commit 0326b83
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions mod/scorm/backup/moodle2/restore_scorm_stepslib.php
Expand Up @@ -65,6 +65,10 @@ protected function process_scorm($data) {
$data->timeclose = $this->apply_date_offset($data->timeclose); $data->timeclose = $this->apply_date_offset($data->timeclose);
$data->timemodified = $this->apply_date_offset($data->timemodified); $data->timemodified = $this->apply_date_offset($data->timemodified);


if (!isset($data->displayactivityname)) {
$data->displayactivityname = true;
}

// insert the scorm record // insert the scorm record
$newitemid = $DB->insert_record('scorm', $data); $newitemid = $DB->insert_record('scorm', $data);
// immediately after inserting "activity" record, call this // immediately after inserting "activity" record, call this
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/lang/en/scorm.php
Expand Up @@ -95,7 +95,7 @@
$string['disabled'] = 'Disabled'; $string['disabled'] = 'Disabled';
$string['display'] = 'Display package'; $string['display'] = 'Display package';
$string['displayactivityname'] = 'Display activity name'; $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'] = '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['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.'; $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.';
Expand Down
1 change: 1 addition & 0 deletions mod/scorm/mod_form.php
Expand Up @@ -133,6 +133,7 @@ public function definition() {
// Display activity name. // Display activity name.
$mform->addElement('advcheckbox', 'displayactivityname', get_string('displayactivityname', 'scorm')); $mform->addElement('advcheckbox', 'displayactivityname', get_string('displayactivityname', 'scorm'));
$mform->addHelpButton('displayactivityname', 'displayactivityname', 'scorm'); $mform->addHelpButton('displayactivityname', 'displayactivityname', 'scorm');
$mform->setDefault('displayactivityname', $cfgscorm->displayactivityname);


// Skip view page. // Skip view page.
$skipviewoptions = scorm_get_skip_view_array(); $skipviewoptions = scorm_get_skip_view_array();
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/player.php
Expand Up @@ -166,7 +166,7 @@
$PAGE->requires->js('/mod/scorm/request.js', true); $PAGE->requires->js('/mod/scorm/request.js', true);
$PAGE->requires->js('/lib/cookies.js', true); $PAGE->requires->js('/lib/cookies.js', true);
echo $OUTPUT->header(); echo $OUTPUT->header();
if ($scorm->displayactivityname) { if (!empty($scorm->displayactivityname)) {
echo $OUTPUT->heading(format_string($scorm->name)); echo $OUTPUT->heading(format_string($scorm->name));
} }


Expand Down
3 changes: 3 additions & 0 deletions mod/scorm/settings.php
Expand Up @@ -32,6 +32,9 @@
get_string('display', 'scorm'), get_string('displaydesc', 'scorm'), get_string('display', 'scorm'), get_string('displaydesc', 'scorm'),
array('value' => 0, 'adv' => false), scorm_get_popup_display_array())); 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', $settings->add(new admin_setting_configtext_with_advanced('scorm/framewidth',
get_string('width', 'scorm'), get_string('framewidth', 'scorm'), get_string('width', 'scorm'), get_string('framewidth', 'scorm'),
array('value' => '100', 'adv' => true))); array('value' => '100', 'adv' => true)));
Expand Down
3 changes: 2 additions & 1 deletion mod/scorm/tests/generator/lib.php
Expand Up @@ -68,7 +68,8 @@ public function create_instance($record = null, array $options = null) {
'forcenewattempt' => $cfgscorm->forcenewattempt, 'forcenewattempt' => $cfgscorm->forcenewattempt,
'lastattemptlock' => $cfgscorm->lastattemptlock, 'lastattemptlock' => $cfgscorm->lastattemptlock,
'forcecompleted' => $cfgscorm->forcecompleted, '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. // The 'packagefile' value corresponds to the draft file area ID. If not specified, create from packagefilepath.
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/version.php
Expand Up @@ -24,7 +24,7 @@


defined('MOODLE_INTERNAL') || die(); 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->requires = 2013110500; // Requires this Moodle version.
$plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics). $plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics).
$plugin->cron = 300; $plugin->cron = 300;

0 comments on commit 0326b83

Please sign in to comment.