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

New Web Service mod_quiz_view_quiz

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1
    • 3.0.1
    • Quiz, Web Services
    • MOODLE_30_STABLE
    • MOODLE_31_STABLE
    • MDL-52669-master
    • Hide
      1. Bump your /version.php file to force Moodle to reload the Mobile service
      2. Create a course with a student, the course must have at least one section.
      3. Enable completion at site level and course level.
      4. Create a mod_quiz activity:
      5. Use as completion criteria "Student must view this activity to complete it"
      6. Log in as the student and visit the quiz activity
      7. Log in as teacher and check that the activity is marked as completed by the student and that the student action generated a new entry in the logs (course -> reports -> logs)
      8. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      9. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      10. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, quizid (the quiz instance value) and the URL of your moodle instance

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

      11. Confirm that
        • You can see new entries in the course log (quiz course module viewed) for that course and the user. The origin for the new log entries is "ws"
        • If you access via the web interface you will see the activity marked as completed, if you access the resoure via the web interface with the student you will see log entries with origin "web" (quiz course module viewed)
          NOTE: If you don't see the activity marked as completed you should logout and login again, Moodle session cache sometimes does not upgrade the completion status for activities.
      Show
      Bump your /version.php file to force Moodle to reload the Mobile service Create a course with a student, the course must have at least one section. Enable completion at site level and course level. Create a mod_quiz activity: Use as completion criteria "Student must view this activity to complete it" Log in as the student and visit the quiz activity Log in as teacher and check that the activity is marked as completed by the student and that the student action generated a new entry in the logs (course -> reports -> logs) 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, quizid (the quiz instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'quizid=2&wsfunction=mod_quiz_view_quiz&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that You can see new entries in the course log (quiz course module viewed) for that course and the user. The origin for the new log entries is "ws" If you access via the web interface you will see the activity marked as completed, if you access the resoure via the web interface with the student you will see log entries with origin "web" (quiz course module viewed) NOTE: If you don't see the activity marked as completed you should logout and login again, Moodle session cache sometimes does not upgrade the completion status for activities.

      Trigger the module view event and update completion status.

      This Web Service is required by external system to be able to log interactions and update the completion status of the module, see MDL-29934 for a list of modules currently implementing this Web Service (forum, lti, scorm, imscp, glossary, wiki, etc..) and MDL-49076 (policy issue) for the rationale of this approach.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            John Okely John Okely
            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.