. require_once(__DIR__.'../../config.php'); $id = required_param('id', PARAM_INT); // Course ID. // Ensure that the course specified is valid if (!$course = $DB->get_record('course', array('id' => $id))) { throw new moodle_exception('Course ID is incorrect'); }