General plugins (Local): Get User Cohort

local_get_user_cohorts
Maintained by Picture of Christos Savva Christos Savva
This plugin can be used to retrieve the cohorts of a given user in Moodle by providing the USER ID
7 sites
27 downloads
1 fans

Description


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


How it works


Install plugin in Moodle

Enable WebServices

Assign the function to the web service user

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
        }
    )

Screenshots

Screenshot #0

Contributors

Picture of Christos Savva
Christos Savva (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Plugins bot
    Tue, 25 Jul 2017, 10:50 PM
    Approval issue created: CONTRIB-6987
  • Picture of Dan Marsden
    Tue, 19 Sep 2017, 3:58 PM
    Thanks for submitting your plugin for review, I have posted some feedback in your github issue tracker and in CONTRIB-6987 - for now we will flag this as requiring more work, but please upload a new version here for review when you have addressed the feedback - thanks!
Please login to post comments