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

New WebService mod_chat_view_sessions

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.3
    • 4.1
    • Chat
    • MOODLE_401_STABLE
    • MOODLE_403_STABLE
    • MDL-74568-master
    • Hide

      Note: The version number is bumped because new web services are added into the Mobile app service and into the mod_chat list of external functions.

      1. Create inside a course a new Chat activity
      2. Enrol two users in that course as students (student1 and student2)
      3. Log in as the students, visit the chat URL, and enter in the chat with both users: MOODLE_URL/mod/chat/view.php?id=$cmid
      4. Send messages with the users in chat
      5. Exit chat
      6. As admin, enable "Mobile services":
        Plugins ► Web Services ► Mobile
      7. Create a Token for the student1
        Click on Site administration ► Plugins ► Web services ► Manage tokens
      8. Next, you can do a CURL REST call simulating a WS client with the student1 user token.
      9. You need to replace the wstoken, cmid (the chat instance value) and the URL of your moodle instance

        curl 'MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=$cmid&wsfunction=mod_chat_view_sessions&wstoken=$wstoken' --compressed

        • Put a wrong number in cmid to return an exception
        • Change the capability mod/chat:readlog to false, retest the user access to the webservice function, should return a warning
      10. Access your course logs, filter by Web service, and check if have a session view register for student1 from Webservice that you created

       

      Show
      Note: The version number is bumped because new web services are added into the Mobile app service and into the mod_chat list of external functions. Create inside a course a new Chat activity Enrol two users in that course as students (student1 and student2) Log in as the students, visit the chat URL, and enter in the chat with both users: MOODLE_URL/mod/chat/view.php?id=$cmid Send messages with the users in chat Exit chat As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student1 Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student1 user token. You need to replace the wstoken, cmid (the chat instance value) and the URL of your moodle instance curl 'MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=$cmid&wsfunction=mod_chat_view_sessions&wstoken=$wstoken' --compressed Put a wrong number in cmid to return an exception Change the capability mod/chat:readlog to false, retest the user access to the webservice function, should return a warning Access your course logs, filter by Web service, and check if have a session view register for student1 from Webservice that you created  

      WebService just to log that you viewed previous sessions (the LMS version does that, the app doesn't)

            rodrigo.mady@moodle.com Rodrigo Mady
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Jake Dallimore Jake Dallimore
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 4 days, 22 minutes
                1w 4d 22m

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