XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.5
    • 2.9
    • Web Services
    • MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-49499-master
    • Hide

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

      1. Create a new course, enrol a student and a teacher to that course
      2. Access to the course participants page via the navigation block, view a user profile
      3. As a teacher or admin, check that in the course Report / Logs you see the "User profile viewed" actions for the current user.
      4. Now, see the "full profile" of the user (a link at the bottom in the previous page where the user course profile was displayed)
      5. As an admin, check that in the System Report / Logs you see the "User profile viewed" action for the current user at system level (not course).
      6. As admin, enable "Mobile services": Plugins ► Web Services ►Mobile
      7. Create a Token for a teacher or admin enrolled in the course you used previously:
        • Click on Site administration ► Plugins ► Web services ► Tokens
      8. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, userid (with the student user id) and courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'userid=106&courseid=4&wsfunction=core_user_view_user_profile&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e'

      9. Confirm that
        • You can see new entries in the course log (User profile viewed) for that course and the user. The origin for the new log entries is "ws"
      10. Try to use invalid course or users, or users not inrolled in the specified course, you will see different errors
      Show
      Note: Version number is bumped because a new web service is added into the Mobile app service. Create a new course, enrol a student and a teacher to that course Access to the course participants page via the navigation block, view a user profile As a teacher or admin, check that in the course Report / Logs you see the "User profile viewed" actions for the current user. Now, see the "full profile" of the user (a link at the bottom in the previous page where the user course profile was displayed) As an admin, check that in the System Report / Logs you see the "User profile viewed" action for the current user at system level (not course). As admin, enable "Mobile services": Plugins ► Web Services ►Mobile Create a Token for a teacher or admin enrolled in the course you used previously: Click on Site administration ► Plugins ► Web services ► Tokens Next, you can do a CURL REST call simulating a WS client with the student user . You need to replace the wstoken, userid (with the student user id) and courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'userid=106&courseid=4&wsfunction=core_user_view_user_profile&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' Confirm that You can see new entries in the course log (User profile viewed) for that course and the user. The origin for the new log entries is "ws" Try to use invalid course or users, or users not inrolled in the specified course, you will see different errors

    Description

      Trigger the user_profile_viewed event when a user view a user profile (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).

      Attachments

        Activity

          People

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Jetha Chan Jetha Chan
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/May/15