Merge branch 'MDL-83297-maxgradesperpage-404' of https://github.com/dragos5436/moodle into MOODLE_404_STABLE
This commit is contained in:
+7
-1
@@ -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!!!
|
||||
//=========================================================================
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user