XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.3
    • Fix Version/s: 2.9
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service.

      1. Enable notes by configuration (if not already enabled) Home ►Site administration ►Advanced features (checkbox) Enable notes
      2. Create a course with a student and a teacher
      3. As teacher create notes at site, course and personal level for this student
      4. Enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the teacher :
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a couple of CURL REST call simulating a WS client with the teacher user .
        • You need to replace the wstoken, courseid and userid and the URL of your moodle instance:

          curl 'http://localhost/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'courseid=5&userid=4&wsfunction=core_notes_get_course_notes
          &wstoken=5e418f42c8ff42c54384016ad6c0f764' --compressed
          

      1. Confirm that you can see sitenotes, coursenotes and personalnotes
        ( in this case one note for each type )
        Add another teacher to this course and repeat the call with his token,
        you should see teacher’s site and course notes (but not personal notes).
        Create a token for an admin or manager (with the capability notes:view at system level), then replace the courseid and userid values with 0. You should retrieve all the site notes for the users in the system.
        Now, as admin or manager use courseid = 0 and a valid userid (with notes at course level) you should see all the notes at site and course level for that user.
      Show
      Note: Version number is bumped because a new web service is added into the Mobile app service. Enable notes by configuration (if not already enabled) Home ►Site administration ►Advanced features (checkbox) Enable notes Create a course with a student and a teacher As teacher create notes at site, course and personal level for this student Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the teacher : Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a couple of CURL REST call simulating a WS client with the teacher user . You need to replace the wstoken, courseid and userid and the URL of your moodle instance: curl 'http://localhost/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'courseid=5&userid=4&wsfunction=core_notes_get_course_notes &wstoken=5e418f42c8ff42c54384016ad6c0f764' --compressed Confirm that you can see sitenotes, coursenotes and personalnotes ( in this case one note for each type ) Add another teacher to this course and repeat the call with his token, you should see teacher’s site and course notes (but not personal notes). Create a token for an admin or manager (with the capability notes:view at system level), then replace the courseid and userid values with 0. You should retrieve all the site notes for the users in the system. Now, as admin or manager use courseid = 0 and a valid userid (with notes at course level) you should see all the notes at site and course level for that user.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49330-master

      Description

      Retrieve a list of notes from a course, filtering by userid (optional)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/15