. /** * Grade summary. * * @package gradereport_summary * @copyright 2022 Ilya Tregubov * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(__DIR__ . '/../../../config.php'); require_once("{$CFG->libdir}/adminlib.php"); require_once($CFG->dirroot.'/grade/lib.php'); use core_reportbuilder\system_report_factory; use gradereport_summary\local\systemreports\summary; $courseid = required_param('id', PARAM_INT); if (!$course = $DB->get_record('course', ['id' => $courseid])) { throw new \moodle_exception('invalidcourseid'); } require_login($course); $context = context_course::instance($course->id); $PAGE->set_url('/grade/report/summary/index.php', ['id' => $courseid]); $PAGE->set_context($context); $PAGE->set_pagelayout('report'); $PAGE->add_body_class('limitedwidth'); require_capability('gradereport/summary:view', $context); require_capability('moodle/grade:viewall', $context); print_grade_page_head($courseid, 'report', 'summary', false, false, false, true, null, null, null, null); $report = system_report_factory::create(summary::class, context_course::instance($courseid)); echo $report->output(); echo $OUTPUT->footer();