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

Extend gradereport_user_get_grade_items web service to show course idnumber

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites

      1. Enable webservices, and set the protocol to rest /admin/category.php?category=webservicesettings
      2. Create a new service 'gradetest' which accesses only gradereport_user_get_grade_items with no permission restrictions
      3. Create a token for the admin account, for the 'gradetest' service

      Create a test course for testing

      1. Visit /admin/settings.php?section=debugging and set debugging level to DEVELOPER
      2. Visit /admin/tool/generator/maketestcourse.php and create an XS course for use in testing.
      3. Note the courseid
      4. Set a course idnumber and note this
      5. View the participants page
      6. Select a test user
      7. Note the user id

      Test the webservice from CLI

      1. Open a terminal (with curl installed) and execute:

        curl "{ADDRESS_HERE}/webservice/rest/server.php?wstoken={TOKEN_HERE}&wsfunction=gradereport_user_get_grade_items&moodlewsrestformat=json&courseid={COURSEID}&userid={USERID}" | json_pp -
        

        1. Verify that the 'courseidnumber' entry contains the course idnumber
      Show
      Prerequisites Enable webservices, and set the protocol to rest /admin/category.php?category=webservicesettings Create a new service 'gradetest' which accesses only gradereport_user_get_grade_items with no permission restrictions Create a token for the admin account, for the 'gradetest' service Create a test course for testing Visit /admin/settings.php?section=debugging and set debugging level to DEVELOPER Visit /admin/tool/generator/maketestcourse.php and create an XS course for use in testing. Note the courseid Set a course idnumber and note this View the participants page Select a test user Note the user id Test the webservice from CLI Open a terminal (with curl installed) and execute: curl "{ADDRESS_HERE}/webservice/rest/server.php?wstoken={TOKEN_HERE}&wsfunction=gradereport_user_get_grade_items&moodlewsrestformat=json&courseid={COURSEID}&userid={USERID}" | json_pp - Verify that the 'courseidnumber' entry contains the course idnumber
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull 3.11 Branch:
      MDL-71007-courseidnumer-grade-ws-MOODLE_311_STABLE
    • Pull Master Branch:
      MDL-71007-courseidnumer-grade-ws

      Description

      Just add the courseidnumber field to the output

        Attachments

          Activity

            People

            Assignee:
            brendanheywood Brendan Heywood
            Reporter:
            brendanheywood Brendan Heywood
            Peer reviewer:
            Peter Burnett
            Integrator:
            Adrian Greeve
            Tester:
            Sujith Haridasan
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h