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

New Web Service gradereport_user_get_access_information

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.1.1
    • 4.2
    • Gradebook
    • MOODLE_401_STABLE
    • MOODLE_402_STABLE
    • MDL-77585-master
    • Hide
      1. As an admin, enable web services": Site administration ► Advanced features ► Enable web services
      2. Create one course and enrol two users, one as student (s1) and the other one as teacher (t1)
      3. Enable the REST web service protocol (Site administration  ► Server  ► Web services  ► Manage protocols)
        • Make sure that the users have the appropriate capabilities to use the rest protocol (webservice/rest:use)
      4. Enable the external service 'Moodle mobile web service' (Site administration  ► Server  ► Web services  ► External services)
      5. Create a Token in the mobile app service for both users
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Open the console and execute this new curl request, replacing WS_TOKEN with the token for the student s1, COURSE_ID with the course created and the SITE_URL with yours.

        curl 'SITE_URL/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=COURSE_ID&wsfunction=gradereport_user_get_access_information&wstoken=WS_TOKEN&moodlewssettingfilter=true' | python -m "json.tool"

      1. Confirm that:
        • In the curl request response you see all values set to true except for canviewallgrades
      2. Now, repeat the CURL request but with the teacher token this time
      3. Confirm that:
        • In the curl request response you see all values set to true except for canviewmygrades
      Show
      As an admin, enable web services": Site administration ► Advanced features ► Enable web services Create one course and enrol two users, one as student (s1) and the other one as teacher (t1) Enable the REST web service protocol (Site administration  ► Server  ► Web services  ► Manage protocols) Make sure that the users have the appropriate capabilities to use the rest protocol ( webservice/rest:use) Enable the external service 'Moodle mobile web service' (Site administration  ► Server  ► Web services  ► External services) Create a Token in the mobile app service for both users Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console and execute this new curl request, replacing WS_TOKEN with the token for the student s1, COURSE_ID with the course created and the SITE_URL with yours. curl 'SITE_URL/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=COURSE_ID&wsfunction=gradereport_user_get_access_information&wstoken=WS_TOKEN&moodlewssettingfilter=true' | python -m "json.tool" Confirm that: In the curl request response you see all values set to true except for canviewallgrades Now, repeat the CURL request but with the teacher token this time Confirm that: In the curl request response you see all values set to true except for canviewmygrades

    Description

      In order to be able to check if an existing user is able to view the course gradebook (including participant's grades), we'd need a new Web Service returning access permission as the one implemented for activity modules.

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Rodrigo Mady Rodrigo Mady
              Mihail Geshoski Mihail Geshoski
              Kim Jared Lucas Kim Jared Lucas
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Apr/23

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 16 minutes
                  4h 16m