accessing apis/ web service function which are not core web services functions

accessing apis/ web service function which are not core web services functions

Ujwal Gupta -
回帖数:4

i want to update the settings like end time, start time, safe browsing etc of quiz in a section. But moodle is not providing the api / web service function for updating the settings. Is there any way except creating a whole new local plugin to accomplice this task (eg. any admin apis which we can access by some authentication and update the settings of quiz or there is some another web service function which does this task.)

回复Ujwal Gupta

accessing apis/ web service function which are not core web services functions

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
The web service functions that you get from the automatic documentation are all there is (even though there are lots).

Yes, if you need something extra the "correct" path is to create new local plugin that exposes the required functions. It's often not especially difficult.
回复Howard Miller

accessing apis/ web service function which are not core web services functions

Ujwal Gupta -
after creating a new local plugin do i have to expose the plugin to the open source community of moodle and only after doing so i can use it? or i can directly use that plugin for my website? also where should i place that plugin such that my moodle website can locate the function in it
回复Ujwal Gupta

accessing apis/ web service function which are not core web services functions

Mark Sharp -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

Hi,

You don't have to share your code with the community, especially if it's bespoke to your system. But the license still needs to be GPL.

About local plugins, they live in the `local` directory in Moodle. There's a readme.txt in that directory with some useful information, plus some documentation here: Local plugins | Moodle Developer Resources and some information on requirements for all Moodle plugins: Common files | Moodle Developer Resources

Defining external (web service) functions: Function Definitions | Moodle Developer Resources

If you're creating external functions, it's well worth understanding Capabilities and making sure only those with permissions can make changes. Access API | Moodle Developer Resources

回复Mark Sharp

accessing apis/ web service function which are not core web services functions

Ujwal Gupta -
Its very helpful! Thank you so much for sharing.