Repository navigation
Moodle‐Configuration
Martin edited this page Jun 20, 2024
·
4 revisions
Following settings must be made to the Moodle installation for the eTutor Task Synchronization to work:
Execute following steps as Moodle administrator in the Moodle System:
- Enable web services: Activate "Enable web services" in Site Administration > General > Advanced Features
- Enable REST protocol: Activate "REST protocol" in Site Administration > Server > Web services > Manage Protocols
-
Create REST user: Create a user that is allowed to call the REST endpoints.
-
Add a new role in Site Administration > Users > Permissions > Define roles
- Use role or archetype: No role
- Short name: web_service
- Custom full name: Web Service
- Custom description: Web Service for eTutor Task Administration
- Role archetype: None
- Context types where this role may be assigned: System
- Allow role assignments: Nothing
- Allow role overrides: Nothing
- Allow role switches: Nothing
- Allow role to view: Nothing
-
Capabilities: Allow
- webservice/rest:use
- moodle/category:manage
- moodle/category:viewhiddencategories
- moodle/question:managecategory
- moodle/question:add
- moodle/question:editall
- moodle/question:moveall
- moodle/question:viewall
-
Create user in Site Administration > Users > Accounts > Add a new user
- Username: etutor_sync
- Choose an authentication method: Manual account
- Password: some secure password
- Force password change: false
- First name: Sync
- Last name: eTutor
- Email address: a unique, working email address
- Email visibility: Hidden
-
Add user to role in Site Administration > Users > Permissions > Assign system roles
- Assign the previously created
etutor_syncuser to the previously createdweb_servicerole.
- Assign the previously created
-
Add a new role in Site Administration > Users > Permissions > Define roles
-
Add custom external service in Site Administration > Server > Web services > External services
-
Add service
- Name: eTutor Sync
- Short Name: etutor_sync
- Enabled: true
- Authorised users only: true
-
Add functions in Site Administration > Server > Web services > External services > Functions
- core_course_create_categories
- core_course_get_categories
- core_course_update_categories
- local_etutorsync_create_question_category
- local_etutorsync_update_question_category
- local_etutorsync_create_question
- local_etutorsync_deprecate_old_question
- local_etutorsync_update_question
-
Add user in Site Administration > Server > Web services > External services > Authorised users
- Add the previously created
etutor_syncuser.
- Add the previously created
-
Add service
- Enable "Multi-language content" filter in Site Administration > Plugins > Filters > Manage Filters
- Disable "Convert URLs into links and images" filter in Site Administration > Plugins > Filters > Manage Filters
-
Create Role "Question Viewer" in Site Administration > Users > Permissions > Define roles
-
Add a new role in Site Administration > Users > Permissions > Define roles
- Use role or archetype: No role
- Short name: Question Viewer
- Custom full name: Question Viewer
- Custom description: Allows teachers to view questions from course categories
- Role archetype: None
- Context types where this role may be assigned: System, Category
- Allow role assignments: Nothing
- Allow role overrides: Nothing
- Allow role switches: Nothing
- Allow role to view: Nothing
-
Capabilities: Allow
- moodle/question:useall
- moodle/question:viewall
-
Assign roles to users in Home > All Courses
- Click on the requested course category
- Click on More > Permissions
- In the dropdown select Assign roles
- Click on Question Viewer
- Add the users that should be able to view questions
-
Add a new role in Site Administration > Users > Permissions > Define roles
- In the Moodle System create a web service token. As administrator open Site Administration > Server > Web services >
Manage tokens
- Name: etutor_task_administration
-
User: The previously created
etutor_syncuser. -
Service: The previously created custom web service
etutor_sync. - IP restriction: enter if required
- Valid until: set as required
- Set following settings in the applications'
application-[dev|prod].ymlfile or the corresponding environment variable.-
moodle.token: The token created in the previous step. -
moodle.url: The URL to the moodle server (e.g.http://localhost:8000/).
-