Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
495 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 Reply

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 )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...