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

New web services for triggering events in mod_quiz

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1
    • 3.0.2
    • Quiz
    • MOODLE_30_STABLE
    • MOODLE_31_STABLE
    • MDL-52888-master
    • Hide
      1. Bump your /version.php file to force Moodle to reload the Mobile service
      2. Create a course with a student
      3. Create a mod_quiz activity
      4. Log in as the student and visit the quiz activity, start a new attempt
      5. Then go to the summary view
      6. And finally, submit the attempt and review it
      7. Log in as teacher and check that the student action generated several entries in the logs (course -> reports -> logs) (quiz attempt viewed, Quiz attempt summary viewed and Quiz attempt reviewed with origin web)
      8. Now, as the student again start a new fresh attempt (do nothing else)
      9. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      10. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      11. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, attempid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'attemptid=2&wsfunction=mod_quiz_view_attempt&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&page=0' --compressed

      12. Confirm that
        • You can see new entries in the course log (quiz attempt viewed) for that course and the user. The origin for the new log entries is "ws"
      13. Now, execute the same curl request but removing &page=0 and replacing, mod_quiz_view_attempt with mod_quiz_view_attempt_summary
      14. Check that there is a new entry in the course log (quiz attempt summary viewed) with origin "ws"
      15. Now, as the student, log in in Moodle and finish the attempt
      16. Execute the same curl request replacing mod_quiz_view_attempt_summary with mod_quiz_view_attempt_review
      17. Check that there is a new entry in the course log (quiz attempt reviewed) with origin "ws"
      Show
      Bump your /version.php file to force Moodle to reload the Mobile service Create a course with a student Create a mod_quiz activity Log in as the student and visit the quiz activity, start a new attempt Then go to the summary view And finally, submit the attempt and review it Log in as teacher and check that the student action generated several entries in the logs (course -> reports -> logs) (quiz attempt viewed, Quiz attempt summary viewed and Quiz attempt reviewed with origin web) Now, as the student again start a new fresh attempt (do nothing else) 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, attempid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'attemptid=2&wsfunction=mod_quiz_view_attempt&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&page=0' --compressed Confirm that You can see new entries in the course log (quiz attempt viewed) for that course and the user. The origin for the new log entries is "ws" Now, execute the same curl request but removing &page=0 and replacing, mod_quiz_view_attempt with mod_quiz_view_attempt_summary Check that there is a new entry in the course log (quiz attempt summary viewed) with origin "ws" Now, as the student, log in in Moodle and finish the attempt Execute the same curl request replacing mod_quiz_view_attempt_summary with mod_quiz_view_attempt_review Check that there is a new entry in the course log (quiz attempt reviewed) with origin "ws"

      mod_quiz_view_attempt (attemptid, page)

      To trigger the attempt viewed event and to set the current page in the attempt.

      mod_quiz_view_attempt_summary (attempt)

      To trigger the attempt summary viewed event.

      mod_quiz_view_attempt_review (attempt)

      To trigger the attempt reviewed event.

      All returning a status field

            jleyva Juan Leyva
            jleyva Juan Leyva
            Tim Hunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Mark Nelson Mark Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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