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

Return if the user is tracking the forum on mod_forum_get_forums_by_courses

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 3.3
    • 3.2.1
    • Forum, Web Services
    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57627-master
    • Easy
    • Hide
      1. Create a course with a student.
      2. Create a forum with optional tracking.
      3. Enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student user
        • You need to replace the wstoken and the URL of your moodle instance:

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_forum_get_forums_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed

      6. Confirm that the istracked is returned for the forum and that is set to false.
      7. As the student, navigate to student user preferences ► Forum preferences
      8. Change "Forum tracking" to "Yes..."
      9. Navigate to the forum and confirm you are tracking it (if not, enable tracking for the forum).
      10. Perform the same curl request but not check istracked is true.
      Show
      Create a course with a student. Create a forum with optional tracking. Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user You need to replace the wstoken and the URL of your moodle instance: curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_forum_get_forums_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that the istracked is returned for the forum and that is set to false. As the student, navigate to student user preferences ► Forum preferences Change "Forum tracking" to "Yes..." Navigate to the forum and confirm you are tracking it (if not, enable tracking for the forum). Perform the same curl request but not check istracked is true.

      Now the only way to know if the user is tracking a forum is to check numunread on forums, but it can have false negatives if the user is tracking it but there are no unread items. A new field have to be returned in order to know if the user is tracking it.

      Check this comment for more information.

            pferre22 Pau Ferrer
            pferre22 Pau Ferrer
            Juan Leyva Juan Leyva
            Dan Poltawski Dan Poltawski
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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