diff --git a/config-dist.php b/config-dist.php index ab1d7adcc30..b08a8fffe2a 100644 --- a/config-dist.php +++ b/config-dist.php @@ -789,17 +789,23 @@ $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; // // Default question bank module // -// $CFG->corequestion_defaultqbankmod = 'qbank' +// $CFG->corequestion_defaultqbankmod = 'qbank' // // Question banks are only stored at activity module context and this setting defines which module type will // be used for creating question banks by default. This is in circumstances such as quiz backup & restores when // no target context can be found and the system needs to create a question bank to store the categories and questions. - - +// +// 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 3bf70616862..dec90d55abd 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())); } /**