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

New Web Service mod_lesson_get_pages

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. In a course create a lesson with at least one content page and one question page. Configure the lesson to show the menu (Display menu option)
      2. Enrol one user as student in the course where the lesson is.
      3. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      4. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, lessonid (the lesson instance value) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=8&wsfunction=mod_lesson_get_pages&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      6. Confirm that you receive correctly the list of pages, check that you see the content page titles (you see only the titles of content pages, no question pages)
      7. Now, as admin edit the lesson and disable the "Display menu" option
      8. Execute the curl request again and check that you don't see page titles anymore
      Show
      In a course create a lesson with at least one content page and one question page. Configure the lesson to show the menu (Display menu option) Enrol one user as student in the course where the lesson is. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for the student user 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, lessonid (the lesson instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=8&wsfunction=mod_lesson_get_pages&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Confirm that you receive correctly the list of pages, check that you see the content page titles (you see only the titles of content pages, no question pages) Now, as admin edit the lesson and disable the "Display menu" option Execute the curl request again and check that you don't see page titles anymore
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57685-master

      Description

      Return a complete list of the pages in a lesson (just the basic information, excluding contents) so external clients (like the mobile app) can print the lesson menu and calculate the amount of information to download.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              David Monllaó
              Tester:
              David Monllaó
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

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