WebService Filter for Moodle Mobile app

Filters ::: filter_ws
Maintained by Dani Palou
Part of set Moodle Mobile app.
With the WebService filter plugin you can choose if some content should be visible only in web (browser) or only in a WebService client like the Moodle apps (mobile and desktop). The main purpose of this plugin is to be able to display/hide some content only for the Moodle app.

WebService Filter for Moodle Mobile app 1.0.0

Moodle 3.1, 3.2, 3.3, 3.4, 3.5, 3.6
Released: Monday, 21 January 2019, 5:18 PM

WS filter plugin

With this plugin you can choose if some content should be visible only in web (browser) or only in a WebService client like the Moodle apps. The main purpose of this plugin is to be able to display/hide some content only for the Moodle app.

To Install it manually

  • Unzip the plugin in the moodle .../filter/ directory.
  • Enable it from "Site Administration >> Plugins >> Filters >> Manage filters".

To Use it

  • Enclose the content you want to filter between {fws} tags:
    {fws web}content only for web{fws}
    {fws ws}content only for ws{fws}
    {fws any}content for any request{fws}
  
  • Test it in a browser and in the Moodle app.

Example: We edit a SCORM description and put the content in the following screenshot:

You can see we have 3 pieces of content. The first one doesn't have any special tag, so it will be displayed everywhere. The second block has the "web" keyword, so it will only be displayed if the user is using a browser. Finally, the last block will only be displayed in a WS client (in our case, the Moodle app). You can see the result in the following screenshots:

Filtering by User Agent

You can also specify a regular expression to filter the requests by user agent. To do so, you need to add a ua="MY_REGEXP" attribute to the {fws} tag, where MY_REGEXP is the regular expression you want to check (without starting and ending slashes). Example:

    {fws ws ua="MoodleMobile\s?$" }content only for the official Moodle app{fws}
    {fws any ua="iPhone|iPad|iPod"}content only for iOS devices{fws}

Version information

Version build number
2019011800
Version release name
1.0.0
Maturity
Stable version
MD5 Sum
53eb4851e7e0e0086bda0c98ed2f61af
Supported software
Moodle 3.1, Moodle 3.2, Moodle 3.3, Moodle 3.4, Moodle 3.5, Moodle 3.6
  • Latest release for Moodle 3.1
  • Latest release for Moodle 3.2
  • Latest release for Moodle 3.3
  • Latest release for Moodle 3.4
  • Latest release for Moodle 3.5
  • Latest release for Moodle 3.6

Default installation instructions for plugins of the type Filters

  1. Make sure you have all the required versions.
  2. Download and unpack the filter plugin.
  3. Place the folder (eg "myfilter") in the "filter" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation