mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-40095 SCORM: Trivial comments tidy up
This commit is contained in:
parent
82bd0c6643
commit
6a75660eff
@ -35,7 +35,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
//-------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'general', get_string('general', 'form'));
|
||||
|
||||
// Name
|
||||
// Name.
|
||||
$mform->addElement('text', 'name', get_string('name'));
|
||||
if (!empty($CFG->formatstringstriptags)) {
|
||||
$mform->setType('name', PARAM_TEXT);
|
||||
@ -45,14 +45,14 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->addRule('name', null, 'required', null, 'client');
|
||||
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
||||
|
||||
// Summary
|
||||
// Summary.
|
||||
$this->add_intro_editor(true);
|
||||
|
||||
// Package.
|
||||
$mform->addElement('header', 'packagehdr', get_string('packagehdr', 'scorm'));
|
||||
$mform->setExpanded('packagehdr', true);
|
||||
|
||||
// Scorm types
|
||||
// Scorm types.
|
||||
$scormtypes = array(SCORM_TYPE_LOCAL => get_string('typelocal', 'scorm'));
|
||||
|
||||
if ($cfg_scorm->allowtypeexternal) {
|
||||
@ -71,7 +71,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$scormtypes[SCORM_TYPE_AICCURL] = get_string('typeaiccurl', 'scorm');
|
||||
}
|
||||
|
||||
// Reference
|
||||
// Reference.
|
||||
if (count($scormtypes) > 1) {
|
||||
$mform->addElement('select', 'scormtype', get_string('scormtype', 'scorm'), $scormtypes);
|
||||
$mform->setType('scormtype', PARAM_ALPHA);
|
||||
@ -97,7 +97,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->setType('updatefreq', PARAM_INT);
|
||||
}
|
||||
|
||||
// New local package upload
|
||||
// New local package upload.
|
||||
$mform->addElement('filepicker', 'packagefile', get_string('package', 'scorm'));
|
||||
$mform->addHelpButton('packagefile', 'package', 'scorm');
|
||||
$mform->disabledIf('packagefile', 'scormtype', 'noteq', SCORM_TYPE_LOCAL);
|
||||
@ -105,26 +105,26 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
// Display Settings.
|
||||
$mform->addElement('header', 'displaysettings', get_string('appearance'));
|
||||
|
||||
// Framed / Popup Window
|
||||
// Framed / Popup Window.
|
||||
$mform->addElement('select', 'popup', get_string('display', 'scorm'), scorm_get_popup_display_array());
|
||||
$mform->setDefault('popup', $cfg_scorm->popup);
|
||||
$mform->setAdvanced('popup', $cfg_scorm->popup_adv);
|
||||
|
||||
// Width
|
||||
// Width.
|
||||
$mform->addElement('text', 'width', get_string('width', 'scorm'), 'maxlength="5" size="5"');
|
||||
$mform->setDefault('width', $cfg_scorm->framewidth);
|
||||
$mform->setType('width', PARAM_INT);
|
||||
$mform->setAdvanced('width', $cfg_scorm->framewidth_adv);
|
||||
$mform->disabledIf('width', 'popup', 'eq', 0);
|
||||
|
||||
// Height
|
||||
// Height.
|
||||
$mform->addElement('text', 'height', get_string('height', 'scorm'), 'maxlength="5" size="5"');
|
||||
$mform->setDefault('height', $cfg_scorm->frameheight);
|
||||
$mform->setType('height', PARAM_INT);
|
||||
$mform->setAdvanced('height', $cfg_scorm->frameheight_adv);
|
||||
$mform->disabledIf('height', 'popup', 'eq', 0);
|
||||
|
||||
// Window Options
|
||||
// Window Options.
|
||||
$winoptgrp = array();
|
||||
foreach (scorm_get_popup_options_array() as $key => $value) {
|
||||
$winoptgrp[] = &$mform->createElement('checkbox', $key, '', get_string($key, 'scorm'));
|
||||
@ -134,7 +134,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->disabledIf('winoptgrp', 'popup', 'eq', 0);
|
||||
$mform->setAdvanced('winoptgrp', $cfg_scorm->winoptgrp_adv);
|
||||
|
||||
// Skip view page
|
||||
// Skip view page.
|
||||
$skipviewoptions = scorm_get_skip_view_array();
|
||||
if ($COURSE->format == 'scorm') { // Remove option that would cause a constant redirect.
|
||||
unset($skipviewoptions[SCORM_SKIPVIEW_ALWAYS]);
|
||||
@ -147,31 +147,31 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('skipview', $cfg_scorm->skipview);
|
||||
$mform->setAdvanced('skipview', $cfg_scorm->skipview_adv);
|
||||
|
||||
// Hide Browse
|
||||
// Hide Browse.
|
||||
$mform->addElement('selectyesno', 'hidebrowse', get_string('hidebrowse', 'scorm'));
|
||||
$mform->addHelpButton('hidebrowse', 'hidebrowse', 'scorm');
|
||||
$mform->setDefault('hidebrowse', $cfg_scorm->hidebrowse);
|
||||
$mform->setAdvanced('hidebrowse', $cfg_scorm->hidebrowse_adv);
|
||||
|
||||
// Display course structure
|
||||
// Display course structure.
|
||||
$mform->addElement('selectyesno', 'displaycoursestructure', get_string('displaycoursestructure', 'scorm'));
|
||||
$mform->addHelpButton('displaycoursestructure', 'displaycoursestructure', 'scorm');
|
||||
$mform->setDefault('displaycoursestructure', $cfg_scorm->displaycoursestructure);
|
||||
$mform->setAdvanced('displaycoursestructure', $cfg_scorm->displaycoursestructure_adv);
|
||||
|
||||
// Toc display
|
||||
// Toc display.
|
||||
$mform->addElement('select', 'hidetoc', get_string('hidetoc', 'scorm'), scorm_get_hidetoc_array());
|
||||
$mform->addHelpButton('hidetoc', 'hidetoc', 'scorm');
|
||||
$mform->setDefault('hidetoc', $cfg_scorm->hidetoc);
|
||||
$mform->setAdvanced('hidetoc', $cfg_scorm->hidetoc_adv);
|
||||
|
||||
// Hide Navigation panel
|
||||
// Hide Navigation panel.
|
||||
$mform->addElement('selectyesno', 'hidenav', get_string('hidenav', 'scorm'));
|
||||
$mform->setDefault('hidenav', $cfg_scorm->hidenav);
|
||||
$mform->setAdvanced('hidenav', $cfg_scorm->hidenav_adv);
|
||||
$mform->disabledIf('hidenav', 'hidetoc', 'noteq', 0);
|
||||
|
||||
// Display attempt status
|
||||
// Display attempt status.
|
||||
$mform->addElement('select', 'displayattemptstatus', get_string('displayattemptstatus', 'scorm'), scorm_get_attemptstatus_array());
|
||||
$mform->addHelpButton('displayattemptstatus', 'displayattemptstatus', 'scorm');
|
||||
$mform->setDefault('displayattemptstatus', $cfg_scorm->displayattemptstatus);
|
||||
@ -187,12 +187,12 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
// Grade Settings.
|
||||
$mform->addElement('header', 'gradesettings', get_string('grade'));
|
||||
|
||||
// Grade Method
|
||||
// Grade Method.
|
||||
$mform->addElement('select', 'grademethod', get_string('grademethod', 'scorm'), scorm_get_grade_method_array());
|
||||
$mform->addHelpButton('grademethod', 'grademethod', 'scorm');
|
||||
$mform->setDefault('grademethod', $cfg_scorm->grademethod);
|
||||
|
||||
// Maximum Grade
|
||||
// Maximum Grade.
|
||||
for ($i=0; $i<=100; $i++) {
|
||||
$grades[$i] = "$i";
|
||||
}
|
||||
@ -203,23 +203,23 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
// Attempts management.
|
||||
$mform->addElement('header', 'attemptsmanagementhdr', get_string('attemptsmanagement', 'scorm'));
|
||||
|
||||
// Max Attempts
|
||||
// Max Attempts.
|
||||
$mform->addElement('select', 'maxattempt', get_string('maximumattempts', 'scorm'), scorm_get_attempts_array());
|
||||
$mform->addHelpButton('maxattempt', 'maximumattempts', 'scorm');
|
||||
$mform->setDefault('maxattempt', $cfg_scorm->maxattempt);
|
||||
|
||||
// What Grade
|
||||
// What Grade.
|
||||
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), scorm_get_what_grade_array());
|
||||
$mform->disabledIf('whatgrade', 'maxattempt', 'eq', 1);
|
||||
$mform->addHelpButton('whatgrade', 'whatgrade', 'scorm');
|
||||
$mform->setDefault('whatgrade', $cfg_scorm->whatgrade);
|
||||
|
||||
// Force new attempt
|
||||
// Force new attempt.
|
||||
$mform->addElement('selectyesno', 'forcenewattempt', get_string('forcenewattempt', 'scorm'));
|
||||
$mform->addHelpButton('forcenewattempt', 'forcenewattempt', 'scorm');
|
||||
$mform->setDefault('forcenewattempt', $cfg_scorm->forcenewattempt);
|
||||
|
||||
// Last attempt lock - lock the enter button after the last available attempt has been made
|
||||
// Last attempt lock - lock the enter button after the last available attempt has been made.
|
||||
$mform->addElement('selectyesno', 'lastattemptlock', get_string('lastattemptlock', 'scorm'));
|
||||
$mform->addHelpButton('lastattemptlock', 'lastattemptlock', 'scorm');
|
||||
$mform->setDefault('lastattemptlock', $cfg_scorm->lastattemptlock);
|
||||
@ -227,18 +227,18 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
// Compatibility settings.
|
||||
$mform->addElement('header', 'compatibilitysettingshdr', get_string('compatibilitysettings', 'scorm'));
|
||||
|
||||
// Force completed
|
||||
// Force completed.
|
||||
$mform->addElement('selectyesno', 'forcecompleted', get_string('forcecompleted', 'scorm'));
|
||||
$mform->addHelpButton('forcecompleted', 'forcecompleted', 'scorm');
|
||||
$mform->setDefault('forcecompleted', $cfg_scorm->forcecompleted);
|
||||
|
||||
// Autocontinue
|
||||
// Autocontinue.
|
||||
$mform->addElement('selectyesno', 'auto', get_string('autocontinue', 'scorm'));
|
||||
$mform->addHelpButton('auto', 'autocontinue', 'scorm');
|
||||
$mform->setDefault('auto', $cfg_scorm->auto);
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// Hidden Settings
|
||||
// Hidden Settings.
|
||||
$mform->addElement('hidden', 'datadir', null);
|
||||
$mform->setType('datadir', PARAM_RAW);
|
||||
$mform->addElement('hidden', 'pkgtype', null);
|
||||
@ -253,7 +253,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
//-------------------------------------------------------------------------------
|
||||
$this->standard_coursemodule_elements();
|
||||
//-------------------------------------------------------------------------------
|
||||
// buttons
|
||||
// Buttons.
|
||||
$this->add_action_buttons();
|
||||
}
|
||||
|
||||
@ -306,9 +306,9 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$default_values['timeclose'] = 0;
|
||||
}
|
||||
|
||||
// Set some completion default data
|
||||
// Set some completion default data.
|
||||
if (!empty($default_values['completionstatusrequired']) && !is_array($default_values['completionstatusrequired'])) {
|
||||
// Unpack values
|
||||
// Unpack values.
|
||||
$cvalues = array();
|
||||
foreach (scorm_status_options() as $key => $value) {
|
||||
if (($default_values['completionstatusrequired'] & $key) == $key) {
|
||||
@ -333,7 +333,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
|
||||
if ($type === SCORM_TYPE_LOCAL) {
|
||||
if (!empty($data['update'])) {
|
||||
//ok, not required
|
||||
// OK, not required.
|
||||
|
||||
} else if (empty($data['packagefile'])) {
|
||||
$errors['packagefile'] = get_string('required');
|
||||
@ -424,7 +424,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
return $errors;
|
||||
}
|
||||
|
||||
//need to translate the "options" and "reference" field.
|
||||
// Need to translate the "options" and "reference" field.
|
||||
function set_data($default_values) {
|
||||
$default_values = (array)$default_values;
|
||||
|
||||
@ -457,7 +457,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform =& $this->_form;
|
||||
$items = array();
|
||||
|
||||
// Require score
|
||||
// Require score.
|
||||
$group = array();
|
||||
$group[] =& $mform->createElement('text', 'completionscorerequired', '', array('size' => 5));
|
||||
$group[] =& $mform->createElement('checkbox', 'completionscoredisabled', null, get_string('disable'));
|
||||
@ -470,7 +470,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$items[] = 'completionscoregroup';
|
||||
|
||||
|
||||
// Require status
|
||||
// Require status.
|
||||
$first = true;
|
||||
$firstkey = null;
|
||||
foreach (scorm_status_options(true) as $key => $value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user