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

New Web Service core_course_get_activities_overview

    XMLWordPrintable

Details

    • MOODLE_31_STABLE
    • MOODLE_32_STABLE
    • MDL-54943-master
    • Hide
      1. Upgrade Moodle
      2. As admin or manager create one new course in Moodle
      3. Add a quiz or assignment activity with a close due date
      4. As admin, create a forum and add a post
      5. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      6. Create a Token for one user enrolled in the previous course with forum tracking enabled:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, courseids and the URL of your moodle instance

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

      8. Now check that the information returned by the WS is the same that the one you can see in the user dashboard (/my/index.php), you have to click on the activities to see the overview information expanded
      9. Try to obtain information for courses where you are not enrolled or courses that don't exist in the platform, you must get warnings "No access rights in course context"
      Show
      Upgrade Moodle As admin or manager create one new course in Moodle Add a quiz or assignment activity with a close due date As admin, create a forum and add a post As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one user enrolled in the previous course with forum tracking enabled: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, courseids and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=4&courseids%5B1%5D=11&wsfunction=core_course_get_activities_overview&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true' | python -m "json.tool" Now check that the information returned by the WS is the same that the one you can see in the user dashboard (/my/index.php), you have to click on the activities to see the overview information expanded Try to obtain information for courses where you are not enrolled or courses that don't exist in the platform, you must get warnings "No access rights in course context"

    Description

      Retrieve the modules overview (my courses page)

      Attachments

        Activity

          People

            jleyva Juan Leyva
            jleyva Juan Leyva
            Mark Nelson Mark Nelson
            David Monllaó David Monllaó
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              5/Dec/16