Merge branch 'MDL-80766-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE

This commit is contained in:
Jun Pataleta
2024-02-13 15:33:59 +08:00
3 changed files with 9 additions and 2 deletions
+3 -1
View File
@@ -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);
@@ -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]"
}
}}