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

Return additional information in core_get_site_info

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Enable "Mobile services": Plugins ► Web Services ► External services
      2. Create a Token for the user (student) your are going to test with:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
        • Click add, select user and service (Mobile Service)
      3. Next, you can do a CURL REST call simulating a WS client:
        • You need to replace the wstoken and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -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 'Cookie: MoodleSession=6jl8pbg3ndu6j70h4a56k0aea4' -H 'Connection: keep-alive' --data 'wsfunction=core_webservice_get_site_info&wstoken=1b9cc9f44630b554bb2c9428b8744338' --compressed
          

      4. Confirm that:
      Show
      Enable "Mobile services": Plugins ► Web Services ► External services Create a Token for the user (student) your are going to test with: Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (Mobile Service) Next, you can do a CURL REST call simulating a WS client: You need to replace the wstoken and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -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 'Cookie: MoodleSession=6jl8pbg3ndu6j70h4a56k0aea4' -H 'Connection: keep-alive' --data 'wsfunction=core_webservice_get_site_info&wstoken=1b9cc9f44630b554bb2c9428b8744338' --compressed Confirm that: You receive a new element in the json response "advancedfeatures", confirm that the settings values are the same than in the Moodle interface. http://localhost/m/stable_master/admin/settings.php?section=optionalsubsystems Do some changes in the Moodle interface, run again the client and check again that the values match. Tip: You can use this online tool: http://jsonlint.com/ for formatting the JSON response
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49333-master

      Description

      For the mobile app we need additional information about features enabled in the site (messaging, notes, usercomments, etc...)

      For example, if messaging is disabled we are not going to display that option in the app (same for comments, notes, etc...)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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