0

我正在使用 Moodle LMS,我需要运行一份报告,以了解学生提交任何类型的人工可评分作业和评分之间需要多长时间,以便我们可以监控员工的效率。现在我要进行类似于下面的查询。我仍然需要添加实际作业,但我不确定 moodle 中的哪些项目可能适合“已提交但等待评分”类别。

这个查询我缺少哪些表,我在这里有什么明显做错的吗?

SELECT c.shortname AS course_name
     , cm.id AS cmid
     , cm.course AS courseid
     , md.name AS modname
     , gi.itemname AS itemname
     , u.firstname AS student_first
     , u.lastname AS student_last
     , f.firstname AS grader_first
     , f.lastname AS grader_last
     , NULLIF(GREATEST(IFNULL(g.overridden, 0)
                      ,IFNULL(g.timecreated, 0)
                      ,IFNULL(g.timemodified, 0))
             ,0) AS graded_unixtimestamp  
  FROM mdl_user u
  JOIN mdl_user_enrolments ue
    ON (u.id = ue.userid)
  JOIN mdl_enrol e
    ON (e.id = ue.enrolid)
  JOIN mdl_course c
    ON (c.id = e.courseid)
  JOIN mdl_course_modules cm
    ON (c.id = cm.course)
  JOIN mdl_modules md
    ON (md.id = cm.module)
  JOIN mdl_grade_items gi
    ON (
        gi.itemmodule = md.name
        AND gi.iteminstance = cm.instance
        AND gi.courseid = cm.course)
  LEFT
  JOIN mdl_grade_grades g
    ON (gi.id = g.itemid AND g.userid = u.id)
  LEFT
  JOIN mdl_user f
    ON (g.usermodified = u.id);
4

0 回答 0