Moodle 成绩册导出

Moodle gradebook export

我正在尝试从 Moodle 数据库中导入学生的成绩簿分数,但我找不到任何存储类别分数的详细信息,或者它们是否是即时计算的。如果计算它们,我可以在查询中重现此计算吗?

谢谢

编辑:多亏了 Hipjea,我才开始使用临时查询页面。这就是我需要的。但现在我面临另一个问题:对于某些主题,查询没有 return 类别。看起来所有的 gradbook 设置都是一样的。需要一些可能的东西。看起来课程不知何故不喜欢分类。

查询是:

SELECT DISTINCT gi.itemname
FROM mdl_course AS c
    JOIN mdl_context AS ctx ON c.id = ctx.instanceid
    JOIN mdl_role_assignments AS ra ON ra.contextid = ctx.id
    JOIN mdl_user AS u ON u.id = ra.userid
    JOIN mdl_grade_grades AS gg ON gg.userid = u.id
    JOIN mdl_grade_items AS gi ON gi.id = gg.itemid
    JOIN mdl_course_categories AS cc ON cc.id = c.category
WHERE  gi.courseid = c.id
    AND gi.itemname = 'Cycle 1'
    AND gi.itemtype IN ('category')
    AND c.id = 123

您最好使用 grade/report/user 中现有的 Moodle class grade_report_user 来获取数据。

这是一个使用示例:

require_once($CFG->dirroot . '/grade/report/user/lib.php');

$gpr = new grade_plugin_return(
  array(
    'type' => 'report',
    'plugin' => 'user',
    'courseid' => $course->id,
    'userid' => $userid)
);
$report = new grade_report_user($course->id, $gpr, $context, $userid);
$report->fill_table();

通过这样做,您将获得预格式化的 HTML table。

如果grade_report_userclass不能完全满足您的需要,您可以将其复制到您自己的插件文件夹中,相应地重命名并修改它。

或者,您可以在 Moodle 的临时查询页面中找到您需要的内容 https://docs.moodle.org/38/en/ad-hoc_contributed_reports#Site-Wide_Grade_Report_with_All_Items