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

WS core_course_get_courses_by_field should support a new parameter (sectionid) to be able to retrieve the course that has the indicated section

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-81699-main
    • Hide
      1. As admin, enable "Mobile services":
        • Enable “Web services for mobile devices” on Site administration ► Advanced features
          • Create a Token for the User administrator via Site administration ► Plugins ► Web services ► Manage tokens
      2. Obtain Course section
        • Create 2 courses or navigate to existing courses
        • Enter a course and click in a section.
        • Save the sectionid value you see at the URL, like MOODLE_URL/course/section.php?id=$sectionid
        • Repeat this for different sections in diferent courses.
      3. Next, make CURL REST call simulating a WS client with the administrator user.
        • You need to replace the $wstoken, the $sectionid and the MOODLE_URL:
          curl 'MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_course_get_courses_by_field&wstoken=$wstoken&field=sectionid&value=$sectionid' --compressed
        • Run the CURL and confirm that You receive the course information
      4. Now, run the CURL command with an invalid $sectionid.
        • Confirm that You will not receive the course information
      Show
      As admin, enable "Mobile services": Enable “Web services for mobile devices” on Site administration ► Advanced features Create a Token for the User administrator via Site administration ► Plugins ► Web services ► Manage tokens Obtain Course section Create 2 courses or navigate to existing courses Enter a course and click in a section. Save the sectionid value you see at the URL, like MOODLE_URL/course/section.php?id=$sectionid Repeat this for different sections in diferent courses. Next, make CURL REST call simulating a WS client with the administrator user. You need to replace the $wstoken, the $sectionid and the MOODLE_URL: curl 'MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_course_get_courses_by_field&wstoken=$wstoken&field=sectionid&value=$sectionid' --compressed Run the CURL and confirm that You receive the course information Now, run the CURL command with an invalid $sectionid. Confirm that You will not receive the course information

      This will help app the mobile app to handle links to the new /course/section.php?id=X page, as we'd need to guess somewhat the course a section belongs to.

            daniure Dani Ureña
            jleyva Juan Leyva
            Juan Leyva Juan Leyva
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h

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