本文整理汇总了PHP中scorm_get_hidetoc_array函数的典型用法代码示例。如果您正苦于以下问题:PHP scorm_get_hidetoc_array函数的具体用法?PHP scorm_get_hidetoc_array怎么用?PHP scorm_get_hidetoc_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scorm_get_hidetoc_array函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: definition
//.........这里部分代码省略.........
$mform->setDefault($key, $value);
}
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options', 'scorm'), '<br />', false);
$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');
$mform->setDefault('displayactivityname', $cfgscorm->displayactivityname);
// Skip view page.
$skipviewoptions = scorm_get_skip_view_array();
if ($COURSE->format == 'singleactivity') {
// Remove option that would cause a constant redirect.
unset($skipviewoptions[SCORM_SKIPVIEW_ALWAYS]);
if ($cfgscorm->skipview == SCORM_SKIPVIEW_ALWAYS) {
$cfgscorm->skipview = SCORM_SKIPVIEW_FIRST;
}
}
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), $skipviewoptions);
$mform->addHelpButton('skipview', 'skipview', 'scorm');
$mform->setDefault('skipview', $cfgscorm->skipview);
$mform->setAdvanced('skipview', $cfgscorm->skipview_adv);
// Hide Browse.
$mform->addElement('selectyesno', 'hidebrowse', get_string('hidebrowse', 'scorm'));
$mform->addHelpButton('hidebrowse', 'hidebrowse', 'scorm');
$mform->setDefault('hidebrowse', $cfgscorm->hidebrowse);
$mform->setAdvanced('hidebrowse', $cfgscorm->hidebrowse_adv);
// Display course structure.
$mform->addElement('selectyesno', 'displaycoursestructure', get_string('displaycoursestructure', 'scorm'));
$mform->addHelpButton('displaycoursestructure', 'displaycoursestructure', 'scorm');
$mform->setDefault('displaycoursestructure', $cfgscorm->displaycoursestructure);
$mform->setAdvanced('displaycoursestructure', $cfgscorm->displaycoursestructure_adv);
// Toc display.
$mform->addElement('select', 'hidetoc', get_string('hidetoc', 'scorm'), scorm_get_hidetoc_array());
$mform->addHelpButton('hidetoc', 'hidetoc', 'scorm');
$mform->setDefault('hidetoc', $cfgscorm->hidetoc);
$mform->setAdvanced('hidetoc', $cfgscorm->hidetoc_adv);
$mform->disabledIf('hidetoc', 'scormtype', 'eq', SCORM_TYPE_AICCURL);
// Navigation panel display.
$mform->addElement('select', 'nav', get_string('nav', 'scorm'), scorm_get_navigation_display_array());
$mform->addHelpButton('nav', 'nav', 'scorm');
$mform->setDefault('nav', $cfgscorm->nav);
$mform->setAdvanced('nav', $cfgscorm->nav_adv);
$mform->disabledIf('nav', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
// Navigation panel position from left.
$mform->addElement('text', 'navpositionleft', get_string('fromleft', 'scorm'), 'maxlength="5" size="5"');
$mform->setDefault('navpositionleft', $cfgscorm->navpositionleft);
$mform->setType('navpositionleft', PARAM_INT);
$mform->setAdvanced('navpositionleft', $cfgscorm->navpositionleft_adv);
$mform->disabledIf('navpositionleft', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
$mform->disabledIf('navpositionleft', 'nav', 'noteq', SCORM_NAV_FLOATING);
// Navigation panel position from top.
$mform->addElement('text', 'navpositiontop', get_string('fromtop', 'scorm'), 'maxlength="5" size="5"');
$mform->setDefault('navpositiontop', $cfgscorm->navpositiontop);
$mform->setType('navpositiontop', PARAM_INT);
$mform->setAdvanced('navpositiontop', $cfgscorm->navpositiontop_adv);
$mform->disabledIf('navpositiontop', 'hidetoc', 'noteq', SCORM_TOC_SIDE);
$mform->disabledIf('navpositiontop', 'nav', 'noteq', SCORM_NAV_FLOATING);
// Display attempt status.
$mform->addElement('select', 'displayattemptstatus', get_string('displayattemptstatus', 'scorm'), scorm_get_attemptstatus_array());
$mform->addHelpButton('displayattemptstatus', 'displayattemptstatus', 'scorm');
$mform->setDefault('displayattemptstatus', $cfgscorm->displayattemptstatus);
$mform->setAdvanced('displayattemptstatus', $cfgscorm->displayattemptstatus_adv);
// Availability.
$mform->addElement('header', 'availability', get_string('availability'));
$mform->addElement('date_time_selector', 'timeopen', get_string("scormopen", "scorm"), array('optional' => true));
示例2: definition
//.........这里部分代码省略.........
// Force new attempt
$mform->addElement('selectyesno', 'forcenewattempt', get_string('forcenewattempt', 'scorm'));
$mform->setHelpButton('forcenewattempt', array('forcenewattempt', get_string('forcenewattempt', 'scorm'), 'scorm'));
$mform->setDefault('forcenewattempt', $cfg_scorm->forcenewattempt);
$mform->setAdvanced('forcenewattempt');
// Last attempt lock - lock the enter button after the last available attempt has been made
$mform->addElement('selectyesno', 'lastattemptlock', get_string('lastattemptlock', 'scorm'));
$mform->setHelpButton('lastattemptlock', array('lastattemptlock', get_string('lastattemptlock', 'scorm'), 'scorm'));
$mform->setDefault('lastattemptlock', $cfg_scorm->lastattemptlock);
$mform->setAdvanced('lastattemptlock');
// What Grade
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), scorm_get_what_grade_array());
$mform->disabledIf('whatgrade', 'maxattempt', 'eq', 1);
$mform->setHelpButton('whatgrade', array('whatgrade', get_string('whatgrade', 'scorm'), 'scorm'));
$mform->setDefault('whatgrade', $cfg_scorm->whatgrade);
$mform->setAdvanced('whatgrade');
// Activation period
/* $mform->addElement('static', '', '' ,'<hr />');
$mform->addElement('static', 'activation', get_string('activation','scorm'));
$datestartgrp = array();
$datestartgrp[] = &$mform->createElement('date_time_selector', 'startdate');
$datestartgrp[] = &$mform->createElement('checkbox', 'startdisabled', null, get_string('disable'));
$mform->addGroup($datestartgrp, 'startdategrp', get_string('from'), ' ', false);
$mform->setDefault('startdate', 0);
$mform->setDefault('startdisabled', 1);
$mform->disabledIf('startdategrp', 'startdisabled', 'checked');
$dateendgrp = array();
$dateendgrp[] = &$mform->createElement('date_time_selector', 'enddate');
$dateendgrp[] = &$mform->createElement('checkbox', 'enddisabled', null, get_string('disable'));
$mform->addGroup($dateendgrp, 'dateendgrp', get_string('to'), ' ', false);
$mform->setDefault('enddate', 0);
$mform->setDefault('enddisabled', 1);
$mform->disabledIf('dateendgrp', 'enddisabled', 'checked');
*/
// Stage Size
$mform->addElement('static', '', '', '<hr />');
$mform->addElement('static', 'stagesize', get_string('stagesize', 'scorm'));
$mform->setHelpButton('stagesize', array('stagesize', get_string('stagesize', 'scorm'), 'scorm'));
// Width
$mform->addElement('text', 'width', get_string('width', 'scorm'), 'maxlength="5" size="5"');
$mform->setDefault('width', $cfg_scorm->framewidth);
$mform->setType('width', PARAM_INT);
// Height
$mform->addElement('text', 'height', get_string('height', 'scorm'), 'maxlength="5" size="5"');
$mform->setDefault('height', $cfg_scorm->frameheight);
$mform->setType('height', PARAM_INT);
// 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');
// Window Options
$winoptgrp = array();
foreach (scorm_get_popup_options_array() as $key => $value) {
$winoptgrp[] =& $mform->createElement('checkbox', $key, '', get_string($key, 'scorm'));
$mform->setDefault($key, $value);
}
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options', 'scorm'), '<br />', false);
$mform->setAdvanced('winoptgrp');
$mform->disabledIf('winoptgrp', 'popup', 'eq', 0);
// Skip view page
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), scorm_get_skip_view_array());
$mform->setHelpButton('skipview', array('skipview', get_string('skipview', 'scorm'), 'scorm'));
$mform->setDefault('skipview', $cfg_scorm->skipview);
$mform->setAdvanced('skipview');
// Hide Browse
$mform->addElement('selectyesno', 'hidebrowse', get_string('hidebrowse', 'scorm'));
$mform->setHelpButton('hidebrowse', array('hidebrowse', get_string('hidebrowse', 'scorm'), 'scorm'));
$mform->setDefault('hidebrowse', $cfg_scorm->hidebrowse);
$mform->setAdvanced('hidebrowse');
// Toc display
$mform->addElement('select', 'hidetoc', get_string('hidetoc', 'scorm'), scorm_get_hidetoc_array());
$mform->setDefault('hidetoc', $cfg_scorm->hidetoc);
$mform->setAdvanced('hidetoc');
// Hide Navigation panel
$mform->addElement('selectyesno', 'hidenav', get_string('hidenav', 'scorm'));
$mform->setDefault('hidenav', $cfg_scorm->hidenav);
$mform->setAdvanced('hidenav');
// Autocontinue
$mform->addElement('selectyesno', 'auto', get_string('autocontinue', 'scorm'));
$mform->setHelpButton('auto', array('autocontinue', get_string('autocontinue', 'scorm'), 'scorm'));
$mform->setDefault('auto', $cfg_scorm->auto);
$mform->setAdvanced('auto');
// Update packages timing
$mform->addElement('select', 'updatefreq', get_string('updatefreq', 'scorm'), scorm_get_updatefreq_array());
$mform->setDefault('updatefreq', $cfg_scorm->updatefreq);
$mform->setAdvanced('updatefreq');
//-------------------------------------------------------------------------------
// Hidden Settings
$mform->addElement('hidden', 'datadir', null);
$mform->addElement('hidden', 'pkgtype', null);
$mform->addElement('hidden', 'launch', null);
$mform->addElement('hidden', 'redirect', null);
$mform->addElement('hidden', 'redirecturl', null);
//-------------------------------------------------------------------------------
$this->standard_coursemodule_elements();
//-------------------------------------------------------------------------------
// buttons
$this->add_action_buttons();
}
示例3: array
require_once $CFG->dirroot . '/mod/scorm/locallib.php';
$yesno = array(0 => get_string('no'), 1 => get_string('yes'));
// Default display settings.
$settings->add(new admin_setting_heading('scorm/displaysettings', get_string('defaultdisplaysettings', 'scorm'), ''));
$settings->add(new admin_setting_configselect_with_advanced('scorm/displaycoursestructure', get_string('displaycoursestructure', 'scorm'), get_string('displaycoursestructuredesc', 'scorm'), array('value' => 0, 'adv' => false), $yesno));
$settings->add(new admin_setting_configselect_with_advanced('scorm/popup', 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)));
$settings->add(new admin_setting_configtext_with_advanced('scorm/frameheight', get_string('height', 'scorm'), get_string('frameheight', 'scorm'), array('value' => '500', 'adv' => true)));
$settings->add(new admin_setting_configcheckbox('scorm/winoptgrp_adv', get_string('optionsadv', 'scorm'), get_string('optionsadv_desc', 'scorm'), 1));
foreach (scorm_get_popup_options_array() as $key => $value) {
$settings->add(new admin_setting_configcheckbox('scorm/' . $key, get_string($key, 'scorm'), '', $value));
}
$settings->add(new admin_setting_configselect_with_advanced('scorm/skipview', get_string('skipview', 'scorm'), get_string('skipviewdesc', 'scorm'), array('value' => 0, 'adv' => true), scorm_get_skip_view_array()));
$settings->add(new admin_setting_configselect_with_advanced('scorm/hidebrowse', get_string('hidebrowse', 'scorm'), get_string('hidebrowsedesc', 'scorm'), array('value' => 0, 'adv' => true), $yesno));
$settings->add(new admin_setting_configselect_with_advanced('scorm/hidetoc', get_string('hidetoc', 'scorm'), get_string('hidetocdesc', 'scorm'), array('value' => 0, 'adv' => true), scorm_get_hidetoc_array()));
$settings->add(new admin_setting_configselect_with_advanced('scorm/nav', get_string('nav', 'scorm'), get_string('navdesc', 'scorm'), array('value' => SCORM_NAV_UNDER_CONTENT, 'adv' => true), scorm_get_navigation_display_array()));
$settings->add(new admin_setting_configtext_with_advanced('scorm/navpositionleft', get_string('fromleft', 'scorm'), get_string('navpositionleft', 'scorm'), array('value' => -100, 'adv' => true)));
$settings->add(new admin_setting_configtext_with_advanced('scorm/navpositiontop', get_string('fromtop', 'scorm'), get_string('navpositiontop', 'scorm'), array('value' => -100, 'adv' => true)));
$settings->add(new admin_setting_configtext_with_advanced('scorm/collapsetocwinsize', get_string('collapsetocwinsize', 'scorm'), get_string('collapsetocwinsizedesc', 'scorm'), array('value' => 767, 'adv' => true)));
$settings->add(new admin_setting_configselect_with_advanced('scorm/displayattemptstatus', get_string('displayattemptstatus', 'scorm'), get_string('displayattemptstatusdesc', 'scorm'), array('value' => 1, 'adv' => false), $yesno));
// Default grade settings.
$settings->add(new admin_setting_heading('scorm/gradesettings', get_string('defaultgradesettings', 'scorm'), ''));
$settings->add(new admin_setting_configselect('scorm/grademethod', get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'), GRADEHIGHEST, scorm_get_grade_method_array()));
for ($i = 0; $i <= 100; $i++) {
$grades[$i] = "{$i}";
}
$settings->add(new admin_setting_configselect('scorm/maxgrade', get_string('maximumgrade'), get_string('maximumgradedesc', 'scorm'), 100, $grades));
$settings->add(new admin_setting_heading('scorm/othersettings', get_string('defaultothersettings', 'scorm'), ''));
// Default attempts settings.
$settings->add(new admin_setting_configselect('scorm/maxattempt', get_string('maximumattempts', 'scorm'), '', '0', scorm_get_attempts_array()));
示例4: foreach
foreach (scorm_get_popup_options_array() as $key => $value) {
$settings->add(new admin_setting_configcheckbox('scorm/'.$key,
get_string($key, 'scorm'), '', $value));
}
$settings->add(new admin_setting_configselect_with_advanced('scorm/skipview',
get_string('skipview', 'scorm'), get_string('skipviewdesc', 'scorm'),
array('value' => 0, 'adv' => true), scorm_get_skip_view_array()));
$settings->add(new admin_setting_configselect_with_advanced('scorm/hidebrowse',
get_string('hidebrowse', 'scorm'), get_string('hidebrowsedesc', 'scorm'),
array('value' => 0, 'adv' => true), $yesno));
$settings->add(new admin_setting_configselect_with_advanced('scorm/hidetoc',
get_string('hidetoc', 'scorm'), get_string('hidetocdesc', 'scorm'),
array('value' => 0, 'adv' => true), scorm_get_hidetoc_array()));
$settings->add(new admin_setting_configselect_with_advanced('scorm/hidenav',
get_string('hidenav', 'scorm'), get_string('hidenavdesc', 'scorm'),
array('value' => 0, 'adv' => false), $yesno));
//default grade settings
$settings->add(new admin_setting_heading('scorm/gradesettings', get_string('defaultgradesettings', 'scorm'), ''));
$settings->add(new admin_setting_configselect_with_advanced('scorm/grademethod',
get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'),
array('value' => GRADEHIGHEST, 'adv' => false), scorm_get_grade_method_array()));
for ($i=0; $i<=100; $i++) {
$grades[$i] = "$i";
}
示例5: definition
//.........这里部分代码省略.........
$mform->setDefault('maxattempt', $CFG->scorm_maxattempts);
// What Grade
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), scorm_get_what_grade_array());
$mform->disabledIf('whatgrade', 'maxattempt', 'eq', 1);
$mform->setHelpButton('whatgrade', array('whatgrade', get_string('whatgrade', 'scorm'), 'scorm'));
$mform->setDefault('whatgrade', $CFG->scorm_whatgrade);
$mform->setAdvanced('whatgrade');
// Activation period
/* $mform->addElement('static', '', '' ,'<hr />');
$mform->addElement('static', 'activation', get_string('activation','scorm'));
$datestartgrp = array();
$datestartgrp[] = &$mform->createElement('date_time_selector', 'startdate');
$datestartgrp[] = &$mform->createElement('checkbox', 'startdisabled', null, get_string('disable'));
$mform->addGroup($datestartgrp, 'startdategrp', get_string('from'), ' ', false);
$mform->setDefault('startdate', 0);
$mform->setDefault('startdisabled', 1);
$mform->disabledIf('startdategrp', 'startdisabled', 'checked');
$dateendgrp = array();
$dateendgrp[] = &$mform->createElement('date_time_selector', 'enddate');
$dateendgrp[] = &$mform->createElement('checkbox', 'enddisabled', null, get_string('disable'));
$mform->addGroup($dateendgrp, 'dateendgrp', get_string('to'), ' ', false);
$mform->setDefault('enddate', 0);
$mform->setDefault('enddisabled', 1);
$mform->disabledIf('dateendgrp', 'enddisabled', 'checked');
*/
// Stage Size
$mform->addElement('static', '', '', '<hr />');
$mform->addElement('static', 'stagesize', get_string('stagesize', 'scorm'));
$mform->setHelpButton('stagesize', array('stagesize', get_string('stagesize', 'scorm'), 'scorm'));
// Width
$mform->addElement('text', 'width', get_string('width', 'scorm'), 'maxlength="5" size="5"');
$mform->setDefault('width', $CFG->scorm_framewidth);
$mform->setType('width', PARAM_INT);
// Height
$mform->addElement('text', 'height', get_string('height', 'scorm'), 'maxlength="5" size="5"');
$mform->setDefault('height', $CFG->scorm_frameheight);
$mform->setType('height', PARAM_INT);
// 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');
// Window Options
$winoptgrp = array();
foreach (scorm_get_popup_options_array() as $key => $value) {
$winoptgrp[] =& $mform->createElement('checkbox', $key, '', get_string($key, 'scorm'));
$mform->setDefault($key, $value);
}
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options', 'scorm'), '<br />', false);
$mform->setAdvanced('winoptgrp');
$mform->disabledIf('winoptgrp', 'popup', 'eq', 0);
// Skip view page
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), scorm_get_skip_view_array());
$mform->setHelpButton('skipview', array('skipview', get_string('skipview', 'scorm'), 'scorm'));
$mform->setDefault('skipview', $CFG->scorm_skipview);
$mform->setAdvanced('skipview');
// Hide Browse
$mform->addElement('selectyesno', 'hidebrowse', get_string('hidebrowse', 'scorm'));
$mform->setHelpButton('hidebrowse', array('hidebrowse', get_string('hidebrowse', 'scorm'), 'scorm'));
$mform->setDefault('hidebrowse', $CFG->scorm_hidebrowse);
$mform->setAdvanced('hidebrowse');
// Toc display
$mform->addElement('select', 'hidetoc', get_string('hidetoc', 'scorm'), scorm_get_hidetoc_array());
$mform->setDefault('hidetoc', $CFG->scorm_hidetoc);
$mform->setAdvanced('hidetoc');
// Hide Navigation panel
$mform->addElement('selectyesno', 'hidenav', get_string('hidenav', 'scorm'));
$mform->setDefault('hidenav', $CFG->scorm_hidenav);
$mform->setAdvanced('hidenav');
// Autocontinue
$mform->addElement('selectyesno', 'auto', get_string('autocontinue', 'scorm'));
$mform->setHelpButton('auto', array('autocontinue', get_string('autocontinue', 'scorm'), 'scorm'));
$mform->setDefault('auto', $CFG->scorm_auto);
$mform->setAdvanced('auto');
// Update packages timing
$mform->addElement('select', 'updatefreq', get_string('updatefreq', 'scorm'), scorm_get_updatefreq_array());
$mform->setDefault('updatefreq', $CFG->scorm_updatefreq);
$mform->setAdvanced('updatefreq');
//-------------------------------------------------------------------------------
// Hidden Settings
$mform->addElement('hidden', 'datadir', null);
$mform->setType('datadir', PARAM_RAW);
$mform->addElement('hidden', 'pkgtype', null);
$mform->setType('pkgtype', PARAM_RAW);
$mform->addElement('hidden', 'launch', null);
$mform->setType('launch', PARAM_RAW);
$mform->addElement('hidden', 'redirect', null);
$mform->setType('redirect', PARAM_RAW);
$mform->addElement('hidden', 'redirecturl', null);
$mform->setType('redirecturl', PARAM_RAW);
//-------------------------------------------------------------------------------
$features = new stdClass();
$features->groups = false;
$features->groupings = true;
$features->groupmembersonly = true;
$this->standard_coursemodule_elements($features);
//-------------------------------------------------------------------------------
// buttons
$this->add_action_buttons();
}
示例6: array
$yesno = array(0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('scorm/grademethod', get_string('grademethod', 'scorm'), get_string('grademethoddesc', 'scorm'), GRADEHIGHEST, scorm_get_grade_method_array()));
for ($i = 0; $i <= 100; $i++) {
$grades[$i] = "{$i}";
}
$settings->add(new admin_setting_configselect('scorm/maxgrade', get_string('maximumgrade'), get_string('maximumgradedesc', 'scorm'), 100, $grades));
$settings->add(new admin_setting_configtext('scorm/maxattempts', get_string('maximumattempts', 'scorm'), '', 0, PARAM_INT));
$settings->add(new admin_setting_configselect('scorm/displayattemptstatus', get_string('displayattemptstatus', 'scorm'), get_string('displayattemptstatusdesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/displaycoursestructure', get_string('displaycoursestructure', 'scorm'), get_string('displaycoursestructuredesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/forcecompleted', get_string('forcecompleted', 'scorm'), get_string('forcecompleteddesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/forcenewattempt', get_string('forcenewattempt', 'scorm'), get_string('forcenewattemptdesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/lastattemptlock', get_string('lastattemptlock', 'scorm'), get_string('lastattemptlockdesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/whatgrade', get_string('whatgrade', 'scorm'), get_string('whatgradedesc', 'scorm'), HIGHESTATTEMPT, scorm_get_what_grade_array()));
$settings->add(new admin_setting_configtext('scorm/framewidth', get_string('width', 'scorm'), get_string('framewidth', 'scorm'), 100));
$settings->add(new admin_setting_configtext('scorm/frameheight', get_string('height', 'scorm'), get_string('frameheight', 'scorm'), 500));
$settings->add(new admin_setting_configselect('scorm/popup', get_string('display', 'scorm'), get_string('displaydesc', 'scorm'), 0, scorm_get_popup_display_array()));
foreach (scorm_get_popup_options_array() as $key => $value) {
$settings->add(new admin_setting_configcheckbox('scorm/' . $key, get_string($key, 'scorm'), '', $value));
}
$settings->add(new admin_setting_configselect('scorm/skipview', get_string('skipview', 'scorm'), get_string('skipviewdesc', 'scorm'), 0, scorm_get_skip_view_array()));
$settings->add(new admin_setting_configselect('scorm/hidebrowse', get_string('hidebrowse', 'scorm'), get_string('hidebrowsedesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/hidetoc', get_string('hidetoc', 'scorm'), get_string('hidetocdesc', 'scorm'), 0, scorm_get_hidetoc_array()));
$settings->add(new admin_setting_configselect('scorm/hidenav', get_string('hidenav', 'scorm'), get_string('hidenavdesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/auto', get_string('autocontinue', 'scorm'), get_string('autocontinuedesc', 'scorm'), 0, $yesno));
$settings->add(new admin_setting_configselect('scorm/updatefreq', get_string('updatefreq', 'scorm'), get_string('updatefreqdesc', 'scorm'), 0, scorm_get_updatefreq_array()));
$settings->add(new admin_setting_configtext('scorm/updatetime', get_string('updatetime', 'scorm'), '', 2, PARAM_INT));
$settings->add(new admin_setting_configcheckbox('scorm/allowtypeexternal', get_string('allowtypeexternal', 'scorm'), '', 0));
$settings->add(new admin_setting_configcheckbox('scorm/allowtypelocalsync', get_string('allowtypelocalsync', 'scorm'), '', 0));
$settings->add(new admin_setting_configcheckbox('scorm/allowtypeimsrepository', get_string('allowtypeimsrepository', 'scorm'), '', 0));
$settings->add(new admin_setting_configcheckbox('scorm/allowapidebug', get_string('allowapidebug', 'scorm'), '', 0));
$settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '.*'));
示例7: definition
//.........这里部分代码省略.........
$winoptgrp[] = &$mform->createElement('checkbox', $key, '', get_string($key, 'scorm'));
$mform->setDefault($key, $value);
}
$mform->addGroup($winoptgrp, 'winoptgrp', get_string('options', 'scorm'), '<br />', false);
$mform->disabledIf('winoptgrp', 'popup', 'eq', 0);
$mform->setAdvanced('winoptgrp', $cfg_scorm->winoptgrp_adv);
// 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]);
if ($cfg_scorm->skipview == SCORM_SKIPVIEW_ALWAYS) {
$cfg_scorm->skipview = SCORM_SKIPVIEW_FIRST;
}
}
$mform->addElement('select', 'skipview', get_string('skipview', 'scorm'), $skipviewoptions);
$mform->addHelpButton('skipview', 'skipview', 'scorm');
$mform->setDefault('skipview', $cfg_scorm->skipview);
$mform->setAdvanced('skipview', $cfg_scorm->skipview_adv);
// 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.
$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.
$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.
$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);
//-------------------------------------------------------------------------------
// Grade Settings.
$mform->addElement('header', 'gradesettings', get_string('gradesettings', 'scorm'));
// 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);
$mform->setAdvanced('grademethod', $cfg_scorm->grademethod_adv);
// Maximum Grade.
for ($i=0; $i<=100; $i++) {
$grades[$i] = "$i";
}
$mform->addElement('select', 'maxgrade', get_string('maximumgrade'), $grades);
$mform->setDefault('maxgrade', $cfg_scorm->maxgrade);
$mform->disabledIf('maxgrade', 'grademethod', 'eq', GRADESCOES);
$mform->setAdvanced('maxgrade', $cfg_scorm->maxgrade_adv);
$mform->addElement('header', 'othersettings', get_string('othersettings', 'scorm'));
// Max Attempts.