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

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

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.12, 2.8.10, 2.9.4, 3.0.2
    • 2.9.5, 3.0.3
    • Web Services
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • 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.

    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

              kevin.bruton Kevin Bruton
              kevin.bruton Kevin Bruton
              Mark Nelson Mark Nelson
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              David Monllaó David Monllaó
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Mar/16