Step 1: Access the Site Administration Panel
-
Log into Moodle as an administrator.
-
Navigate to the Site Administration panel. You can find this in the menu, typically on the left side or at the top of the page.
Step 2: Manage Web Service Settings
-
In the Site Administration panel, locate the Plugins tab.
-
Click on Web Services under Plugins.
-
Ensure that web services are enabled. If not, enable them.
Step 3: Create a User for the Token
-
Go back to the Site Administration and select Users.
-
Choose Browse list of users and click on Add a new user.
-
Fill the fields as follows and click ‘Create user’ at the bottom of the page.
- Username: use a username of your choice, we recommend using “user_proctorexam_lti”.
- Choose an authentication method: should be on “Manual accounts” by default.
- New password: use the password of your choice.
- First name: use the first name of your choice, we recommend using “ProctorExam”.
- Surname: use the surname of your choice, we recommend using “LTI ”.
- Email address: use the email address of your choice, we recommend using an email that you can have access to (ie: support@yourdomain.com).
- Email display: choose “Allow only other course members to see my email address”.
- The remaining fields and checkboxes can be left blank.
Step 4: Assign Appropriate Role
-
After creating the user, assign them a role that has the necessary permissions. This might be a custom role you create.
-
Go to Site Administration > Users > Permissions > Define roles.
-
Add or edit a role, ensuring it has permission for moodle/webservice:createtoken and access to the core_course_get_contents function.
Step 5: Enable and Configure the Web Service Protocol
-
Within Site Administration, go to Plugins > Web Services > Manage Protocols.
-
Enable the REST protocol (or another preferred protocol).
-
Configure the protocol settings as needed.
Step 6: Create a Service
-
Navigate to Plugins > Web Services > External Services.
-
Click Add to create a new service.
-
Name your service and give it a short description.
-
Ensure that Enabled and Authorised users only are checked.
-
Add functions to the service. Search for and add core_course_get_contents.
Step 7: Add the User to the Service
-
In the External Services page, click on Authorized users for the service you created.
-
Add the user you created in Step 3.
Step 8: Generate the Token
-
Go back to Site Administration > Plugins > Web Services > Manage tokens.
-
Click Add to create a new token.
-
Select the user and service you created.
-
The token will be generated and displayed. Copy this token for API use.
Comments
0 comments
Article is closed for comments.