Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/exelearning/mod_exelearning/llms.txt

Use this file to discover all available pages before exploring further.

mod_exelearning_get_exelearnings_by_courses returns all accessible mod_exelearning instances visible to the calling user in the given set of courses. When no course IDs are supplied the function automatically queries the user’s enrolled courses. Courses the user cannot access produce a warning entry rather than an error, so a single inaccessible course never aborts the entire request.

Function details

FieldValue
Function namemod_exelearning_get_exelearnings_by_courses
Class::methodmod_exelearning\external\get_exelearnings_by_courses::execute
Typeread
ServiceMOODLE_OFFICIAL_MOBILE_SERVICE
Capabilitymod/exelearning:view

Parameters

courseids
array of int
List of course IDs to search for mod_exelearning instances. Pass an empty array (or omit the parameter) to search all courses the authenticated user is enrolled in.

Returns

exelearnings
array
Array of activity instance objects. Visibility is enforced by get_all_instances_in_courses() — hidden or restricted instances are excluded for users without the appropriate permission.
warnings
array
One warning object per course that could not be accessed. The request succeeds even when warnings are present — the function never fails on an inaccessible course.

Security note

The packageurl field is only present in the response for users who hold the moodle/course:manageactivities capability (typically teachers and administrators). This mirrors the access control enforced by the pluginfile handler — students cannot download the raw ELPX source package.

Example request

POST {wwwroot}/webservice/rest/server.php
Content-Type: application/x-www-form-urlencoded

wstoken=<token>
&wsfunction=mod_exelearning_get_exelearnings_by_courses
&moodlewsrestformat=json
&courseids[0]=42
&courseids[1]=57

Example response

{
  "exelearnings": [
    {
      "id": 12,
      "coursemodule": 88,
      "course": 42,
      "name": "Introduction to HTML",
      "intro": "<p>Complete this activity before the exam.</p>",
      "introformat": 1,
      "introfiles": [],
      "timemodified": 1712000000,
      "section": 2,
      "visible": 1,
      "groupmode": 0,
      "groupingid": 0,
      "gradeenabled": 1,
      "grademodel": 0,
      "grademax": 100.0,
      "gradepass": 50.0,
      "maxattempt": 3,
      "grademethod": 1,
      "reviewmode": 6,
      "revision": 4
    }
  ],
  "warnings": []
}

Build docs developers (and LLMs) love