MDL-38359 assign: Add support for admin defaults for marking workflow settings

This commit is contained in:
Damyon Wiese 2013-06-11 14:26:33 +08:00
parent f8d107b3a8
commit bb6471aa88
2 changed files with 24 additions and 5 deletions

View File

@ -179,14 +179,14 @@ class mod_assign_mod_form extends moodleform_mod {
$mform->freeze('blindmarking');
}
$mform->addElement('advcheckbox', 'markingworkflow', get_string('markingworkflow', 'assign'), '', null, array(0, 1));
$name = get_string('markingworkflow', 'assign');
$mform->addElement('selectyesno', 'markingworkflow', $name);
$mform->addHelpButton('markingworkflow', 'markingworkflow', 'assign');
$mform->setDefault('markingworkflow', 0);
$mform->addElement('advcheckbox', 'markingallocation', get_string('markingallocation', 'assign'), '', null, array(0, 1));
$name = get_string('markingallocation', 'assign');
$mform->addElement('selectyesno', 'markingallocation', $name);
$mform->addHelpButton('markingallocation', 'markingallocation', 'assign');
$mform->setDefault('markingallocation', 0);
$mform->disabledIf('markingallocation', 'markingworkflow', 'notchecked');
$mform->disabledIf('markingallocation', 'markingworkflow', 'eq', 0);
$this->standard_coursemodule_elements();
$this->apply_admin_defaults();

View File

@ -224,4 +224,23 @@ if ($ADMIN->fulltree) {
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
$name = new lang_string('markingworkflow', 'mod_assign');
$description = new lang_string('markingworkflow_help', 'mod_assign');
$setting = new admin_setting_configcheckbox('assign/markingworkflow',
$name,
$description,
0);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
$name = new lang_string('markingallocation', 'mod_assign');
$description = new lang_string('markingallocation_help', 'mod_assign');
$setting = new admin_setting_configcheckbox('assign/markingallocation',
$name,
$description,
0);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
}