Brickfield Education Labs

Introduction

This Course Tag API tool plugin uses standard Moodle Web service functionality to enable a custom API web service to tag courses. Hence, this plugin provides a simple process for tagging courses in bulk.

 

This requires some initial setup from a site administrator to configure both a webservice and a custom role. Once configured, a suitable user should be granted the role, which has the relevant capabilities required for this plugin to tag courses.

The page output after successfully adding tags to a course. It displays the following text: This XML file does not appear to have any style information associated with it. The document tree is shown below. The JSON output is: Success 2, taginstances created or already existing.

Administration

This section is for the administration of the Course Tag API tool plugin.

Version Support

This plugin is supported for Moodle versions 3.9, 3.11, 4.00, 4.01, 4.02, and 4.03.

Deployment

To install the Course Tag API tool (tool_coursetagger):

  1. Unzip and copy the coursetagger folder into Moodle’s admin/tool/ folder.
  2. Go to Site administration > Notifications to install the tool.

 

Further installation instructions can be found on the Installing plugins Moodle documentation page.

Copyright and funding

This plugin has been developed, maintained, and is copyrighted by Brickfield Education Labs. The funding for this plugin was provided by Dublin City University (DCU) and Maynooth.

Usage as Site administrator

This involves creating and configuring a custom role for users to use for the purpose of using this Course Tag API tool. Additionally, this will require configuring a web service and creating a token for the user to use. This token is then used for any API calls pushing data to the web service.

Creating the custom role

To create the custom role to use this Course Tag API tool:

  1. Create a new custom user role, following this Moodle user roles documentation.
  2. Add the following capabilities to the new user role:
    • ‘webservice/rest:use’ capability – Use REST protocol.
      1. If using any different protocols, please add their capabilities as well.
    • ‘moodle/tag:manage’ capability – Manage all tags.
    • ‘moodle/course:tag’ capability – Change course tags.
  3. Assign a new user to this custom role.

Configuring the Web services

To configure the Web services for this Course Tag API tool:

  1. Go to Site administration > General > Advanced features
  2. Ensure the Enable web services setting is enabled.
  3. Go to Site administration > Server > Web services > Manage protocols

 

Ensure the REST protocol is enabled or the protocol you intend to use.

Authorising the user

To authorise the user for this Course Tag API tool:

  1. Ensure a user has been assigned the custom role.
  2. Go to Site administration > Server > Web services > External services
  3. Click the Authorised users link for the External service: Create course tags. This will bring you to the Select Authorised users page.
  4. Select the custom role in the Not authorised users list. For convenience, you can consider using the admin account just for a local development site. However, for a production site, you should use a dedicated specific user to process this.
  5. Click the Add button.

Creating a user token

To create the user token for this Course Tag API tool:

  1. Go to Site administration > Server > Web services > Overview
  2. Click the Create a token for a user link.
  3. In the User drop-down menu, select the user assigned the custom role.
  4. In the Service drop-down menu, select the Create course tags option.
  5. Click the Save changes button.
  6. Copy and save the Token to use.