• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.9
    • 2.8.5
    • Web Services
    • MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-49502-master
    • Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service and to the forum 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 forum activity, use as completion criteria "Student must view this activity to complete it"
      4. Log in as the student and view the forum
      5. Log as teacher and check that the activity is marked as completely by the student and that the student action generated an event (reports -> logs)
      6. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      7. Create a Token for the student 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 student user .
        • You need to replace the wstoken, forumid (the forum instance value) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'forumid=4&wsfunction=mod_forum_view_forum&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' --compressed
          

      9. Confirm that
        • You can see new entries in the course log (forum 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 acitivity via the web interface with the student you will see log entries with origin "web" (forum 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 forum 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 forum activity, use as completion criteria "Student must view this activity to complete it" Log in as the student and view the forum Log as teacher and check that the activity is marked as completely by the student and that the student action generated an event (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, forumid (the forum instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'forumid=4&wsfunction=mod_forum_view_forum&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' --compressed Confirm that You can see new entries in the course log (forum 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 acitivity via the web interface with the student you will see log entries with origin "web" (forum 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 course_module_viewed event when a user view a forum (this web service will be initially used by the mobile app so information can be logged in the Moodle side when a user see the same page in the app).

      In this case, the completion information will be updated to.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            David Monllaó David Monllaó
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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