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

New Web Service mod_lesson_get_user_timers

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Component/s: Lesson, Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. In a course create a lesson with at least one content page.
      2. Enrol one user as student in the course where the lesson is.
      3. Attempt the lesson as the student a couple of times. Be sure that you finished the lesson at least once.
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      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&wsfunction=mod_lesson_get_user_timers&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      7. Confirm that you receive correctly the two timers, the first one should be marked as completed
      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 timers.
      Show
      In a course create a lesson with at least one content page. Enrol one user as student in the course where the lesson is. Attempt the lesson as the student a couple of times. Be sure that you finished the lesson at least once. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile 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&wsfunction=mod_lesson_get_user_timers&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Confirm that you receive correctly the two timers, the first one should be marked as completed 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 timers.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57665-master

      Description

      Return the timers in the lesson for the given user.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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