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

New Web Service mod_lesson_get_attempts_overview

XMLWordPrintable

    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57754-master
    • Hide
      1. In a course create a lesson with at least two content pages and one question page. Enable multiple attempts in the lesson.
      2. Enrol one user as student and another as teacher in the course where the lesson is.
      3. Access to the lesson as student in the Moodle web interface, and complete the lesson.
      4. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      5. Create a Token for the teacher 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 teacher user token.
        • You need to replace the wstoken, lessonid (the lesson instance value)

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

      7. Now check that the information returned match the one in the Moodle web interface (Lesson -> Reports -> Overview)
      8. Now, as student, do the lesson again (second attempt)
      9. Execute the WS again an check that you see correctly that the user did two attempts.
      Show
      In a course create a lesson with at least two content pages and one question page. Enable multiple attempts in the lesson. Enrol one user as student and another as teacher in the course where the lesson is. Access to the lesson as student in the Moodle web interface, and complete the lesson. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for the teacher user Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the teacher user token. You need to replace the wstoken, lessonid (the lesson instance value) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'lessonid=4&wsfunction=mod_lesson_get_attempts_overview&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&moodlewssettingfilter=true' | python -m "json.tool" Now check that the information returned match the one in the Moodle web interface (Lesson -> Reports -> Overview) Now, as student, do the lesson again (second attempt) Execute the WS again an check that you see correctly that the user did two attempts.

      Get a list of all the attempts made by users in a lesson (so a teacher can review the attempts), including all attempts statistics.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            David Monllaó David Monllaó
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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