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

Return the number of unread posts in tracked forums via Web Services

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create in a new course a general forum with tracking enabled.
      2. Enrol a user as student in the course, the user must enable tracking in his profile.
      3. Using a teacher account add a discussion in the forum
      4. Access to the course as the student and check that in the course main page you see at the right of the forum the number of unread posts. Do not access to the forum.
      5. Enable "Mobile services": Administration ► Mobile app ► Mobile settings
      6. You need a token for the student user for the Mobile Service, for creating a Token:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
        • Click add, select user and service (Mobile Service)
          all the forum discussions
      7. Execute the following CURL command in a shell (replace courseids - 4 value - with your course id and wstoken with your token)

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json'  --data 'courseids%5B0%5D=4&wsfunction=mod_forum_get_forums_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true'  | python -m "json.tool"
        

      8. Confirm that you receive a list of forums and that for the forum with tracking enabled you see correctly the unreadpostscount with the number of unread posts
      Show
      Create in a new course a general forum with tracking enabled. Enrol a user as student in the course, the user must enable tracking in his profile. Using a teacher account add a discussion in the forum Access to the course as the student and check that in the course main page you see at the right of the forum the number of unread posts. Do not access to the forum. Enable "Mobile services": Administration ► Mobile app ► Mobile settings You need a token for the student user for the Mobile Service, for creating a Token: Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (Mobile Service) all the forum discussions Execute the following CURL command in a shell (replace courseids - 4 value - with your course id and wstoken with your token) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=4&wsfunction=mod_forum_get_forums_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true' | python -m "json.tool" Confirm that you receive a list of forums and that for the forum with tracking enabled you see correctly the unreadpostscount with the number of unread posts
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58444-master

      Description

      For tracked forums we should be returning the number of unread posts (as Moodle web interface does when printing the forums in the course)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                Pau Ferrer
                Integrator:
                Andrew Nicols
                Tester:
                Andrew Nicols
                Participants:
                Component watchers:
                Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Juan Leyva, Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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