Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webservice setup docs #42

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions doc/webservicesetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This plugin requires the [import as new version](https://github.com/maths/moodle
`git clone https://github.com/maths/moodle-qbank_gitsync.git question/bank/gitsync`
- The repository will default to the `main` branch but you may need to switch to another branch if you're testing new features (e.g. `dev` for initial beta testing). In the gitsync directory e.g. `git checkout dev`.
- Install the plugin via Moodle.
- Enable webservices if they are not enabled already. (Site administration/General/Advanced features/Enable webservices)
- Run the setup script in the gitsync cli folder (`yourmoodle/question/bank/gitsync/cli/`) on the Moodle server if you have access:
- `php webservicesetup.php`
- Alternatively, perform user set up manually:
Expand All @@ -25,17 +26,14 @@ This plugin requires the [import as new version](https://github.com/maths/moodle
![Screenshot of token creation.](../images/Add_token.png)
- Add roles for the user to give them access to the required courses and questions. If you would like them to have site-wide access, go to Site Administration/Users/Permissions/Assign system roles and give `ws-gitsync-user` Manager role for the webservice to have access to all questions on the site. If you only want them to have access to particular courses, then make `ws-gitsync-user` Manager on courses individually.
- If you have user agreements set up for your Moodle site, you will need to accept them on behalf of the Gitsync user. (Site Administration/Users/Privacy and policies/Manage policies/Agreements/Accept)
- Optionally, you can test using [Postman](https://www.postman.com/downloads/) if you know a question id and its course name:
- Optionally, you can test using [Postman](https://www.postman.com/downloads/) if you know a questionbankentry id:
- URL: Your_Moodle_root_address/webservice/rest/server.php
- Params:
- wstoken: _Your token created above_
- wsfunction: qbank_gitsync_export_question
- moodlewsrestformat: json
- questionid: _Your question id_
- contextlevel: 10
- coursename: _Your course name_
- modulename:
- coursecategory:
- questionbankentryid: _Your question's qbe id_
- includecategory: 0
Fill in the URL and parameters above in the fields as shown in the screenshot and click 'Send'. You should get the requested question back as a response.
![Screenshot of Postman.](../images/Postman.png)

Expand Down
Binary file modified images/Postman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading