Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-52948

Add ability to return all cohorts in WS (backport of MDL-52568)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.12, 2.8.10, 2.9.4, 3.0.2
    • Fix Version/s: 2.9.5, 3.0.3
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a bunch of cohorts.
      2. As an admin visit 'Plugins' > 'Web Services' > 'Overview' and follow the required steps:
      3. Create a new Web Service
      4. Add the core_cohort_get_cohorts function
      5. Create a token for a user.
      6. Next you will have to do a CURL REST call simulating a WS client with one of the users - example:

        curl '<yoursite>/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_cohort_get_cohorts&wstoken=<yourtoken>' | python -m "json.tool"

      7. Do the corresponding web service API call to core_cohort_get_cohorts without parameters, checking that all cohorts are returned.
      8. Do the corresponding web service API call to core_cohort_get_cohorts with one or several cohort ids as parameters, to check that the "old" functionality of this function still works as expected.
      Show
      Create a bunch of cohorts. As an admin visit 'Plugins' > 'Web Services' > 'Overview' and follow the required steps: Create a new Web Service Add the core_cohort_get_cohorts function Create a token for a user. Next you will have to do a CURL REST call simulating a WS client with one of the users - example: curl '<yoursite>/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_cohort_get_cohorts&wstoken=<yourtoken>' | python -m "json.tool" Do the corresponding web service API call to core_cohort_get_cohorts without parameters, checking that all cohorts are returned. Do the corresponding web service API call to core_cohort_get_cohorts with one or several cohort ids as parameters, to check that the "old" functionality of this function still works as expected.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE

      Description

      Backport of MDL-52568 to stable branches.
      Add ability to core_cohort_get_cohorts so that it can return all cohorts, as well of the original functionality of returning a certain cohorts when their ids are provided as parameters.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Mar/16