Book Image

Moodle 3 Administration - Third Edition

By : Alex Büchner
Book Image

Moodle 3 Administration - Third Edition

By: Alex Büchner

Overview of this book

Moodle is the de facto standard for open source learning platforms. However, setting up and managing a learning environment can be a complex task since it covers a wide range of technical, organizational, and pedagogical topics. This ranges from basic user and course management, to configuring plugins and design elements, all the way to system settings, performance optimization, events frameworks, and so on. This book concentrates on basic tasks such as how to set up and configure Moodle and how to perform day-to-day administration activities, and progresses on to more advanced topics that show you how to customize and extend Moodle, manage courses, cohorts, and users, and how to work with roles and capabilities. You’ll learn to configure Moodle plugins and ensure your VLE conforms to pedagogical and technical requirements in your organization. You’ll then learn how to integrate the VLE via web services and network it with other sites, including Mahara, and extend your system via plugins and LTI. By the end of this book, you will be able to set up an efficient, fully fledged, and secure Moodle system.
Table of Contents (24 chapters)
Moodle 3 Administration Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuration reference: an overview


The configuration file config.php contains a number of settings and variables that heavily influence how Moodle operates. It is located in the main directory of your Moodle system ($CFG->dirroot) and can be edited with any text editor.

Tip

Be careful when modifying config.php! Moodle depends heavily on its content and any faults can cause the software to malfunction.

It is recommended you create a backup of the config file before modifying it, so you can roll back to it in case of problems. Also, make sure the file permissions are set properly as the file contains the database username and password. In a Linux environment, the owner should be root, the group also root, and the permissions set to 644.

The config.php values we are interested in are the ones that start with a dollar symbol. Each parameter has the following information format:

$<object>-><parameter> = <value>;

The <object> parameter is the part of Moodle in which the parameter is used ($CFG or $THEME). Third-party modules or custom distributions might have introduced their own objects—for example, $TOTARA. We will focus on $CFG objects as these are most relevant to administrators.

The <parameter> is the name of the configuration setting. Each setting has a unique identifier.

The <value> parameter is the type of value the parameter accepts. This depends on the type of the setting. The following table provides information for each of the key types:

Type

Moodle Field

Values

Binary

Checkbox

True or 1 and False or 0.

Numeric

Number

The number itself.

String

Text

Text has to be surrounded by single quotes.

Password

Password

Passwords have to be surrounded by single quotes.

List

Pull-down menu

Each value is represented by a number or a string. Unfortunately, there is no consistency for the allocation. For example, while the debug parameter accepts the values 0, 5, 15, 6143, and 38911, the sitemailcharset parameter accepts 0, EUC-JP, and GB18030! The easiest way to find out what values are valid is to change the values in Moodle and check the config change report (see later). Alternatively, you can check the mdl_config table in the database.

Array

Multi-select menu

The comments in the List type apply to this type, too. Values are separated by commas. Again, check the config change report to be on the safe side.

Each parameter has to be terminated by a semi-colon. To comment out a parameter, precede it with two forward slashes.

Before we deal with the different types of setting, we'll discuss a number of tools that might come in useful. As there is no list of available settings, you have to generate your own. To do so, execute the following shell command in your $CFG->dirroot:

grep -r -h -o '\$CFG->[a-z][[:alnum:]_]*' . | sort -u

This will generate a list of all available $CFG variables in alphabetical order. The command moosh config-get (see Chapter 14, Moodle Admin Tools) only provides you with a list of all config variables that can be set via Moodle's admin interface and are stored in mdl_config; it excludes the hidden variables we are interested in here.

Moodle provides a report that lets you monitor all changes to any config settings via the administration interface. You can find the report at Reports | Config changes:

If you are experimenting with configuration variables, you might consider installing the Admin setting presets block, which lets users with the site configuration capability export the site settings to .xml presets, import other sites .xml presets, load (totally or partially) presets settings and rollback the applied changes if necessary.

While its key objective is to package, distribute, and deploy the same settings (presets) to multiple Moodle sites, it can also be used to back up and restore the configuration settings of your Moodle site. You find more information about the tool at https://docs.moodle.org/en/Admin_presets_block. You can download the latest version of the plugin from https://moodle.org/plugins/view.php?plugin=block_admin_presets. Once the block has been installed (see Chapter 8, Moodle Plugins), you can select which settings to package up in a preset: