Moodle:网络服务调用以获取课程中的作业

Moodle: web service call to get assignments under course

我有一个应用程序,我需要使用核心 Web 服务从 Moodle 中获取记录 API。

我通过以下 API 电话接收课程和类别:

core_course_get_courses
core_course_get_categories

但是我找不到

的正确参数(或者我的实现可能是错误的)
mod_assign_get_assignments

我试过如下

http://moodle/webservice/rest/server.php?wsfunction=mod_assign_get_assignments&moodlewsrestformat=json&wstoken=token&courseids[0]=27

谁能知道我如何从课程中获得作业?

请帮忙

以下方法用于在 Moodle 中获取课程下的记录

http://moodle/webservice/rest/server.php?wsfunction=mod_assign_get_assignments&moodlewsrestformat=json&wsfunction=core_course_get_contents&moodlewsrestformat=json&courseid=

您的命令不起作用主要是因为您的 Web 服务用户未注册该课程。转到课程设置并注册用户。

这对我有用:

https://your.moodlesite.com/webservice/rest/server.php?wsfunction=mod_assign_get_assignments&wstoken=5a67fb5d660a987a5705a4b47c0ad1fa&moodlewsrestformat=json&courseids[0]=3

最后一个参数 'courseids' 不是必需的。