如何使用API​​获取在Moodle中创建的Book的内容?

问题描述

如何使用API​​获取在Moodle中创建的Book的内容

我已经测试过mod_book_view_book函数,但是我只得到书名,而不是书的内容

解决方法

使用core_course_get_contents函数,然后从响应元素中获取modname =“ book”

示例:

https://host/webservice/rest/server.php?wstoken=user_token&wsfunction=core_course_get_contents&moodlewsrestformat=json&courseid=31