diff --git a/config-dist.php b/config-dist.php index c0fb1163afb..833bc4bf68f 100644 --- a/config-dist.php +++ b/config-dist.php @@ -789,8 +789,14 @@ $CFG->admin = 'admin'; // polling should be done and latest update retrieved. // If no value is set, then it will default to 5 seconds. // -// $CFG->progresspollinterval = 5; - +// $CFG->progresspollinterval = 5; +// +// 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!!! //========================================================================= diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index c0b1a5b7bd5..291453128a4 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -547,7 +547,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())); } /**