Merge branch 'MDL-83297-maxgradesperpage-404' of https://github.com/dragos5436/moodle into MOODLE_404_STABLE

This commit is contained in:
Huong Nguyen
2025-01-30 09:29:09 +07:00
2 changed files with 16 additions and 2 deletions
+7 -1
View File
@@ -773,7 +773,13 @@ $CFG->admin = 'admin';
// Defaults to 60 minutes.
//
// $CFG->enrolments_sync_interval = 3600
//
// Set limit for grade items that can be shown on a single page of the grader
// report. Browsers struggle when the number of grade items is very large and
// one tries to view all students.
//
// $CFG->maxgradesperpage = 200000;
//
//=========================================================================
// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!
//=========================================================================
+9 -1
View File
@@ -543,7 +543,15 @@ class grade_report_grader extends grade_report {
* @return int
*/
public function get_max_students_per_page(): int {
return round(static::MAX_GRADES_PER_PAGE / count($this->get_allgradeitems()));
global $CFG;
if (isset($CFG->maxgradesperpage) && clean_param($CFG->maxgradesperpage, PARAM_INT) > 0) {
$maxgradesperpage = $CFG->maxgradesperpage;
} else {
$maxgradesperpage = self::MAX_GRADES_PER_PAGE;
}
return round($maxgradesperpage / count($this->get_allgradeitems()));
}
/**