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

New Web Service core_group_get_activity_groupmode

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 3.0
    • Component/s: Groups, Web Services
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50964-master

      Description

      Implement a wrapper external function for core function: groups_get_activity_groupmode

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  16/Nov/15