Webservice functions for cohort enrolment

Local plugins ::: local_ws_enrolcohort
Maintained by This is a picture of meDonald Barrett, Learning Works
A local plugin with webservice functions for managing cohort enrolments.

Webservice functions for cohort enrolment v3.3-r1

Moodle 3.3
Released: středa, 11. července 2018, 11.09

Moodle Webservices for Cohort Enrolment.

What is this plugin and why was it developed?

This is a local plugin with webservice functions.

It was developed for Te Wānanga O Aotearoa to streamline the enrolment of tauira (student, learner) into courses. Cohorts and courses are created using Moodle webservices but adding cohort enrolment instances to courses was a manual process.

The overall goal is to have this webservice function integrated into Moodle core.

What can this plugin do?

This local plugin enables people to add a cohort enrolment instance to a course using webservices.

What else can this plugin do?

In addition to adding a cohort enrolment instance to a course using webservices, this plugin can also:

  • Delete an existing cohort enrolment instance
  • Update an existing cohort enrolment instance
    • The name of the cohort enrolment instance
    • The status of the cohort enrolment instance (i.e. active or inactive)
    • The role that the users of the cohort enrolment instance is synchronised with
    • The group that users of the cohort enrolment instance are added to (i.e. create a new group, an existing group that belongs to the course, none)
  • Get a list of all cohort enrolment instances
  • Get a list of cohort enrolment instances for a specific course

What can this plugin not do?

This plugin can not do anything that is not listed under What can this plugin do? or What else can this plugin do?

How do I install this plugin?

This plugin can be installed by following the official Moodle documentation.

What version of Moodle can I install this on?

This plugin has only been developed and tested for Moodle 3.3.

How do I use this plugin?

This plugin can be used in accordance with the official Moodle documentation.

Example JSON responses.

This is an example of a JSON response to the webservice function get_instances().

{ "id": -1, "code": 200, "message": "Found 0 cohort enrolment instances in 2 courses (All courses).", "data": [] }

Here are some example JSON responses to the webservice function add_instance().

{ "exception": "local_ws_enrolcohort\\exceptions\\cohort_not_found_exception", "errorcode": "objectnotfound", "message": "Object does not exist!", "debuginfo": "Could not find cohort with id 2" }

{ "id": 24, "code": 201, "message": "Cohort enrolment instance added.", "data": [ { "object": "course", "id": 2, "name": "TestCourse1", "idnumber": "", "shortname": "TestCourse1", "visible": 1, "format": "topics" }, { "object": "cohort", "id": 4, "name": "Test", "idnumber": "1", "visible": 1 }, { "object": "role", "id": 1, "shortname": "manager" }, { "object": "data", "name": "", "cohortid": 4, "roleid": 1, "groupid": 0, "status": 0 }, { "object": "group", "id": 0, "name": "Enrol instance group none.", "courseid": -1 }, { "object": "enrol", "id": 24, "name": "Cohort sync (Test - Manager) - Using system generated name.", "courseid": 2, "cohortid": 4, "roleid": 1, "groupid": 0, "status": 0 } ] }

Version information

Version build number
2018041901
Version release name
v3.3-r1
Can be updated to
v3.3.2 (2018110600), v3.3.3 (2019042900)
Maturity
Stabilní verze
MD5 Sum
1248955a9be9fd45854af773a13cb2d6
Supported software
Moodle 3.3

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS branch
master

Default installation instructions for plugins of the type Local plugins

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder in the "local" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation.