I am using Moodle 3.1+. I want to get the list of all the courses created by a user. I have checked the database schema but couldn't find any relation between user and course. Is it possible to get the courses created by a user? I have searched the moodle code and find the below piece of code in course/lib.php
$logmanger = get_log_manager();
$readers = $logmanger->get_readers('\core\log\sql_reader');
$reader = reset($readers);
if (empty($reader)) {
return false; // No log reader found.
}
// A proper reader.
$select = "userid = :userid AND courseid = :courseid AND eventname = :eventname AND timecreated > :since";
$params = array('userid' => $USER->id, 'since' => $since, 'courseid' => $course->id, 'eventname' => '\core\event\course_created');
return (bool)$reader->get_events_select_count($select, $params);
Is it possible to get the course created by a user using system log? Please help.
Check "All Logs" for that particular user.