GitHunt
SA

savva312/moodle-local_get_user_cohorts

This plugin can be used to retrieve the cohorts of a given user in Moodle by providing the USER ID

Build Status

Get User cohorts

Description

This plugin can be used to retrieve the cohorts of a given user in Moodle by providing the USER ID

How it works

  1. Install plugin in Moodle
  2. Enable WebServices
  3. Assign the function to the web service user
  4. Send a request to the server

http://[moodleurl]/webservice/rest/server.php?wstoken=[YOURTOKEN]&wsfunction=local_wsgetusercohorts&userid=18&moodlewsrestformat=json

Parameters

int  Default to "null" //The ID of the user"

Returns

object {
    cohorts list of (
        object {
            cohortid int   //Cohort ID
            idnumber string   //Cohort id number
            name string   //Cohort name
        }
    )
}

Change log

[1.0] (2017-07-26)

Fixed PHP LINT errors

[1.1] (2017-09-19)

Closed issues:

Languages

PHP100.0%

Contributors

Created July 25, 2017
Updated January 2, 2024
savva312/moodle-local_get_user_cohorts | GitHunt