Prerequisites and Moodle Set-up¶
Before the integration can be configured in OpenEduCat, Moodle must expose its web service API and a token must be issued. All steps in this page are performed in Moodle by a site administrator.
Requirements¶
Moodle 4.5 or later, reachable over HTTPS from the OpenEduCat server.
Site administrator access to Moodle, to enable web services and create a token.
The queue_job module in OpenEduCat, which the integration uses to run long syncs in the background.
Optional — the local_wsattendance Moodle plugin, required only if attendance is synchronized.
Optional — the
openeducat_timetablemodule, required only if timetable sessions are pushed to the Moodle calendar.
Step 1 — Enable Web Services¶
In Moodle, go to , tick
Enable web services, and click Save changes.
Step 2 — Enable the REST Protocol¶
Go to and enable REST protocol.
Step 3 — Create the External Service¶
Go to
and click Add.
Name :-
openeducat_integrationShort name :-
openeducat_integrationEnabled :- Ticked.
Authorised users only :- Recommended, so that only the dedicated service account can use the token.
Step 4 — Add the Required Functions¶
Open the Functions link next to the new service and add the functions listed below.
The Test Connection button in OpenEduCat verifies these 25 functions and warns about any
that are missing.
Area |
Functions |
|---|---|
Site information |
|
Users |
|
Courses |
|
Categories |
|
Enrollment |
|
Roles |
|
Groups |
|
Grades |
|
Completion |
|
Add these additional functions only if the matching feature is used:
Feature |
Functions |
|---|---|
Timetable sessions |
|
Attendance |
|
Step 5 — Create the API Token¶
Go to
and click Create token.
User :- The Moodle administrator, or a dedicated service account.
Service :-
openeducat_integration.IP restriction :- Optionally restrict the token to the OpenEduCat server’s IP address.
Valid until :- Leave empty for a token that does not expire.
Copy the generated token — it is entered in OpenEduCat in the next chapter.
Warning
If the token is later regenerated or deleted in Moodle, every sync fails with an authentication error until the new token is saved on the OpenEduCat instance record.
Step 6 — Note the Moodle Role IDs¶
Role IDs are not identical on every Moodle site. Go to
and open the
roles you use. The role ID is shown in the browser address bar, for example
.../admin/roles/define.php?action=view&roleid=5.
The defaults used by OpenEduCat are 5 for Student and 3 for Editing teacher.
If your site differs, correct them on the instance record before running any sync — a wrong
role ID causes permission errors or silently failing enrollments.
Background Job Configuration¶
The integration hands long-running syncs to the queue_job module. On the OpenEduCat
server, odoo.conf must run with multiple workers and load queue_job as a server-wide
module:
workers = 4
server_wide_modules = base,web,queue_job
[queue_job]
channels = root:2,root.moodle:4
root.moodle:4 allows four Moodle sync jobs to run in parallel. Restart the OpenEduCat
service after editing the configuration file.
Note
With workers = 0 the queue is not processed. Background syncs stay pending and only
the Run Immediately mode of the manual sync wizard works.
Installing the Module¶
Once Moodle is prepared, install OpenEduCat Moodle Integration from
. Searching for moodle shows the core module and, when their
dependencies are already installed, the gradebook and fees bridges install automatically.