maths / moodle-qbank_gitsync

Synchronize questions in a Moodle question bank with files in an external git repository
GNU General Public License v3.0
5 stars 2 forks source link

How to use webservice #54

Open nguyenloki258 opened 1 month ago

nguyenloki258 commented 1 month ago

Hello, could you please provide me with detailed instructions on how to use the web service? I have tried the export_question function already. I also need guidance on import, delete, and getlist. If possible, using Postman would be great. Thank you.

EJMFarrow commented 1 month ago

Thanks for trying GitSync. There is a great deal of documentation in the docs folder. Your best bet would be to work through the SetUp and Usage sections at the end of the ReadMe - https://github.com/maths/moodle-qbank_gitsync/blob/main/README.md - following the links from there. I'm happy to answer any specific questions you have from that.

If you really want to just use the webservice and not the cli scripts included with GitSync which call the webservice, look in https://github.com/maths/moodle-qbank_gitsync/tree/main/classes/external. The execute_parameters function for each class lists the Query Params you'll need for Postman. You always also need wstoken, wsfunction and moodlewsrestformat as in the export_question example in webservicesetup.md. I would try the scripts first, though - https://github.com/maths/moodle-qbank_gitsync/blob/main/doc/usinggit.md