I'm performing a data mining study with moodle database. I've been given an anonymized backup of a course. and when I restore the course into my moodle site only teachers will appear under Participants within the course (I know they all are teachers because the front page says so).
In the database I have information about all users related to the course, including the students that don't appear under Participants.
The problem is that I don't know how to differentiate students and teachers in moodle database. I used to do it via context, with something like this:
FROM mdl_course c
INNER JOIN mdl_context cx ON c.id = cx.instanceid AND cx.contextlevel = '50'
INNER JOIN mdl_role_assignments ra ON cx.id = ra.contextid
INNER JOIN mdl_role r ON ra.roleid = r.id
INNER JOIN mdl_user usr ON ra.userid = usr.id
WHERE r.shortname = 'student'
But in this case I am getting an empty set. I guess that the fact no students appear under Participants has something to do with me getting an empty set and probably has also something to do with the context.
So, is it possible to distinguis them without using the context?
Thanks in advance!