Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
474 views
in Technique[技术] by (71.8m points)

Moodle Student list with Groups and Course

I am using moodle2.4.6. I want a list of user with their groups and their courses.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You will need to do an SQL query to get this information.

Assuming you are using the default 'mdl_' prefix for tables, you will need to join together the following tables:

  • mdl_user - the details of the users
  • mdl_user_enrolments - (user_enrolments.userid = user.id) which course enrolments the user has
  • mdl_enrol - (enrol.id = user_enrolments.enrolid) details of which enrolment instances these are
  • mdl_course - (course.id = enrol.courseid) details of the courses these users are enroled in
  • mdl_groups_members - (groups_members.userid = user.id) details of the groups these users are in
  • mdl_groups - (groups.id = groups_members.groupid AND groups.courseid = course.id) name and description of the groups the user is in (for each course)

Please comment if you need help turning that pseudo code into actual SQL, or if you need help with the Moodle database access API ( http://docs.moodle.org/dev/Data_manipulation_API )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...