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

New Web Service core_block_get_course_blocks

    XMLWordPrintable

    Details

    • Testing Instructions:
      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).
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50970-master

      Description

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Pau Ferrer
              Integrator:
              Andrew Nicols
              Tester:
              Damyon Wiese
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Jake Dallimore, Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17