Skip to content

Installation and configuration

Daniel-Schroeter edited this page Jun 18, 2024 · 2 revisions

Introduction

The purpose of this Moodle plugin is to extend the Moodle Web Service API with several functions to allow publishing files and links via HTTP-requests. Together with this plugin a desktop application, named MoodleSync, is developed which offers the possibility to synchronize a local directory with a dedicated moodle course. Further information about MoodleSync can be found in following repository: https://github.com/MoodleSync/sync-app.

This wiki will give you a short explanation of how to install the plugin, which configurations are needed to be set at your Moodle platform and which permissions a user will need to use the plugin.

Installation

There are two ways to install the plugin:

  • The easiest way to install the plugin of type local is to use the in-build plugin installation interface. This could be found, if logged in as an admin, at "Site administration -> Plugins -> Install plugins". After the ZIP-package is added, the Plugin type could be specified as "local" and the installation process could be started.
  • Furthermore the plugin could be installed manually: First the archive needs to be unzipped. Afterwards copy the folder "sync_service" into the directory "\server\moodle\local". Finally restart Moodle, log-in as an admin and follow the displayed installation process.

If the installation was successful, the external service "Course Sync Extension Service" should be exisiting "Site administration -> Server -> External services". In addition, when creating or editing an external service, the newly added functions should be choosable.

Configurations at the Moodle platform

To use the newly added functions and external service, serveral options are needed to be set:

  • Web services must be enabled "Site administation -> Server -> Overview -> Enable web services".
  • REST-Protocol must be enabled "Site administation -> Server -> Overview -> Enable protocols".

Furthermore to use the newly added external service "Course Sync Extension Service", it needs to be enabled and file uploads are needed to be allowed "Site administration -> Server -> External Services -> Course Sync Extension Service -> Edit". Please Note: The external service will be available for every user.

Needed permissions

For general information about the use of the Moodle Web Service API please visit the official Moodle documentation.

Each authorised user (as defined above) needs the following permissions. Please note the specific context the permissions are needed.

  • (Token generation: if users should be able to create their tokens, which are used to authenticate when using the Web Service API functions, the global permission "moodle/webservice:createtoken" is required.)
  • The permission "webservice/rest:use" is needed as a global permission.
  • The permissions listed at "Site administration -> Server -> External Services -> Course Sync Extension Service -> Functions" are needed in the courses which should be accessed remotely.
Clone this wiki locally