Moodle plugins directory: Ad-hoc database queries | Moodle.org
Ad-hoc database queries
Reports ::: report_customsql
Maintained by Tim Hunt, Mahmoud Kassaei, Anupama Sarjoshi
This report plugin allows Administrators to set up arbitrary database queries
to act as ad-hoc reports. Reports can be of two types, either run on demand,
or scheduled to run automatically. Other users with the right capability can
go in and see a list of queries that they have access to. Results can be viewed
on-screen or downloaded as CSV.
Latest release:
4486 sites
1k downloads
167 fans
Current versions available: 10
This report, created by The Open University, lets Administrators set up arbitrary SQL select queries that anyone with the appropriate permissions can then run. Reports can be set to be runnable on-demand, or automatically run weekly or monthly.
The results are displayed as a fairly plain HTML table, and can also be downloaded as CSV.
The idea is that this lets you quickly set up ad-hoc reports, without having to create a whole new admin report plugin.
Contributors
Tim Hunt (Lead maintainer)
Mahmoud Kassaei: Developer
Anupama Sarjoshi: Tester & Developer
Please login to view contributors details and/or to contact them
For reference, all my ad-hoc scheduled tasks run at 10 minutes after every hour and all reports have the "Scheduled, Daily" option.
Question 1 - if a report is set to "Scheduled, daily" and it fails to run for some reason at, say, 7:10am, how would I "reset" it so that scheduled tasks can run it again later the same day?
Question 2 - what is the latest time I can edit a report, and change the time, so that it is still run? For example, if I edit a scheduled report that was scheduled to run at 7:10am and save it at 7:08am, will it be run at 7:10am?
Just wondering for debugging purposes. Thanks again for a great plugin that, quite frankly, my group could not do without.
Richard
I am afraid that the only way to find out exactly how it works is to read the code starting at https://github.com/moodleou/moodle-report_customsql/blob/master/classes/task/run_reports.php. (It is not particularly complicated.)
You also need to remember that these reports live in the System context, and only a few roles are assigned in that context. (E.g. Teacher role only exists inside a particular course, and these reports are outside all courses.)
Has some setting changed that I need to review?
Please update so we can schedule automatic running of reports but we can pick the different days to run. It is ok if I have to schedule the same report twice to run once on the 5th and the second copy on the 20th (for example).