XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • Minor
    • 2.9
    • 2.8.3
    • Web Services
    • MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-49347-master
    • Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service.

      1. Create a course with a student and and two teachers
      2. Create a forum with ratings enabled (choose aggregation type): Ratings ► Aggregate type ( Average of ratings, for example ) and scale Points (Max 100 points)
      3. As student add a topic to the forum
      4. As teacher1 rate that topic
      5. As teacher2 rate that topic (giving a different rate value)
      6. Enable "Mobile services": Plugins ► Web Services ► Mobile
      7. Create a Token for the teacher1 :
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. Next, you can do a CURL request simulating a WS client with the teacher1 user
        • You need to replace the wstoken, instanceid, itemid and the URL of your moodle instance.
        • instanceid: The course module id
        • itemid: The discussion id (where the ratigns are)

      curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'contextlevel=module&instanceid=85&component=mod_forum&ratingarea=post&itemid=28&scaleid=100&sort=fullname&wsfunction=core_rating_get_item_ratings&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e'

      Confirm that:

      • You receive a list with all the ratings for the discussion
      • Use an invalid itemid (like 0) you will receive an empty list
      • Use an invalid ratingarea, you will receive a empty list
      • Use an invalid instanceid, you will receive an iinvalid_parameter_exception error, contest does not exists
      Show
      Note: Version number is bumped because a new web service is added into the Mobile app service. Create a course with a student and and two teachers Create a forum with ratings enabled (choose aggregation type): Ratings ► Aggregate type ( Average of ratings, for example ) and scale Points (Max 100 points) As student add a topic to the forum As teacher1 rate that topic As teacher2 rate that topic (giving a different rate value) Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the teacher1 : Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL request simulating a WS client with the teacher1 user You need to replace the wstoken, instanceid, itemid and the URL of your moodle instance. instanceid: The course module id itemid: The discussion id (where the ratigns are) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'contextlevel=module&instanceid=85&component=mod_forum&ratingarea=post&itemid=28&scaleid=100&sort=fullname&wsfunction=core_rating_get_item_ratings&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' Confirm that: You receive a list with all the ratings for the discussion Use an invalid itemid (like 0) you will receive an empty list Use an invalid ratingarea, you will receive a empty list Use an invalid instanceid, you will receive an iinvalid_parameter_exception error, contest does not exists

    Description

      New external function for retrieving all the ratings for an item

      Attachments

        Activity

          People

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Dan Poltawski Dan Poltawski
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

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