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

External function get_course_notes does not return site notes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.9.2
    • 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 the URL of your moodle instance:

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=5&wsfunction=core_notes_get_course_notes&wstoken=5e418f42c8ff42c54384016ad6c0f764' --compressed | python -m "json.tool"

      1. Confirm that you can see sitenotes, coursenotes and personalnotes
      2. Enrol the teacher in a different course and run the same command replacing the courseid with the new course one. You should see the same site notes that in the previous call
      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 the URL of your moodle instance: curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=5&wsfunction=core_notes_get_course_notes&wstoken=5e418f42c8ff42c54384016ad6c0f764' --compressed | python -m "json.tool" Confirm that you can see sitenotes, coursenotes and personalnotes Enrol the teacher in a different course and run the same command replacing the courseid with the new course one. You should see the same site notes that in the previous call
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51325-master

      Description

      There is a bug in the external function that prevents to retrieve sites notes via this function. Currently the function only returns site notes created originally in the course passed as parameter. The function should return all the site notes to mimic how the web interface work (and to allow us to display all the site notes).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Sep/15