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

core_course_get_contents should return section number

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_32_STABLE
    • MDL-54104-master
    • Hide
      1. Create or use a course with several sections
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for one user enrolled in the course:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, courseid and the URL of your moodle instance

          curl 'https://latrobe.moodlecloud.com/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=6&moodlewssettingfilter=true&wsfunction=core_course_get_contents&wstoken=dee52490e679ab04c3ff6527c4efa9aa' --compressed | python -m "json.tool"

      5. Check that in the returned response for each section, you see a new "section" field indicating the section number in the course for each section among the rest of the data (id, name, summary, summaryformat, visible, modules)
      Show
      Create or use a course with several sections As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one user enrolled in the course: 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, courseid and the URL of your moodle instance curl 'https://latrobe.moodlecloud.com/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=6&moodlewssettingfilter=true&wsfunction=core_course_get_contents&wstoken=dee52490e679ab04c3ff6527c4efa9aa' --compressed | python -m "json.tool" Check that in the returned response for each section, you see a new "section" field indicating the section number in the course for each section among the rest of the data (id, name, summary, summaryformat, visible, modules)

      The WebService core_course_get_contents returns the section ID for each section, but not its number. We should also return the section number since other WebServices require it (like core_course_view_course).

            jleyva Juan Leyva
            dpalou Dani Palou
            David Monllaó David Monllaó
            Dan Poltawski Dan Poltawski
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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