Configure your Moodle Website
Once you have installed and activated the Edwiser Bridge plugin on your website the next step would be to configure the Moodle website and generate an ‘Access Token‘ which will be used on the WordPress website as well as Moodle website.
Create an External Service on Moodle
- Log in to your Moodle site and go to Site Administration -> Plugins -> Web Services -> External Services.
- Click on the ‘Add‘ button on the external services page. Enter a name for the External Service, check the ‘Enabled‘ field, check the ‘Authorised Users Only‘ field.
- Now click on the ‘Add Service’ and follow it up with clicking the ‘Add functions‘ link.
- Select the following functions and save the changes made.
- core_user_create_users: Create users.
- core_user_get_users_by_field: Retrieve users information for a specified unique field.
- core_user_update_users: Update users.
- core_course_get_courses: Return course details
- core_course_get_categories: Return category details
- enrol_manual_enrol_users: Manual enrol users
- enrol_manual_unenrol_users: Manual unenrol users
- core_enrol_get_users_courses: Get the list of courses a user is enrolled in
- The next step would be to add users to the list of authorized users for the external service that you created. To do this you will have to go to Site Administration -> Plugins -> Web Services -> External Services and click on the ‘Authorised users‘ link against the external service you created.
- Once there you will be able to add users to the list of authorized users. Conversely, you can also remove users from the same setting at a later point of time if required.
Note: The User account added to Authorised users should have an admin role in your Moodle site.
Enable the REST Protocol
- Go to Site Administration –> Plugins –> Web Services –> Manage Protocols.
- Click on the grey icon in the REST protocol row to enable the REST protocol and save the changes made.
Generate a Moodle Web Service Token
- Go to Site Administration –> Plugins –> Web Services –> Manage Tokens
- Click on the ‘Add‘ link and select the admin user under the ‘User‘ list.
- Now select the external service that you created earlier in the ‘Service‘ drop-down list.
- Click on the ‘Save Changes’ button. The token generated will be used in the Edwiser Bridge settings page on your WordPress website.
Enable Web Services
- Go to Site Administration –> Advance features, check the ‘Enable Web Services’ field and click ‘Save Changes‘ to save the changes you have made.
Disable Password Policy
- Users will register for courses from the WordPress website. Their password for the Moodle website will also be created on WordPress. Therefore, we will have to change the Moodle website’s password policy, or else a user’s Moodle account will not be created after course registration.
- To disable the password policy go to Home -> Site Administration -> Security -> Site Policies and disable the Password policy by unchecking the check-box.
- With that last bit on disabling the password policy, we have completed the Moodle end configurations for the WordPress – Moodle integration to work seamlessly.
Enable Extended Characters in Username
- A username created in WordPress can have characters. Therefore, it is mandatory to enable this setting in Moodle. Navigate to Site administration > Security > Site security settings > Enable Allow extended characters in usernames.