This plugin for Moodle (type: local) adds several functions to the Moodle Web Service API. These functions allow users and external services to remotely create, move, and manage course modules with a focus on autonomous course design.
Originally developed for MoodleSync, this fork adds advanced authoring capabilities for pages and labels to support AI-driven course generation.
The following functions are available via the Moodle Web Service API:
| Function | Description | Note |
|---|---|---|
local_course_add_new_course_module_url |
Add course module URL | |
local_course_add_new_course_module_resource |
Add course module Resource | File needs to be uploaded with "/webservice/upload.php". |
local_course_add_new_course_module_directory |
Add course module Folder | Files need to be uploaded with "/webservice/upload.php". |
local_course_add_new_course_module_page |
Add course module Page | Supports HTML content (PARAM_RAW). Uses CMID-First logic for stability. |
local_course_add_new_course_module_label |
Add course module Label | Supports HTML/Text labels for course structuring. |
local_course_add_files_to_directory |
Add files to existing folders | Since version 3.0.0. |
local_course_move_module_to_specific_position |
Move a module to a dedicated position | |
local_course_add_new_section |
Create and position a new course section | Since version 2.0.0. |
- Authoring Support: Added support for
mod_pageandmod_labelwhich were previously missing from the API. - HTML Support: Text parameters now use
PARAM_RAWto allow for CSS-styled content, H5P embeds, and complex layouts. - CMID-First Strategy: Internal refactoring ensures that complex modules (like Pages) are correctly linked to a Course Module ID (CMID) before instance creation, preventing "Invalid Module ID" errors.
- Compatibility: Tested on Moodle versions 3.11.x, 4.x, and 5.2.x.
- Protocol: Uses the "REST (returning JSON)" web service protocol.
- Installation:
- Unzip the archive into the directory
local/sync_service. - Log in as an admin and follow the installation process via the Notifications page.
- Ensure the external service "Gemini MCP" or "Course Sync Extension Service" is enabled.
- Unzip the archive into the directory
- Requirements: File upload and download must be allowed in the web service settings.
- Security: The setting
restrictedusersis disabled by default to allow flexible agent interaction.
This plugin is licensed under the same terms as the original Moodle sync_service plugin.