MDL-46824 core_grades: Prevent user from using drop lowest/keep highest
Part of: MDL-46576
This commit is contained in:
committed by
Adrian Greeve
parent
4272386a7d
commit
40544c9b58
@@ -331,6 +331,18 @@ class edit_category_form extends moodleform {
|
||||
|
||||
}
|
||||
|
||||
// Prevent the user from using drop lowest/keep highest when the aggregation method cannot handle it.
|
||||
if (!$grade_category->can_apply_limit_rules()) {
|
||||
if ($mform->elementExists('keephigh')) {
|
||||
$mform->setConstant('keephigh', 0);
|
||||
$mform->hardFreeze('keephigh');
|
||||
}
|
||||
if ($mform->elementExists('droplow')) {
|
||||
$mform->setConstant('droplow', 0);
|
||||
$mform->hardFreeze('droplow');
|
||||
}
|
||||
}
|
||||
|
||||
if ($grade_item->is_calculated()) {
|
||||
// following elements are ignored when calculation formula used
|
||||
if ($mform->elementExists('aggregation')) {
|
||||
|
||||
Reference in New Issue
Block a user