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

New Web Service mod_lesson_get_content_pages_viewed

XMLWordPrintable

    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57664-master
    • 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

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

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            David Monllaó David Monllaó
            Marina Glancy Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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