Permalink
Browse files

MDL-42588 mod_scorm: option for displaying activity name

Added option to display or hide activity name on SCORM player.
  • Loading branch information...
2 parents 3233f32 + 74d2a9d commit 0326b8314921565c71815b50c1ff3b6c963c6eb0 Jetha Chan committed Mar 26, 2014
@@ -65,6 +65,10 @@ protected function process_scorm($data) {
$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
@@ -95,7 +95,7 @@
$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
@@ -133,6 +133,7 @@ public function definition() {
// 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
@@ -166,7 +166,7 @@
$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
@@ -32,6 +32,9 @@
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)));
@@ -68,7 +68,8 @@ public function create_instance($record = null, array $options = null) {
'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
@@ -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;

0 comments on commit 0326b83

Please sign in to comment.