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

core_course_get_contents should return section number

    XMLWordPrintable

    Details

    • Testing Instructions:
      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)
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-54104-master

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16