Moodle

Interact with Moodle LMS - Complete Integration (v0.1.0)

Overview

This node integrates with the Moodle Learning Management System (LMS) to update existing course information. It allows users to modify details of a specific course by providing its unique identifier and new property values. This is useful for administrators or educators who need to keep course data current, such as changing course names, categories, visibility, or scheduling.

Practical examples:

  • Updating the full name or short name of a course after rebranding.
  • Changing the course category to reorganize courses within Moodle.
  • Adjusting the course start and end dates to reflect new schedules.
  • Making a course visible or hidden from students based on availability.

Properties

Name Meaning
Course ID The unique numeric identifier of the course to update (required).
Course Name Full official name of the course (required).
Short Name Unique short name identifier for the course (required).
Category ID Numeric ID representing the category under which the course is classified. Defaults to 1.
Additional Fields Optional collection of extra course properties that can be updated:
- Description Summary or description text for the course.
- ID Number External system identifier for the course.
- Format Layout format of the course; options are: Topics, Weekly, Social, Single Activity.
- Number of Sections Number of sections or weeks in the course (default 10).
- Start Date Course start date/time.
- End Date Course end date/time.
- Visible Boolean flag indicating if the course is visible to students.
- Make Shortname Unique Boolean flag to append a timestamp to the short name to ensure uniqueness (used only on create).

Output

The node outputs JSON data representing the updated course object returned by Moodle's API. This typically includes all course properties after the update, such as:

  • id: Course ID
  • fullname: Full course name
  • shortname: Course short name
  • categoryid: Category ID
  • Other fields reflecting any additional updates made

If the update is successful, the output contains the updated course details. If multiple courses were updated (not typical for this operation), each would be an item in the output array.

No binary data output is produced by this operation.

Dependencies

  • Requires a valid connection to a Moodle instance with web service API enabled.
  • Needs an API authentication credential configured in n8n to authorize requests.
  • The Moodle web service must have permissions to update courses.
  • The node uses Moodle's core web service functions, specifically core_course_update_courses.

Troubleshooting

  • Common issues:

    • Invalid or missing Course ID will cause the update to fail.
    • Insufficient permissions in Moodle for the API user to update courses.
    • Providing invalid field values (e.g., non-unique shortname without makeUnique flag) may cause errors.
    • Date fields must be valid ISO date strings; otherwise, conversion to timestamps may fail.
  • Error messages:

    • Errors from Moodle API will be propagated, often indicating permission issues or invalid parameters.
    • If the shortname is not unique and makeUnique is false, Moodle may reject the update.
    • Network or authentication errors if the API credentials are incorrect or expired.
  • Resolutions:

    • Verify the Course ID exists and is correct.
    • Ensure the API user has appropriate permissions in Moodle.
    • Use the makeUnique option when creating courses to avoid shortname conflicts.
    • Validate date inputs before running the node.

Links and References


This summary focuses exclusively on the "Course" resource with the "Update" operation as requested.

Discussion