diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index 9be062ec4a0..043fe5cf279 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -1091,7 +1091,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); diff --git a/grade/report/singleview/classes/local/ui/finalgrade.php b/grade/report/singleview/classes/local/ui/finalgrade.php index 075f56b4c8d..a7a143ef508 100644 --- a/grade/report/singleview/classes/local/ui/finalgrade.php +++ b/grade/report/singleview/classes/local/ui/finalgrade.php @@ -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); diff --git a/grade/templates/grades/grader/input.mustache b/grade/templates/grades/grader/input.mustache index 86919297e3d..70c2d184175 100644 --- a/grade/templates/grades/grader/input.mustache +++ b/grade/templates/grades/grader/input.mustache @@ -27,6 +27,9 @@ "extraclasses": "statusicons", "value": "Text information", "tabindex": "1", + "isnumeric": "1", + "minvalue": "0", + "maxvalue": "10", "name": "grade[313][624]" } }}