From 044a298e6f5c7919160a629c2763600a055e8269 Mon Sep 17 00:00:00 2001 From: John Okely Date: Wed, 15 Oct 2014 15:42:51 +0800 Subject: [PATCH] MDL-47392 core_grades: Consolidate grade item weight setting location --- grade/edit/tree/category_form.php | 16 ++++++++-------- grade/edit/tree/item_form.php | 16 ++++++++-------- grade/edit/tree/outcomeitem_form.php | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/grade/edit/tree/category_form.php b/grade/edit/tree/category_form.php index 6a155fded5d..25ca2659c63 100644 --- a/grade/edit/tree/category_form.php +++ b/grade/edit/tree/category_form.php @@ -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)); diff --git a/grade/edit/tree/item_form.php b/grade/edit/tree/item_form.php index a74120fdc0c..1c209f4815c 100644 --- a/grade/edit/tree/item_form.php +++ b/grade/edit/tree/item_form.php @@ -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)); diff --git a/grade/edit/tree/outcomeitem_form.php b/grade/edit/tree/outcomeitem_form.php index 9428e5be262..aeece1fc75e 100644 --- a/grade/edit/tree/outcomeitem_form.php +++ b/grade/edit/tree/outcomeitem_form.php @@ -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 = '';