【问题标题】:Global Role with Webservice in MoodleMoodle 中 Web 服务的全局角色
【发布时间】:2021-09-13 04:50:18
【问题描述】:

Moodle 中是否有可用于分配全局角色的 Web 服务,例如课程创建者,根据用户的 ID 发送给用户?

【问题讨论】:

    标签: web-services moodle moodle-api


    【解决方案1】:

    您可以使用 core_role_assign_roles 分配角色和取消分配使用 core_role_unassign_roles。

    【讨论】:

    • 你是完美的,谢谢...它适用于系统,但不适用于课程类别...我想给用户 ID:4 课程类别:1049 角色:2(课程创建者)这是我的卷曲:MyMoodle/webservice/rest/server.php?wstoken=MyToken&wsfunction=core_role_assign_roles&moodlewsrestformat=json&assignments[0][roleid]=2&assignments[0][userid]=4&assignments[0][contextid]=1&assignments[0][ contextlevel]=coursecat&assignments[0][instanceid]=1049 我得到答案“null”,它有效。但我没有看到课程类别 1049 中 ID 为 4 的用户作为课程创建者。我的卷发出了什么问题?
    • 如果我使用 --> assignments[0][contextid]=0
    猜你喜欢
    • 2019-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多