mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-80766 gradereport_grader: omit max constraint for unlimited grades.
This commit is contained in:
parent
f30110b5eb
commit
717a616030
@ -1096,7 +1096,9 @@ class grade_report_grader extends grade_report {
|
||||
// If we're rendering this as a number field, set min/max attributes, if applicable.
|
||||
if ($context->isnumeric) {
|
||||
$context->minvalue = $item->grademin ?? null;
|
||||
$context->maxvalue = $item->grademax ?? null;
|
||||
if (empty($CFG->unlimitedgrades)) {
|
||||
$context->maxvalue = $item->grademax ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
$value = format_float($gradeval, $decimalpoints);
|
||||
|
@ -113,6 +113,8 @@ class finalgrade extends grade_attribute_format implements unique_value, be_disa
|
||||
* @return element
|
||||
*/
|
||||
public function determine_format(): element {
|
||||
global $CFG;
|
||||
|
||||
if ($this->grade->grade_item->load_scale()) {
|
||||
$scale = $this->grade->grade_item->load_scale();
|
||||
|
||||
@ -153,7 +155,7 @@ class finalgrade extends grade_attribute_format implements unique_value, be_disa
|
||||
|
||||
// Max attribute.
|
||||
$maxvalue = null;
|
||||
if (isset($gradeitem->grademax)) {
|
||||
if (isset($gradeitem->grademax) && empty($CFG->unlimitedgrades)) {
|
||||
$maxvalue = format_float($gradeitem->grademax, $decimals);
|
||||
}
|
||||
$textattribute->set_max($maxvalue);
|
||||
|
@ -27,6 +27,9 @@
|
||||
"extraclasses": "statusicons",
|
||||
"value": "Text information",
|
||||
"tabindex": "1",
|
||||
"isnumeric": "1",
|
||||
"minvalue": "0",
|
||||
"maxvalue": "10",
|
||||
"name": "grade[313][624]"
|
||||
}
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user