We're using Moodle 2.8.5 and I would like to pull a list of students from the database who
have been manually added to courses and given the "student" role. Most
of our students are enrolled in courses via LDAP, but there are some
who have been manually enrolled, so we'd like to know who they are and what courses they have manually enrolled in. I tried querying moodle_role_assignments where roleid = 5
(assuming that was the student role) but it seems the roleid column is
also 5 when a student has a role from the mdl_role_names table. For
example, if I add manually enroll a student in a class and give them the
student role, they will have an entry in the moodle_role_assignments table
with roleid = 5. But if a course is using named roles and I give myself
named role of "jedi" which happens to have an id = 5 in the moodle_role_names table, my roleid will again be 5 in the role_assignments table so I
don't know how to differentiate between the two. I'm fairly new to
moodle so I apologize if I'm way off on this.
General help
Pulling students who have been manually enrolled
This discussion has been locked so you can no longer reply to it.