Skip to main content

Moodle

OpenVLE can be connected to an existing Moodle instance to automatically provision learning environments. Moodle courses are duplicated, participants are synchronized, and enrollments are managed — all controlled by the lifecycle of events in OpenVLE.

Optional

The Moodle integration is fully optional. When not in use, all Moodle-related elements are hidden in the user interface. The integration is disabled by default.

Architecture

OpenVLE communicates with Moodle exclusively via the Moodle Web Services REST API. There is no direct database connection — all operations are performed through HTTP API calls.

ComponentRole
OpenVLE BackendRetrieves Moodle courses and checks users
OpenVLE WorkerPerforms course duplication, user creation, and enrollments asynchronously
Moodle Web ServicesReceives API requests and executes the operations in Moodle
Network access

The OpenVLE backend must be able to establish outgoing HTTPS connections to the Moodle instance. Authentication is done via a Moodle API token.

Concept: Course mapping

The integration is based on mapping Moodle courses to OpenVLE environments:

  1. Environment — An OpenVLE environment can be linked to a Moodle course. This Moodle course serves as a template.
  2. Event — When an event is started from this environment, OpenVLE automatically duplicates the Moodle template course. Each event receives its own Moodle course.

Event lifecycle

The Moodle actions are tied to the lifecycle of an event:

PhaseMoodle action
DeploymentTemplate course is duplicated, participants are created and enrolled
Add participantUser is created in Moodle if needed and enrolled in the course
Remove participantUser is unenrolled from the Moodle course
Event endStudents are unenrolled, instructors remain, course becomes hidden
Delete eventMoodle course is optionally deleted (configurable)

User synchronization

During deployment, OpenVLE checks for each participant whether a corresponding user exists in Moodle. The matching is done via the configured field (MOODLE_USER_MATCH_FIELD — either email or username). If no Moodle user is found, OpenVLE automatically creates a new one.

Role mapping

OpenVLE maps participant roles to Moodle course roles:

OpenVLE roleMoodle role
InstructorEditing Teacher (Role ID 3)
StudentStudent (Role ID 5)
Data loss on unenrollment

When unenrolling a participant, submissions, grades, and learning progress in the Moodle course are lost. This is a limitation of the Moodle REST API (see MDL-70582).

Further reading