Moodle 3.8.1 Face-to-Face SQL query

Moodle 3.8.1 Face-to-Face SQL query

by Alan Robinson -
Number of replies: 0

Hi, sorry if this has been asked, I have searched and can't find anything relevant.

I work in a hospital in the UK, and have a couple of major software deployments later on this year.  I've got E-Learning added and mandatory competency skills checks scheduled using the Face-to-face module starting in October.

I have to report to the Trust board on a fortnightly basis.

Until the competency checks have begun and we start marking students as having completed the check, I need to report on the face-to-face bookings made.

Every User in the course (1500+) is enrolled as a student and added to a group (so I can track where they actually work and their work role, (ie., central theatres, Practitioner).

I use Configurable Reports in my Moodle instance, and have a lovely report that I put together to show every enrolled user, their group, and whether they have been marked as competent (completed by a trainer) when they have successfully completed the mandatory skills check.

This report works beautifully.

Until we start doing the competency skills checks my reporting criteria is that users are scheduled on to a competency check.  Once we hit 90% of users scheduled the focus moves to competency skills checks successfully completed.

So, I can get the students, in groups, who have completed the skills check, in one single report, using the Configurable Reports plugin. 

To get the scheduled users, I have to export the face-to-face sessions to a spreadsheet, create a unique ID, copy in to the configurable report downloaded spreadsheet, then do VLOOKUPs and CountIF(s) to get the percentage of users in each group who are scheduled for a check.

Can anyone help me get this on to one configurable report please?  I've been trying, but having no look.

Here's the configurable report to get the username, group and completion status for the competency skills check:

***********************************

SELECT c.shortname AS Course, g.name AS Groupname, u.firstname, u.lastname, CONCAT(u.firstname ,'',u.lastname) AS 'Unique ID', er.enrol AS enrolmethod,  FROM_UNIXTIME(cc.timecompleted) AS CompletionDate

FROM prefix_course AS c

JOIN prefix_groups AS g ON g.courseid = c.id

JOIN prefix_groups_members AS m ON g.id = m.groupid

JOIN prefix_user AS u ON  m.userid = u.id

JOIN prefix_enrol AS er ON er.courseid = c.id

JOIN prefix_user_enrolments AS ue ON ue.enrolid = er.id AND ue.userid = u.id

JOIN prefix_course_completions AS cc ON cc.course = c.id AND cc.userid = u.id

WHERE c.id = %%COURSEID%%

*****************************************

I'd be forever in your debt wink

Thanks in advance if anyone can help

Alan


Average of ratings: -