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

New Web Service core_block_get_course_blocks

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • 3.3
    • 2.9, 3.3
    • Blocks, Web Services
    • MOODLE_29_STABLE, MOODLE_33_STABLE
    • MOODLE_33_STABLE
    • MDL-50970-master
    • Hide
      1. Create a course, add additional blocks, hide one of the blocks
      2. As admin, enable "Mobile services": Administration ► Mobile app ► Mobile settings
      3. Create a Token for one user enrolled in the course as student:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, courseid (with a course id where the user is enrolled) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=4&wsfunction=core_block_get_course_blocks&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' | python -m "json.tool"

      5. Confirm that you receive a complete list of the blocks in the specified course and that the list does not contain the hidden block.
      6. Replace the courseid with SITEID (usually 1) and check that you receive the list of blocks displayed on the Moodle front page (site home).
      Show
      Create a course, add additional blocks, hide one of the blocks As admin, enable "Mobile services": Administration ► Mobile app ► Mobile settings Create a Token for one user enrolled in the course as student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, courseid (with a course id where the user is enrolled) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=4&wsfunction=core_block_get_course_blocks&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' | python -m "json.tool" Confirm that you receive a complete list of the blocks in the specified course and that the list does not contain the hidden block. Replace the courseid with SITEID (usually 1) and check that you receive the list of blocks displayed on the Moodle front page (site home).

      This function will be used to return the course blocks information and optionally the block content rendered

            jleyva Juan Leyva
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Andrew Lyons Andrew Lyons
            Damyon Wiese Damyon Wiese
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

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