diff --git a/grade/edit/tree/category_form.php b/grade/edit/tree/category_form.php index 98a18a45d09..ef6ada4b10b 100644 --- a/grade/edit/tree/category_form.php +++ b/grade/edit/tree/category_form.php @@ -211,6 +211,8 @@ class edit_category_form extends moodleform { } $mform->addElement('select', 'grade_item_display', get_string('gradedisplaytype', 'grades'), $options); $mform->addHelpButton('grade_item_display', 'gradedisplaytype', 'grades'); + $mform->disabledIf('grade_item_display', 'grade_item_gradetype', 'in', + array(GRADE_TYPE_TEXT, GRADE_TYPE_NONE)); $default_gradedecimals = grade_get_setting($COURSE->id, 'decimalpoints', $CFG->grade_decimalpoints); $options = array(-1=>get_string('defaultprev', 'grades', $default_gradedecimals), 0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5); @@ -218,6 +220,8 @@ class edit_category_form extends moodleform { $mform->addHelpButton('grade_item_decimals', 'decimalpoints', 'grades'); $mform->setDefault('grade_item_decimals', -1); $mform->disabledIf('grade_item_decimals', 'grade_item_display', 'eq', GRADE_DISPLAY_TYPE_LETTER); + $mform->disabledIf('grade_item_decimals', 'grade_item_gradetype', 'in', + array(GRADE_TYPE_TEXT, GRADE_TYPE_NONE)); if ($default_gradedisplaytype == GRADE_DISPLAY_TYPE_LETTER) { $mform->disabledIf('grade_item_decimals', 'grade_item_display', "eq", GRADE_DISPLAY_TYPE_DEFAULT); diff --git a/grade/edit/tree/item_form.php b/grade/edit/tree/item_form.php index 5dfb8e95136..f762cc7e9c8 100644 --- a/grade/edit/tree/item_form.php +++ b/grade/edit/tree/item_form.php @@ -166,6 +166,7 @@ class edit_item_form extends moodleform { } $mform->addElement('select', 'display', get_string('gradedisplaytype', 'grades'), $options); $mform->addHelpButton('display', 'gradedisplaytype', 'grades'); + $mform->disabledIf('display', 'gradetype', 'eq', GRADE_TYPE_TEXT); $default_gradedecimals = grade_get_setting($COURSE->id, 'decimalpoints', $CFG->grade_decimalpoints); $options = array(-1=>get_string('defaultprev', 'grades', $default_gradedecimals), 0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5); @@ -176,6 +177,7 @@ class edit_item_form extends moodleform { if ($default_gradedisplaytype == GRADE_DISPLAY_TYPE_LETTER) { $mform->disabledIf('decimals', 'display', "eq", GRADE_DISPLAY_TYPE_DEFAULT); } + $mform->disabledIf('decimals', 'gradetype', 'eq', GRADE_TYPE_TEXT); /// hiding if ($item->cancontrolvisibility) {