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

On courses with separated groups, gradereport_user_get_grade_items throws 'notingroup' when accessing one's grade items

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Waiting for peer review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.5, 3.6.3, 3.7
    • Fix Version/s: None
    • Component/s: Gradebook
    • Testing Instructions:
      Hide
      1. Create a fresh Moodle instance
      2. Create some test data

      php admin/tool/generator/cli/maketestsite.php --size=XS
      

      1. Enable webservices;
        1. In the config

          $CFG->enablewebservices = true;
          

        2. Enable REST on

          /admin/settings.php?section=webserviceprotocols
          

        3. Enable Moodle Mobile webservice:

          /admin/webservice/service.php?id=1
          

        4. Allow REST protocol use by "Authenticated users"

          /admin/roles/define.php?action=edit&roleid=7
          

      2. Modify the first test course to have "Separate Groups":

        /course/edit.php?id=2
        

      3. Lookup the test user in the first test course

        /user/index.php?id=2
        

      4. Create a token for that user via:

        /admin/settings.php?section=webservicetokens
        /admin/webservice/tokens.php?sesskey=…&action=create
        

      5. Query grades for that user with their token; GET:

        /webservice/rest/server.php?moodlewsrestformat=json&courseid=2&userid=3&wsfunction=gradereport_user_get_grade_items&wstoken=…
        

        Note that the result is:

        {"exception":"moodle_exception","errorcode":"notingroup","message":"error\/notingroup"}
        

        Where one should get their grades back.

      Show
      Create a fresh Moodle instance Create some test data php admin/tool/generator/cli/maketestsite.php --size=XS Enable webservices; In the config $CFG->enablewebservices = true; Enable REST on /admin/settings.php?section=webserviceprotocols Enable Moodle Mobile webservice: /admin/webservice/service.php?id=1 Allow REST protocol use by "Authenticated users" /admin/roles/define.php?action=edit&roleid=7 Modify the first test course to have "Separate Groups": /course/edit.php?id=2 Lookup the test user in the first test course /user/index.php?id=2 Create a token for that user via: /admin/settings.php?section=webservicetokens /admin/webservice/tokens.php?sesskey=…&action=create Query grades for that user with their token; GET : /webservice/rest/server.php?moodlewsrestformat=json&courseid=2&userid=3&wsfunction=gradereport_user_get_grade_items&wstoken=… Note that the result is: {"exception":"moodle_exception","errorcode":"notingroup","message":"error\/notingroup"} Where one should get their grades back.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
      mdl35_MDL-65381
    • Pull 3.6 Branch:
      mdl36_MDL-65381
    • Pull Master Branch:

      Description

      On courses configured with separate groups, with noone in groups, the webservice call 'gradereport_user_get_grade_items' throws 'notingroup' when accessing one's own grades.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              odyx Didier Raboud
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: