本文整理汇总了PHP中MoodleQuickForm::disabledIf方法的典型用法代码示例。如果您正苦于以下问题:PHP MoodleQuickForm::disabledIf方法的具体用法?PHP MoodleQuickForm::disabledIf怎么用?PHP MoodleQuickForm::disabledIf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoodleQuickForm
的用法示例。
在下文中一共展示了MoodleQuickForm::disabledIf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: other_preference_fields
protected function other_preference_fields(MoodleQuickForm $mform)
{
$mform->addGroup(array($mform->createElement('advcheckbox', 'qtext', '', get_string('questiontext', 'quiz_responses')), $mform->createElement('advcheckbox', 'resp', '', get_string('response', 'quiz_responses')), $mform->createElement('advcheckbox', 'right', '', get_string('rightanswer', 'quiz_responses'))), 'coloptions', get_string('showthe', 'quiz_responses'), array(' '), false);
$mform->disabledIf('qtext', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
$mform->disabledIf('resp', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
$mform->disabledIf('right', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
}
示例2: get_settings
/**
* Get the default setting for file submission plugin
*
* @param MoodleQuickForm $mform The form to add elements to
* @return void
*/
public function get_settings(MoodleQuickForm $mform)
{
global $CFG, $COURSE;
$defaultmaxfilesubmissions = $this->get_config('maxfilesubmissions');
$defaultmaxsubmissionsizebytes = $this->get_config('maxsubmissionsizebytes');
$settings = array();
$options = array();
for ($i = 1; $i <= ASSIGNSUBMISSION_FILE_MAXFILES; $i++) {
$options[$i] = $i;
}
$mform->addElement('select', 'assignsubmission_file_maxfiles', get_string('maxfilessubmission', 'assignsubmission_file'), $options);
$mform->addHelpButton('assignsubmission_file_maxfiles', 'maxfilessubmission', 'assignsubmission_file');
$mform->setDefault('assignsubmission_file_maxfiles', $defaultmaxfilesubmissions);
$mform->disabledIf('assignsubmission_file_maxfiles', 'assignsubmission_file_enabled', 'eq', 0);
$choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes, get_config('assignsubmission_file', 'maxbytes'));
// Remove the option for 0 bytes.
unset($choices[0]);
if ($COURSE->maxbytes == 0) {
$choices = array(0 => get_string('siteuploadlimit', 'assignsubmission_file')) + $choices;
} else {
$choices = array(0 => get_string('courseuploadlimit') . ' (' . display_size($COURSE->maxbytes) . ')') + $choices;
}
$settings[] = array('type' => 'select', 'name' => 'maxsubmissionsizebytes', 'description' => get_string('maximumsubmissionsize', 'assignsubmission_file'), 'options' => $choices, 'default' => $defaultmaxsubmissionsizebytes);
$mform->addElement('select', 'assignsubmission_file_maxsizebytes', get_string('maximumsubmissionsize', 'assignsubmission_file'), $choices);
$mform->addHelpButton('assignsubmission_file_maxsizebytes', 'maximumsubmissionsize', 'assignsubmission_file');
$mform->setDefault('assignsubmission_file_maxsizebytes', $defaultmaxsubmissionsizebytes);
$mform->disabledIf('assignsubmission_file_maxsizebytes', 'assignsubmission_file_enabled', 'eq', 0);
}
示例3: other_attempt_fields
protected function other_attempt_fields(MoodleQuickForm $mform) {
if (has_capability('mod/quiz:regrade', $this->_customdata['context'])) {
$mform->addElement('advcheckbox', 'onlyregraded', '',
get_string('optonlyregradedattempts', 'quiz_overview'));
$mform->disabledIf('onlyregraded', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
}
}
示例4: add_disabled_constraints_to_form
/**
* Add the disabledIf values.
*
* @param MoodleQuickForm $mform The form to add configuration to.
*/
public static function add_disabled_constraints_to_form(\MoodleQuickForm $mform)
{
$myvalue = \tool_usertours\target::get_target_constant_for_class(get_class());
foreach (array_keys(self::$forcedsettings) as $settingname) {
$mform->disabledIf($settingname, 'targettype', 'eq', $myvalue);
}
}
示例5: add_settings_form_fields
public static function add_settings_form_fields(mod_quiz_mod_form $quizform, MoodleQuickForm $mform)
{
$config = get_config('quizaccess_offlinemode');
$mform->addElement('selectyesno', 'offlinemode_enabled', get_string('offlinemodeenabled', 'quizaccess_offlinemode'));
$mform->addHelpButton('offlinemode_enabled', 'offlinemodeenabled', 'quizaccess_offlinemode');
$mform->setDefault('offlinemode_enabled', !empty($config->defaultenabled));
$mform->setAdvanced('offlinemode_enabled', !empty($config->defaultenabled_adv));
foreach (question_engine::get_behaviour_options(null) as $behaviour => $notused) {
if (!self::is_compatible_behaviour($behaviour)) {
$mform->disabledIf('offlinemode_enabled', 'preferredbehaviour', 'eq', $behaviour);
}
}
}
示例6: get_settings
/**
* Get the default setting for OneNote submission plugin
*
* @param MoodleQuickForm $mform The form to add elements to
* @return void
*/
public function get_settings(MoodleQuickForm $mform)
{
global $CFG, $COURSE;
$defaultmaxfilesubmissions = $this->get_config('maxfilesubmissions');
$defaultmaxsubmissionsizebytes = $this->get_config('maxsubmissionsizebytes');
$settings = array();
$options = array();
for ($i = 1; $i <= \local_onenote\api\base::ASSIGNSUBMISSION_ONENOTE_MAXFILES; $i++) {
$options[$i] = $i;
}
$name = get_string('maxfilessubmission', 'assignsubmission_onenote');
$mform->addElement('select', 'assignsubmission_onenote_maxfiles', $name, $options);
$mform->addHelpButton('assignsubmission_onenote_maxfiles', 'maxfilessubmission', 'assignsubmission_onenote');
$mform->setDefault('assignsubmission_onenote_maxfiles', $defaultmaxfilesubmissions);
$mform->disabledIf('assignsubmission_onenote_maxfiles', 'assignsubmission_onenote_enabled', 'notchecked');
$choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes, get_config('assignsubmission_onenote', 'maxbytes'));
$settings[] = array('type' => 'select', 'name' => 'maxsubmissionsizebytes', 'description' => get_string('maximumsubmissionsize', 'assignsubmission_onenote'), 'options' => $choices, 'default' => $defaultmaxsubmissionsizebytes);
$name = get_string('maximumsubmissionsize', 'assignsubmission_onenote');
$mform->addElement('select', 'assignsubmission_onenote_maxsizebytes', $name, $choices);
$mform->addHelpButton('assignsubmission_onenote_maxsizebytes', 'maximumsubmissionsize', 'assignsubmission_onenote');
$mform->setDefault('assignsubmission_onenote_maxsizebytes', $defaultmaxsubmissionsizebytes);
$mform->disabledIf('assignsubmission_onenote_maxsizebytes', 'assignsubmission_onenote_enabled', 'notchecked');
}
示例7: get_settings
/**
* Get the settings for onlinetext submission plugin
*
* @param MoodleQuickForm $mform The form to add elements to
* @return void
*/
public function get_settings(MoodleQuickForm $mform)
{
global $CFG, $COURSE;
$defaultwordlimit = $this->get_config('wordlimit') == 0 ? '' : $this->get_config('wordlimit');
$defaultwordlimitenabled = $this->get_config('wordlimitenabled');
$options = array('size' => '6', 'maxlength' => '6');
$name = get_string('wordlimit', 'assignsubmission_onlinetext');
// Create a text box that can be enabled/disabled for onlinetext word limit.
$wordlimitgrp = array();
$wordlimitgrp[] = $mform->createElement('text', 'assignsubmission_onlinetext_wordlimit', '', $options);
$wordlimitgrp[] = $mform->createElement('checkbox', 'assignsubmission_onlinetext_wordlimit_enabled', '', get_string('enable'));
$mform->addGroup($wordlimitgrp, 'assignsubmission_onlinetext_wordlimit_group', $name, ' ', false);
$mform->addHelpButton('assignsubmission_onlinetext_wordlimit_group', 'wordlimit', 'assignsubmission_onlinetext');
$mform->disabledIf('assignsubmission_onlinetext_wordlimit', 'assignsubmission_onlinetext_wordlimit_enabled', 'notchecked');
// Add numeric rule to text field.
$wordlimitgrprules = array();
$wordlimitgrprules['assignsubmission_onlinetext_wordlimit'][] = array(null, 'numeric', null, 'client');
$mform->addGroupRule('assignsubmission_onlinetext_wordlimit_group', $wordlimitgrprules);
// Rest of group setup.
$mform->setDefault('assignsubmission_onlinetext_wordlimit', $defaultwordlimit);
$mform->setDefault('assignsubmission_onlinetext_wordlimit_enabled', $defaultwordlimitenabled);
$mform->setType('assignsubmission_onlinetext_wordlimit', PARAM_INT);
$mform->disabledIf('assignsubmission_onlinetext_wordlimit_group', 'assignsubmission_onlinetext_enabled', 'notchecked');
}
示例8: setupForm
/**
* Adds controls specific to this filter in the form.
*
* @param moodleform $mform a MoodleQuickForm object in which element will be added
*/
public function setupForm(MoodleQuickForm &$mform)
{
$objs = array();
$objs[] = $mform->createElement('checkbox', $this->_name, null, '');
$grp = $mform->addElement('group', $this->_name . '_grp', $this->_label, $objs, '', false);
if ($this->_advanced) {
$mform->setAdvanced($this->_name . '_grp');
}
//Check if disable if options are set. if yes then set rules
if (!empty($this->disableelements) && is_array($this->disableelements)) {
foreach ($this->disableelements as $disableelement) {
$mform->disabledIf($disableelement, $this->_name, 'checked');
}
}
}
示例9: standard_attempt_fields
protected function standard_attempt_fields(MoodleQuickForm $mform)
{
$mform->addElement('select', 'attempts', get_string('reportattemptsfrom', 'quiz'), array(quiz_attempts_report::ENROLLED_WITH => get_string('reportuserswith', 'quiz'), quiz_attempts_report::ENROLLED_WITHOUT => get_string('reportuserswithout', 'quiz'), quiz_attempts_report::ENROLLED_ALL => get_string('reportuserswithorwithout', 'quiz'), quiz_attempts_report::ALL_WITH => get_string('reportusersall', 'quiz')));
$stategroup = array($mform->createElement('advcheckbox', 'stateinprogress', '', get_string('stateinprogress', 'quiz')), $mform->createElement('advcheckbox', 'stateoverdue', '', get_string('stateoverdue', 'quiz')), $mform->createElement('advcheckbox', 'statefinished', '', get_string('statefinished', 'quiz')), $mform->createElement('advcheckbox', 'stateabandoned', '', get_string('stateabandoned', 'quiz')));
$mform->addGroup($stategroup, 'stateoptions', get_string('reportattemptsthatare', 'quiz'), array(' '), false);
$mform->setDefault('stateinprogress', 1);
$mform->setDefault('stateoverdue', 1);
$mform->setDefault('statefinished', 1);
$mform->setDefault('stateabandoned', 1);
$mform->disabledIf('stateinprogress', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
$mform->disabledIf('stateoverdue', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
$mform->disabledIf('statefinished', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
$mform->disabledIf('stateabandoned', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
if (quiz_report_can_filter_only_graded($this->_customdata['quiz'])) {
$gm = html_writer::tag('span', quiz_get_grading_option_name($this->_customdata['quiz']->grademethod), array('class' => 'highlight'));
$mform->addElement('advcheckbox', 'onlygraded', get_string('reportshowonly', 'quiz'), get_string('optonlygradedattempts', 'quiz_overview', $gm));
$mform->disabledIf('onlygraded', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
$mform->disabledIf('onlygraded', 'statefinished', 'notchecked');
}
}
示例10: workshop_reset_course_form_definition
/**
* Extends the course reset form with workshop specific settings.
*
* @param MoodleQuickForm $mform
*/
function workshop_reset_course_form_definition($mform) {
$mform->addElement('header', 'workshopheader', get_string('modulenameplural', 'mod_workshop'));
$mform->addElement('advcheckbox', 'reset_workshop_submissions', get_string('resetsubmissions', 'mod_workshop'));
$mform->addHelpButton('reset_workshop_submissions', 'resetsubmissions', 'mod_workshop');
$mform->addElement('advcheckbox', 'reset_workshop_assessments', get_string('resetassessments', 'mod_workshop'));
$mform->addHelpButton('reset_workshop_assessments', 'resetassessments', 'mod_workshop');
$mform->disabledIf('reset_workshop_assessments', 'reset_workshop_submissions', 'checked');
$mform->addElement('advcheckbox', 'reset_workshop_phase', get_string('resetphase', 'mod_workshop'));
$mform->addHelpButton('reset_workshop_phase', 'resetphase', 'mod_workshop');
}
示例11: edit_instance_form
/**
* Add elements to the edit instance form.
*
* @param stdClass $instance
* @param MoodleQuickForm $mform
* @param context $context
* @return bool
*/
public function edit_instance_form($instance, MoodleQuickForm $mform, $context)
{
global $DB;
$nameattribs = array('size' => '20', 'maxlength' => '255');
$mform->addElement('text', 'name', get_string('custominstancename', 'enrol'), $nameattribs);
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'server');
$tools = array();
$tools[$context->id] = get_string('course');
$modinfo = get_fast_modinfo($instance->courseid);
$mods = $modinfo->get_cms();
foreach ($mods as $mod) {
$tools[$mod->context->id] = format_string($mod->name);
}
$mform->addElement('select', 'contextid', get_string('tooltobeprovided', 'enrol_lti'), $tools);
$mform->setDefault('contextid', $context->id);
$mform->addElement('duration', 'enrolperiod', get_string('enrolperiod', 'enrol_lti'), array('optional' => true, 'defaultunit' => DAYSECS));
$mform->setDefault('enrolperiod', 0);
$mform->addHelpButton('enrolperiod', 'enrolperiod', 'enrol_lti');
$mform->addElement('date_time_selector', 'enrolstartdate', get_string('enrolstartdate', 'enrol_lti'), array('optional' => true));
$mform->setDefault('enrolstartdate', 0);
$mform->addHelpButton('enrolstartdate', 'enrolstartdate', 'enrol_lti');
$mform->addElement('date_time_selector', 'enrolenddate', get_string('enrolenddate', 'enrol_lti'), array('optional' => true));
$mform->setDefault('enrolenddate', 0);
$mform->addHelpButton('enrolenddate', 'enrolenddate', 'enrol_lti');
$mform->addElement('text', 'maxenrolled', get_string('maxenrolled', 'enrol_lti'));
$mform->setDefault('maxenrolled', 0);
$mform->addHelpButton('maxenrolled', 'maxenrolled', 'enrol_lti');
$mform->setType('maxenrolled', PARAM_INT);
$assignableroles = get_assignable_roles($context);
$mform->addElement('select', 'roleinstructor', get_string('roleinstructor', 'enrol_lti'), $assignableroles);
$mform->setDefault('roleinstructor', '3');
$mform->addHelpButton('roleinstructor', 'roleinstructor', 'enrol_lti');
$mform->addElement('select', 'rolelearner', get_string('rolelearner', 'enrol_lti'), $assignableroles);
$mform->setDefault('rolelearner', '5');
$mform->addHelpButton('rolelearner', 'rolelearner', 'enrol_lti');
$mform->addElement('header', 'remotesystem', get_string('remotesystem', 'enrol_lti'));
$mform->addElement('text', 'secret', get_string('secret', 'enrol_lti'), 'maxlength="64" size="25"');
$mform->setType('secret', PARAM_ALPHANUM);
$mform->setDefault('secret', random_string(32));
$mform->addHelpButton('secret', 'secret', 'enrol_lti');
$mform->addRule('secret', get_string('required'), 'required');
$mform->addElement('selectyesno', 'gradesync', get_string('gradesync', 'enrol_lti'));
$mform->setDefault('gradesync', 1);
$mform->addHelpButton('gradesync', 'gradesync', 'enrol_lti');
$mform->addElement('selectyesno', 'gradesynccompletion', get_string('requirecompletion', 'enrol_lti'));
$mform->setDefault('gradesynccompletion', 0);
$mform->disabledIf('gradesynccompletion', 'gradesync', 0);
$mform->addElement('selectyesno', 'membersync', get_string('membersync', 'enrol_lti'));
$mform->setDefault('membersync', 1);
$mform->addHelpButton('membersync', 'membersync', 'enrol_lti');
$options = array();
$options[\enrol_lti\helper::MEMBER_SYNC_ENROL_AND_UNENROL] = get_string('membersyncmodeenrolandunenrol', 'enrol_lti');
$options[\enrol_lti\helper::MEMBER_SYNC_ENROL_NEW] = get_string('membersyncmodeenrolnew', 'enrol_lti');
$options[\enrol_lti\helper::MEMBER_SYNC_UNENROL_MISSING] = get_string('membersyncmodeunenrolmissing', 'enrol_lti');
$mform->addElement('select', 'membersyncmode', get_string('membersyncmode', 'enrol_lti'), $options);
$mform->setDefault('membersyncmode', \enrol_lti\helper::MEMBER_SYNC_ENROL_AND_UNENROL);
$mform->addHelpButton('membersyncmode', 'membersyncmode', 'enrol_lti');
$mform->disabledIf('membersyncmode', 'membersync', 0);
$mform->addElement('header', 'defaultheader', get_string('userdefaultvalues', 'enrol_lti'));
$emaildisplay = get_config('enrol_lti', 'emaildisplay');
$choices = array(0 => get_string('emaildisplayno'), 1 => get_string('emaildisplayyes'), 2 => get_string('emaildisplaycourse'));
$mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
$mform->setDefault('maildisplay', $emaildisplay);
$city = get_config('enrol_lti', 'city');
$mform->addElement('text', 'city', get_string('city'), 'maxlength="100" size="25"');
$mform->setType('city', PARAM_TEXT);
$mform->setDefault('city', $city);
$country = get_config('enrol_lti', 'country');
$countries = array('' => get_string('selectacountry') . '...') + get_string_manager()->get_list_of_countries();
$mform->addElement('select', 'country', get_string('selectacountry'), $countries);
$mform->setDefault('country', $country);
$mform->setAdvanced('country');
$timezone = get_config('enrol_lti', 'timezone');
$choices = core_date::get_list_of_timezones(null, true);
$mform->addElement('select', 'timezone', get_string('timezone'), $choices);
$mform->setDefault('timezone', $timezone);
$mform->setAdvanced('timezone');
$lang = get_config('enrol_lti', 'lang');
$mform->addElement('select', 'lang', get_string('preferredlanguage'), get_string_manager()->get_list_of_translations());
$mform->setDefault('lang', $lang);
$mform->setAdvanced('lang');
$institution = get_config('enrol_lti', 'institution');
$mform->addElement('text', 'institution', get_string('institution'), 'maxlength="40" size="25"');
$mform->setType('institution', core_user::get_property_type('institution'));
$mform->setDefault('institution', $institution);
$mform->setAdvanced('institution');
// Check if we are editing an instance.
if (!empty($instance->id)) {
// Get the details from the enrol_lti_tools table.
$ltitool = $DB->get_record('enrol_lti_tools', array('enrolid' => $instance->id), '*', MUST_EXIST);
$mform->addElement('hidden', 'toolid');
//.........这里部分代码省略.........
示例12: course_edit_form
/**
* Adds enrol instance UI to course edit form
*
* @param object $instance enrol instance or null if does not exist yet
* @param MoodleQuickForm $mform
* @param object $data
* @param object $context context of existing course or parent category if course does not exist
* @return void
*/
public function course_edit_form($instance, MoodleQuickForm $mform, $data, $context)
{
$i = isset($instance->id) ? $instance->id : 0;
if (!$i and !$this->get_config('defaultenrol')) {
return;
}
$header = $this->get_instance_name($instance);
$config = has_capability('enrol/guest:config', $context);
$mform->addElement('header', 'enrol_guest_header_' . $i, $header);
$options = array(ENROL_INSTANCE_ENABLED => get_string('yes'), ENROL_INSTANCE_DISABLED => get_string('no'));
$mform->addElement('select', 'enrol_guest_status_' . $i, get_string('status', 'enrol_guest'), $options);
$mform->addHelpButton('enrol_guest_status_' . $i, 'status', 'enrol_guest');
$mform->setDefault('enrol_guest_status_' . $i, $this->get_config('status'));
$mform->setAdvanced('enrol_guest_status_' . $i, $this->get_config('status_adv'));
if (!$config) {
$mform->hardFreeze('enrol_guest_status_' . $i);
}
$mform->addElement('passwordunmask', 'enrol_guest_password_' . $i, get_string('password', 'enrol_guest'));
$mform->addHelpButton('enrol_guest_password_' . $i, 'password', 'enrol_guest');
if (!$config) {
$mform->hardFreeze('enrol_guest_password_' . $i);
} else {
$mform->disabledIf('enrol_guest_password_' . $i, 'enrol_guest_status_' . $i, 'noteq', ENROL_INSTANCE_ENABLED);
}
// now add all values from enrol table
if ($instance) {
foreach ($instance as $key => $val) {
$data->{'enrol_guest_' . $key . '_' . $i} = $val;
}
}
}
示例13: get_settings
/**
* Get the default setting for feedback comments plugin
*
* @param MoodleQuickForm $mform The form to add elements to
* @return void
*/
public function get_settings(MoodleQuickForm $mform) {
$default = $this->get_config('commentinline');
$mform->addElement('selectyesno',
'assignfeedback_comments_commentinline',
get_string('commentinline', 'assignfeedback_comments'));
$mform->addHelpButton('assignfeedback_comments_commentinline', 'commentinline', 'assignfeedback_comments');
$mform->setDefault('assignfeedback_comments_commentinline', $default);
// Disable comment online if comment feedback plugin is disabled.
$mform->disabledIf('assignfeedback_comments_commentinline', 'assignfeedback_comments_enabled', 'notchecked');
}
示例14: get_settings
/**
* Get the settings for Youtube submission plugin form
*
* @global stdClass $CFG
* @global stdClass $COURSE
* @param MoodleQuickForm $mform The form to add elements to
* @return void
*/
public function get_settings(MoodleQuickForm $mform)
{
global $CFG, $COURSE;
//get default display size for single player screens
$displaysizesingle_default = $this->get_config('displaysizesingle');
if ($displaysizesingle_default == null) {
$displaysizesingle_default = get_config('assignsubmission_youtube', 'displaysize_single');
}
//get default display size for screens with lists of players
$displaysizelist_default = $this->get_config('displaysizelist');
if ($displaysizelist_default == null) {
$displaysizelist_default = get_config('assignsubmission_youtube', 'displaysize_list');
}
/*
//get default authentication type
$authtype_default = $this->get_config('authtype');
if(!$authtype_default){
$authtype_default = get_config('assignsubmission_youtube', 'authtype');
}
*/
//The size of the youtube player on the various screens
$displaysizes = array('0' => new lang_string('linkonly', 'assignsubmission_youtube'), '1' => new lang_string('moodledefault', 'assignsubmission_youtube'), '160' => '160x120', '320' => '320x240', '480' => '480x360', '640' => '640x480', '800' => '800x600', '1024' => '1024x768');
//add the screen size selectors
//single
$mform->addElement('select', 'assignsubmission_youtube_displaysizesingle', get_string('displaysizesingle', 'assignsubmission_youtube'), $displaysizes);
$mform->setDefault('assignsubmission_youtube_displaysizesingle', $displaysizesingle_default);
$mform->disabledIf('assignsubmission_youtube_displaysizesingle', 'assignsubmission_youtube_enabled', 'eq', 0);
//list
$mform->addElement('select', 'assignsubmission_youtube_displaysizelist', get_string('displaysizelist', 'assignsubmission_youtube'), $displaysizes);
$mform->setDefault('assignsubmission_youtube_displaysizelist', $displaysizelist_default);
$mform->disabledIf('assignsubmission_youtube_displaysizelist', 'assignsubmission_youtube_enabled', 'eq', 0);
//The authentication type, master user or student by student
/*
$authoptions = array('byuser' => new lang_string('byuser', 'assignsubmission_youtube'),
'bymaster' => new lang_string('bymaster', 'assignsubmission_youtube'));
$mform->addElement('select', 'assignsubmission_youtube_authtype',
get_string('authtype', 'assignsubmission_youtube'), $authoptions);
$mform->setDefault('assignsubmission_youtube_authtype', $authtype_default);
$mform->disabledIf('assignsubmission_youtube_authtype', 'assignsubmission_youtube_enabled', 'eq', 0);
*/
}
示例15: add_settings_form_fields
public static function add_settings_form_fields(mod_quiz_mod_form $quizform, MoodleQuickForm $mform)
{
global $CFG;
// Allow to enable the access rule only if the Mobile services are enabled.
if ($CFG->enablemobilewebservice) {
$mform->addElement('selectyesno', 'allowofflineattempts', get_string('allowofflineattempts', 'quizaccess_offlineattempts'));
$mform->addHelpButton('allowofflineattempts', 'allowofflineattempts', 'quizaccess_offlineattempts');
$mform->setDefault('allowofflineattempts', 0);
$mform->setAdvanced('allowofflineattempts');
$mform->disabledIf('allowofflineattempts', 'timelimit[number]', 'neq', 0);
$mform->disabledIf('allowofflineattempts', 'subnet', 'neq', '');
}
}