Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.4
    • Fix Version/s: 2.9
    • Component/s: Logging, Web Services
    • Labels:
    • Testing Instructions:
      Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service.

      1. Create a course with a student, the course must have at least one section.
      2. Access with this student to Moodle (frontpage) and to the course
      3. Access to a specific section of a course (course/view.php?id=x&section=2)
      4. As a teacher or admin, check that in the Report / Logs you see the "Course viewed" actions for the student user.
      5. As admin, enable "Mobile services": Plugins ► Web Services ► External services
      6. Create a Token for the user (not admin):
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, courseid 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 'courseid=4&wsfunction=core_course_view_course&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&sectionnumber=1' --compressed
          

      8. Confirm that
        • You can see new entries in the system/course log (course viewed) for that course and the user. The origin for the new log entries is "ws"
        • If you change courseid to an non-existent course you got an error
        • If you change courseid to a course where you are not enrolled you got an error
      Show
      Note: Version number is bumped because a new web service is added into the Mobile app service. Create a course with a student, the course must have at least one section. Access with this student to Moodle (frontpage) and to the course Access to a specific section of a course (course/view.php?id=x&section=2) As a teacher or admin, check that in the Report / Logs you see the "Course viewed" actions for the student user. As admin, enable "Mobile services": Plugins ► Web Services ► External services Create a Token for the user (not admin): 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, courseid 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 'courseid=4&wsfunction=core_course_view_course&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e&sectionnumber=1' --compressed Confirm that You can see new entries in the system/course log (course viewed) for that course and the user. The origin for the new log entries is "ws" If you change courseid to an non-existent course you got an error If you change courseid to a course where you are not enrolled you got an error
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49453-master

      Description

      We need to start logging user actions in the app, for example, if a user open a course in the app we should log the course_viewed in the site. This will help us teachers to make an effective tracking of the course and also, external tools (like learning analytics ones) will have also information from the mobile app.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15