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

Add rich text editor/file support to the site wide notes feature

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.2, 4.2.1
    • User management
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • Hide

      Setup

      1. Log in as admin
      2. Create a new course
        • Ensure admin is enrolled in course as teacher (they should be by default)
      3. Enable web services
      4. Create new custom service
        • Name: Notes
        • Enabled: Yes
      5. Add the following functions to the Notes service:
        • core_notes_get_notes
      6. Create a token for admin user to use the Notes service

      Test creation

      1. Navigate to your profile from user menu
      2. Press Notes
      3. Under your course name press Add a new note
        • Context: course
        • Content: Use the editor to add a picture to the text area
      4. Under Site notes press Add a new note
        • Context: site
        • Content: Use the editor to add a different picture to the text area
      5. Under Personal notes press Add a new note
        • Context: personal
        • Content: Use the editor to add another different picture to the text area
      6. On Notes page confirm images for each note are shown correctly
      7. Edit one of the notes
      8. Confirm the same uploaded image is present in the editor
      9. Add some formatting (bold, italic, etc) text to the Content editor, and save
      10. Confirm edited note displays as expected on Notes page

      Test custom report

      1. Navigate to Reports from user menu
      2. Create new report from Notes report source
        • Include default setup: Yes
      3. Confirm each note shows correctly in the Note > Content column

      Test external service

      1. In your DB editor run the following query, note the id of each entry:

        SELECT * FROM moodle.m_post WHERE module = 'notes';
        

      2. Execute the following:

        $ curl --silent "<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=<TOKEN>&wsfunction=core_notes_get_notes&notes[]=<ID1>&notes[]=<ID2>&notes[]=<ID3>" | python -m "json.tool"
        

      3. Confirm that the "text" property of each returned note contains <img ...> tag with <WWWROOT>/webservice/pluginfile.php URL

      Test deletion

      1. In your DB editor run the following query, note the itemid of each entry:

        SELECT * FROM moodle.m_files WHERE component = 'notes';
        

      2. Navigate to your profile from user menu
      3. Press Notes
      4. Press Delete for one of the notes
      5. Make a note of the ?id=<NOTEID> parameter in the URL
      6. Press Continue in the confirmation box
      7. In your DB editor, re-run the same query
      8. Confirm that entries where itemid equals the deleted <NOTEID> are not present
      Show
      Setup Log in as admin Create a new course Ensure admin is enrolled in course as teacher (they should be by default) Enable web services Create new custom service Name: Notes Enabled: Yes Add the following functions to the Notes service: core_notes_get_notes Create a token for admin user to use the Notes service Test creation Navigate to your profile from user menu Press Notes Under your course name press Add a new note Context: course Content: Use the editor to add a picture to the text area Under Site notes press Add a new note Context: site Content: Use the editor to add a different picture to the text area Under Personal notes press Add a new note Context: personal Content: Use the editor to add another different picture to the text area On Notes page confirm images for each note are shown correctly Edit one of the notes Confirm the same uploaded image is present in the editor Add some formatting (bold, italic, etc) text to the Content editor, and save Confirm edited note displays as expected on Notes page Test custom report Navigate to Reports from user menu Create new report from Notes report source Include default setup: Yes Confirm each note shows correctly in the Note > Content column Test external service In your DB editor run the following query, note the id of each entry: SELECT * FROM moodle.m_post WHERE module = 'notes'; Execute the following: $ curl --silent "<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=<TOKEN>&wsfunction=core_notes_get_notes&notes[]=<ID1>&notes[]=<ID2>&notes[]=<ID3>" | python -m "json.tool" Confirm that the "text" property of each returned note contains <img ...> tag with <WWWROOT>/webservice/pluginfile.php URL Test deletion In your DB editor run the following query, note the itemid of each entry: SELECT * FROM moodle.m_files WHERE component = 'notes'; Navigate to your profile from user menu Press Notes Press Delete for one of the notes Make a note of the ?id=<NOTEID> parameter in the URL Press Continue in the confirmation box In your DB editor, re-run the same query Confirm that entries where itemid equals the deleted <NOTEID> are not present
    • Hide

      Code verified against automated checks.

      Checked MDL-78476 using repository: https://github.com/paulholden/moodle

      More information about this report

      Built on: Tue Jun 10 14:06:27 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-78476 using repository: https://github.com/paulholden/moodle main (0 errors / 0 warnings) [branch: MDL-78476 | CI Job ] More information about this report Built on: Tue Jun 10 14:06:27 UTC 2025

      The existing 'Notes' facility works really well for textual notes, but could this be extended to allow files to be attached to these notes?

            pholden Paul Holden
            davefoord Dave Foord
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.