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

New Web Service mod_lti_view_lti

    XMLWordPrintable

Details

    • MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • MDL-51624-master
    • Hide

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

      1. Create a course with a student, the course must have at least one section.
      2. Enable completion at site level and course level.
      3. Create a mod_lti activity:
      1. Use as completion criteria "Student must view this activity to complete it"
      2. Log in as the student and visit the lti activity
      3. 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)
      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, ltiid (the lti instance value) and the URL of your moodle instance

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

      7. Confirm that
        • You can see new entries in the course log (lti 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" (lti 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_lti list of external functions. 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_lti activity: Launch URL: http://www.imsglobal.org/developers/LTI/test/v1p1/tool.php Shared secret: secret Consumer key: 12345 Use as completion criteria "Student must view this activity to complete it" Log in as the student and visit the lti 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, ltiid (the lti instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'ltiid=2&wsfunction=mod_lti_view_lti&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that You can see new entries in the course log (lti 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" (lti 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.

    Description

      This function will trigger the module view event and call completion API

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Dani Palou Dani Palou
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                16/Nov/15