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

Return active filters in core_course_get_courses_by_field

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Component/s: Course, Filters
    • Labels:
    • Testing Instructions:
      Hide
      1. Via the Filters administration page /admin/filters.php, disable some filters and change the default values for some filters from On to Off
      2. Now, in a course, edit the filters and force some filters to On, others to Off and leave others as Default
      3. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      4. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the user.
        • 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' --data 'wsfunction=core_course_get_courses_by_field&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool"

      6. Check that the returned values for the filters in the course/s where you changed it matches the Moodle web configuration.
        • The localstate field value should be 1 when the filter is On, Value -1 when the filter is Off and value 0 when is Default.
        • The inheritedstate field value should match the global filters settings: 1 when is On by default and 0 when is Off by default
        • Disabled filters are not returned by the WS
      Show
      Via the Filters administration page /admin/filters.php, disable some filters and change the default values for some filters from On to Off Now, in a course, edit the filters and force some filters to On, others to Off and leave others as Default As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. 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' --data 'wsfunction=core_course_get_courses_by_field&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool" Check that the returned values for the filters in the course/s where you changed it matches the Moodle web configuration. The localstate field value should be 1 when the filter is On, Value -1 when the filter is Off and value 0 when is Default. The inheritedstate field value should match the global filters settings: 1 when is On by default and 0 when is Off by default Disabled filters are not returned by the WS
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57392-master

      Description

      Right now in that WS we are returning the active authentication methods, we should return also the active filters so we can know which filters should we apply in the app for text in that course (mainly for those that requires javascript like Mathjax)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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