This is a must-have plugin that will make your life easier.
Install it on your staging and production servers if required.
The plugin allows you to run SQL queries on your database to check or report on data.
Site administration > Reports > Ad-hoc database queries
Once you have installed the plugin you can create your own SQL scripts.
These SQL scripts can read data from the Moodle database.
Thee scripts look like this.
SELECT USER.firstname AS Firstname, USER.lastname AS Lastname, USER.email AS Email, USER.city AS City, course.fullname AS Course ,(SELECT name FROM prefix_role WHERE id=asg.roleid) FROM prefix_user AS USER, prefix_course AS course, prefix_role_assignments AS asg INNER JOIN prefix_context AS context ON asg.contextid=context.id WHERE context.contextlevel = 50 AND USER.id=asg.userid AND context.instanceid=course.id
This particular script reports a site global list of all users enrolled in each course
By learning about the database structure and learning how to crate SQL scripts, you can interrogate the Moodle database and produce your own custom reports.
See https://docs.moodle.org/37/en/Custom_SQL_queries_report for more details.
You may not need this straight away, but have it ready when the time comes.
Example SQL can be found here: https://docs.moodle.org/22/en/ad-hoc_contributed_reports
Because there is so much detail in what you need to do, I will put this all in a video for you.
Also, If you download the Admin guide from below – I will send you an email as soon as the video is available.
I will put together an example of how to use this plugin in the next few weeks.
Please subscribe to the YouTube channel to be notified when it is made available or download the Admin Hints Guide below to receive an email when the video is released.