最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Set timelimit on module in moodle through webservice API - Stack Overflow

programmeradmin1浏览0评论

I am trying to set the timelimit of a quiz module on Moodle through Moodle's webservice API. Based on what I've found, the timelimit uses the following 3 keys:

timelimit[enabled]
timelimit[timeunit]
timelimit[number]

The problem is when I try to set any of these three through my API call like this:

modules[0][timelimit[enabled]]

, I get an error:

Unexpected keys (timelimit[enabled) detected in parameter array.

The issue, I believe, is that Moodle deletes anything after the last "]" and replaces it with a ")", breaking the actual key that is provided. I have tried URL encoding like

modules[0][timelimit%5Benabled%5D]

, escaping, quotation, anything I could think of but I still have reached no solution. I also was unable to find any other way that this key is meant to be set through webservice API. There is no issue with other keys that have no brackets in the key name.

I also know that Moodle itself send the following param when using the UI to create a quiz with timelimit:

...&timelimit%5Bnumber%5D=45...

But I guess that only works because it is not part of an array and is a single edit (unless I am missing something obvious).

I appreciate any help if anyone has an idea or a solution.

发布评论

评论列表(0)

  1. 暂无评论