MDL-47392 core_grades: Consolidate grade item weight setting location

This commit is contained in:
John Okely 2014-10-15 15:42:51 +08:00
parent 2fdb4c6b00
commit 044a298e6f
3 changed files with 24 additions and 24 deletions

View File

@ -161,14 +161,6 @@ class edit_category_form extends moodleform {
$mform->disabledIf('grade_item_grademin', 'aggregation', 'eq', GRADE_AGGREGATE_SUM);
}
$mform->addElement('advcheckbox', 'grade_item_weightoverride', get_string('adjustedweight', 'grades'));
$mform->addHelpButton('grade_item_weightoverride', 'weightoverride', 'grades');
$mform->addElement('text', 'grade_item_aggregationcoef2', get_string('weight', 'grades'));
$mform->addHelpButton('grade_item_aggregationcoef2', 'weight', 'grades');
$mform->setType('grade_item_aggregationcoef2', PARAM_RAW);
$mform->disabledIf('grade_item_aggregationcoef2', 'grade_item_weightoverride');
$mform->addElement('text', 'grade_item_gradepass', get_string('gradepass', 'grades'));
$mform->setType('grade_item_gradepass', PARAM_RAW);
$mform->addHelpButton('grade_item_gradepass', 'gradepass', 'grades');
@ -228,6 +220,14 @@ class edit_category_form extends moodleform {
/// parent category related settings
$mform->addElement('header', 'headerparent', get_string('parentcategory', 'grades'));
$mform->addElement('advcheckbox', 'grade_item_weightoverride', get_string('adjustedweight', 'grades'));
$mform->addHelpButton('grade_item_weightoverride', 'weightoverride', 'grades');
$mform->addElement('text', 'grade_item_aggregationcoef2', get_string('weight', 'grades'));
$mform->addHelpButton('grade_item_aggregationcoef2', 'weight', 'grades');
$mform->setType('grade_item_aggregationcoef2', PARAM_RAW);
$mform->disabledIf('grade_item_aggregationcoef2', 'grade_item_weightoverride');
$options = array();
$default = -1;
$categories = grade_category::fetch_all(array('courseid'=>$COURSE->id));

View File

@ -97,14 +97,6 @@ class edit_item_form extends moodleform {
$mform->setType('grademin', PARAM_RAW);
}
$mform->addElement('advcheckbox', 'weightoverride', get_string('adjustedweight', 'grades'));
$mform->addHelpButton('weightoverride', 'weightoverride', 'grades');
$mform->addElement('text', 'aggregationcoef2', get_string('weight', 'grades'));
$mform->addHelpButton('aggregationcoef2', 'weight', 'grades');
$mform->setType('aggregationcoef2', PARAM_RAW);
$mform->disabledIf('aggregationcoef2', 'weightoverride');
$mform->addElement('text', 'gradepass', get_string('gradepass', 'grades'));
$mform->addHelpButton('gradepass', 'gradepass', 'grades');
$mform->disabledIf('gradepass', 'gradetype', 'eq', GRADE_TYPE_NONE);
@ -184,6 +176,14 @@ class edit_item_form extends moodleform {
/// parent category related settings
$mform->addElement('header', 'headerparent', get_string('parentcategory', 'grades'));
$mform->addElement('advcheckbox', 'weightoverride', get_string('adjustedweight', 'grades'));
$mform->addHelpButton('weightoverride', 'weightoverride', 'grades');
$mform->addElement('text', 'aggregationcoef2', get_string('weight', 'grades'));
$mform->addHelpButton('aggregationcoef2', 'weight', 'grades');
$mform->setType('aggregationcoef2', PARAM_RAW);
$mform->disabledIf('aggregationcoef2', 'weightoverride');
$options = array();
$coefstring = '';
$categories = grade_category::fetch_all(array('courseid'=>$COURSE->id));

View File

@ -73,14 +73,6 @@ class edit_outcomeitem_form extends moodleform {
$mform->addHelpButton('cmid', 'linkedactivity', 'grades');
$mform->setDefault('cmid', 0);
$mform->addElement('advcheckbox', 'weightoverride', get_string('adjustedweight', 'grades'));
$mform->addHelpButton('weightoverride', 'weightoverride', 'grades');
$mform->addElement('text', 'aggregationcoef2', get_string('weight', 'grades'));
$mform->addHelpButton('aggregationcoef2', 'weight', 'grades');
$mform->setType('aggregationcoef2', PARAM_RAW);
$mform->disabledIf('aggregationcoef2', 'weightoverride');
/// hiding
/// advcheckbox is not compatible with disabledIf !!
$mform->addElement('checkbox', 'hidden', get_string('hidden', 'grades'));
@ -96,6 +88,14 @@ class edit_outcomeitem_form extends moodleform {
/// parent category related settings
$mform->addElement('header', 'headerparent', get_string('parentcategory', 'grades'));
$mform->addElement('advcheckbox', 'weightoverride', get_string('adjustedweight', 'grades'));
$mform->addHelpButton('weightoverride', 'weightoverride', 'grades');
$mform->addElement('text', 'aggregationcoef2', get_string('weight', 'grades'));
$mform->addHelpButton('aggregationcoef2', 'weight', 'grades');
$mform->setType('aggregationcoef2', PARAM_RAW);
$mform->disabledIf('aggregationcoef2', 'weightoverride');
$options = array();
$default = '';
$coefstring = '';