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

New Web Service mod_imscp_view_imscp

XMLWordPrintable

    • MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • MDL-50015-master
    • Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service and to the mod_imscp list of external functions.

      1. Create a course with a couple of student users enrolled, the course must have at least one section.
      2. Enable completion at site level and course level.
      3. Create a mod_imscp resource, use as completion criteria "Student must view this activity to complete it". You can use the IMS CP package found in the mod/imscp/tests/packages directory
      4. Log in as the student1 and visit the imscp
      5. 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 (reports -> logs)
      6. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      7. Create a Token for the student2 user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. Next, you can do a CURL REST call simulating a WS client with the student2 user .
        • You need to replace the wstoken, imscpid (the imscp instance value) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'imscpid=4&wsfunction=mod_imscp_view_imscp&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' --compressed

      9. Confirm that
        • You can see new entries in the course log (IMSCP 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" (IMSCP 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
      Note: Version number is bumped because a new web service is added into the Mobile app service and to the mod_imscp list of external functions. Create a course with a couple of student users enrolled, the course must have at least one section. Enable completion at site level and course level. Create a mod_imscp resource, use as completion criteria "Student must view this activity to complete it". You can use the IMS CP package found in the mod/imscp/tests/packages directory Log in as the student1 and visit the imscp 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 (reports -> logs) As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student2 user Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student2 user . You need to replace the wstoken, imscpid (the imscp instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'imscpid=4&wsfunction=mod_imscp_view_imscp&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' --compressed Confirm that You can see new entries in the course log (IMSCP 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" (IMSCP 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

            jleyva Juan Leyva
            jleyva Juan Leyva
            Jetha Chan Jetha Chan
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            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.