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

New Web Service mod_lesson_get_content_pages_viewed

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. In a course create a lesson with at least two content pages and one question page, configured to allow multiple attempts.
      2. Enrol one user as student in the course where the lesson is.
      3. Attempt the lesson as the student a couple of times.
      4. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      5. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. 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=5&lessonattempt=0&wsfunction=mod_lesson_get_content_pages_viewed&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      7. Confirm that you receive correctly the list of pages viewed.
      8. Now, create a token for a teacher in the course and execute again the curl request appending: &userid=X (X is the id of the student user who attempted the lesson)
      9. Confirm that you receive correctly the list of pages
      Show
      In a course create a lesson with at least two content pages and one question page, configured to allow multiple attempts. Enrol one user as student in the course where the lesson is. Attempt the lesson as the student a couple of times. 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=5&lessonattempt=0&wsfunction=mod_lesson_get_content_pages_viewed&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Confirm that you receive correctly the list of pages viewed. Now, create a token for a teacher in the course and execute again the curl request appending: &userid=X (X is the id of the student user who attempted the lesson) Confirm that you receive correctly the list of pages
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57664-master

      Description

      Return the list of content pages (formerly known as "branch tables") that a user visited during an attempt in a lesson.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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