Moodle Queries - lucaboesch/moodle-report_datawarehouse GitHub Wiki

Queries available to be run in the Moodle part of the system using the Data Warehouse report

If set up with the instructions correctly up to this point, a Moodle LMS system now, under the URL report/datawarehouse, presents the user a screen to define queries and backends.

Moodle Data Warehouse Report backend page

Queries

To add a new query, click the "Add new query" button. In the subsequent screen, in "Query", insert a query to be performed, e.g. mod_quiz_query.sql. Give the query a name and, if desired, a description and click the "Save changes" button.

Moodle Data Warehouse Report query page

The query has a minimum requirement that it must contain a field "sourcesystem" and a field "userinfodata".

Templates for additonal queries can be found in the docs/queries/ folder of this repository.

Backends

To add a new backend, click the "Add new backend" button. In the subsequent screen, in "URL" copy-paste the Object Storage Bucket Pre-Authenticated Request URL, and leave "Username" and "Password" empty. Give the backend a name and, if desired, a description and click the "Save changes" button.

Moodle Data Warehouse Report backend page

Runs

Finally, the runs combine the query to be performed with the backends to send the results to.

To trigger a run, click on "Add new run" and fill in the form in the following page and save.

Moodle Data Warehouse Report "Add new run" page

The course module ID is the integer passed as parameter when calling an activity, e.g. a quiz.

Moodle "Course module ID" explained

The course ID is the integer passed as parameter on the home site of the Moodle course your activity (in this case, the quiz) is in.

Moodle "Course ID" explained

Once the run is saved it can be kicked off by clicking "Run now".

Moodle Data Warehouse Report "Run now" button