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

New Web Service core_group_get_activity_groupmode

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.9
    • 3.0
    • Groups, Web Services
    • MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • MDL-50964-master
    • Hide
      1. Create a course with groups enabled (visible, not forced), create a forum activity with visible groups
      2. Enrol a user as student in the course
      3. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the student user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, cmid (with the forum course module id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=0&wsfunction=core_group_get_activity_groupmode&wstoken= ffbe3a3002f235bf9d01fd9369e10b66'

      6. Confirm that you receive a 2 (VISIBLEGROUPS) as response in the groupmode field
      7. Change the forum group mode to separate
      8. Run again the curl command, you should receive now a 1 as response
      9. Try to run the command using a cmid of an existing course module in a course you don't have access, you will receive an exception
      Show
      Create a course with groups enabled (visible, not forced), create a forum activity with visible groups Enrol a user as student in the course As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, cmid (with the forum course module id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=0&wsfunction=core_group_get_activity_groupmode&wstoken= ffbe3a3002f235bf9d01fd9369e10b66' Confirm that you receive a 2 (VISIBLEGROUPS) as response in the groupmode field Change the forum group mode to separate Run again the curl command, you should receive now a 1 as response Try to run the command using a cmid of an existing course module in a course you don't have access, you will receive an exception

    Description

      Implement a wrapper external function for core function: groups_get_activity_groupmode

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Simey Lameze Simey Lameze
              David Monllaó David Monllaó
              John Okely John Okely
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                16/Nov/15