我正在使用moodle2.4.6。我想要一个用户列表及其组和课程。
答案 0 :(得分:2)
您需要执行SQL查询才能获取此信息。
假设您使用默认的' mdl _'表的前缀,您需要将以下表连接在一起:
如果您需要帮助将伪代码转换为实际SQL,或者如果您需要有关Moodle数据库访问API(http://docs.moodle.org/dev/Data_manipulation_API)的帮助,请发表评论
答案 1 :(得分:0)
SELECT
mdl_user.username,
mdl_user.firstname,
mdl_user.lastname,
mdl_course.fullname,
mdl_course.idnumber,
mdl_groups_members.groupid,
mdl_groups.name
FROM (mdl_groups_members
INNER JOIN ((mdl_course
INNER JOIN (mdl_user_enrolments
INNER JOIN mdl_enrol ON mdl_user_enrolments.enrolid = mdl_enrol.id)
ON mdl_course.id = mdl_enrol.courseid) INNER JOIN mdl_user ON mdl_user_enrolments.userid = mdl_user.id)
ON mdl_groups_members.userid = mdl_user.id) INNER JOIN mdl_groups
ON (mdl_groups.courseid = mdl_course.id) AND (mdl_groups_members.groupid = mdl_groups.id)
WHERE (((mdl_user.username) = "102993") AND ((mdl_course.category) = "36"))