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

New Web Service mod_data_get_fields

XMLWordPrintable

    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57919-master
    • Hide
      1. Create a course with a database using the image gallery preset
      2. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      3. Create a Token in the mobile app service for a student enrolled in the course where the database is:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the student token.
        • You need to replace the wstoken, databaseid (with the database instance id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=13&wsfunction=mod_data_get_fields&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      5. Now check that you receive correctly the list of fields that the database is using (in this case the fields for the image gallery preset)
      6. You can compare the information returned by the WS with the records in the data_fields table in the Moodle DB for the database activity.
      Show
      Create a course with a database using the image gallery preset Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for a student enrolled in the course where the database is: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student token. You need to replace the wstoken, databaseid (with the database instance id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=13&wsfunction=mod_data_get_fields&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that you receive correctly the list of fields that the database is using (in this case the fields for the image gallery preset) You can compare the information returned by the WS with the records in the data_fields table in the Moodle DB for the database activity.

      Return the list of configured fields for the given database.

      This will require each field type to return the settings available to avoid security issues (maybe there are configuration tokens exposed there)

            jleyva Juan Leyva
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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