Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29934 Web service API Roadmap
  3. MDL-49503

New Web Service mod_forum_view_forum_discussion

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.5
    • 2.9
    • Web Services
    • MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-49503-master
    • Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service and to the forum list of external functions.

      1. Create a course with a student,.
      2. Create a forum activity, as student or admin create a discussion with a couple of replies (you will need the discussion id later).
      3. As admin or teacher, go to the Course logs and check that there are log entries for the "Discussion viewed" event with origin "web"
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, discussionid (the discussion you created id value) and the URL of your moodle instance

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

      7. Confirm that
        • You can see new entries in the course log (Discussion viewed) for that course, the user and the forum. The origin for the new log entries is "ws"
        • If you use an invalid discussion id you will get errors
      Show
      Note: Version number is bumped because a new web service is added into the Mobile app service and to the forum list of external functions. Create a course with a student,. Create a forum activity, as student or admin create a discussion with a couple of replies (you will need the discussion id later). As admin or teacher, go to the Course logs and check that there are log entries for the "Discussion viewed" event with origin "web" As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user 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, discussionid (the discussion you created id value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'discussionid=16&wsfunction=mod_forum_view_forum_discussion&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' Confirm that You can see new entries in the course log (Discussion viewed) for that course, the user and the forum. The origin for the new log entries is "ws" If you use an invalid discussion id you will get errors

    Description

      Trigger the discussion_viewed event when a user view a forum discussion (this web service will be initially used by the mobile app so information can be logged in the Moodle side when a user see the same page in the app).

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Dani Palou Dani Palou
              Damyon Wiese Damyon Wiese
              Jetha Chan Jetha Chan
              Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/15