Motivation

I want to create a new administrative interface for importing and exporting site-wide configuration (tracker issue MDL-18548). At the basic level, it would allow administrators to save their site settings in an XML file, as well as import other saved configurations. Administrators will be able to select a subset of all settings to create a preset. They can then apply presets to their site settings, either individually or with specified priorities. Moodle will then adjust change setting to the value in the highest-priority preset, and then use either the current or default settings for whatever remains.

Other Discussion

Related Documentation

User Requested Features

This is a current list of features that have been suggested/requested. This is not the finalized list and will need a community review:

Selection of settings to export (grouped in a tree format as displayed in the administrator panel)

Naming and saving of XML files as special "presets" to be applied to a new install of Moodle for specific situations.

An interface listing the presets (XML exported files with the "preset" attribute set)

A way to record the registered presets (beyond detecting the filesystem)

A view of the settings available for restore in a given XML file

Partial export/import

Compatibility with installation

Logging the settings (to allow rollbacks)

Comments for settings changes

The ability to "switch" a preset on/off. While on, it overrides the original settings without replacing them. When off, the original settings are restored

In addition to the previous point: ability to switch several presets on/off, and to organise them by priority. If a setting is defined in two presets, the one in the preset with the highest priority overrides the other one.

Progressive disclosure (making sure that only those who want to mess with the presets will find them, and that they will not be changed accidentally) [1]

Glossary

Term

Definition

Preview

The ability to see the contents of a preset before applying it (either all the settings, or the settings that will be changed)

Settings tree

A tree containing all Moodle settings in the same organization as the site administration page

Preset

An XML file containing either full or partial Moodle settings.

Template

The old name for presets; this may be found in other pages talking about this project.

UI Mockups

Settings preset Creation

All settings are available in the tree, organized in a similar fashion as the admin navbar. Checking a setting includes it in your preset. The checkbox at the bottom allows you to automatically exclude sensitive settings (like passwords). Saving a preset creates the XML file, and adds the file to the list of available presets.

Applying Settings presets

The debug window at the top only appears when presets have been applied. It shows which setting was taken from which preset, as well as any possible errors. Beneath it is a list of available presets (with an option to import from file). There is a checkbox that determines whether to use the default or current value for unspecified settings, but we will probably end up with more user-controlled parameters for importing. You can preview a preset, bringing up the screen below. The "Use Multiple" button is an advanced feature, allowing you to choose multiple presets and sort them by priority. You can also create a new preset from multiple separate presets.

Settings preset Preview

It allows users to collapse and expand the sub categories, view the values that are specified, as well as seeing setting descriptions. I hope to include an editor that looks similar to this, except with the ability to change the specified value (this would edit the XML file, not the site settings).

Use Cases

UC006-1 Creating a new preset

User selects which settings to include in the preset. This is done via an expandable tree that mirrors the existing admin tree. Checking a box next to setting saves the setting in a preset, and checking a category checks all the settings within it.

User chooses a name for the preset and clicks "save."

Pre:

User has admin permissions.

Post:

XML presets file is created with selected settings.

File is added to the list of available presets.

UC006-2 Applying existing preset(s)

User clicks "apply presets" in admin preset block,

User is presented with list of available presets, and selects the ones they want to apply

User adjusts the priority of each selected preset by ordering them

User clicks "apply presets"

Pre:

User-created preset exists

User has admin permissions

Post:

Moodle goes through the presets in order and applies them.

Each setting says which preset affected it.

User sees a summary of what settings were affected

UC006-3 Rolling back settings

User clicks "roll back settings" in admin preset block

User sees last x days of logged settings changes in list form (x is a user-specified setting)

User selects the item in the list that they want to revert to.

User clicks "apply"

Pre:

Site has settings backup enabled

User has admin permissions

Post:

Moodle goes backwards through the log and undoes all the changes through the revert point.

All log entries after the revert point are deleted.

UC006-4 Previewing a preset

User clicks "Manage/edit presets"

User sees a list of presets, can click "View XML" to preview a preset in its raw form.

Clicking "Preview" will take user to an admin settings page showing all the settings included in a preset. This page would look mostly like current settings pages (except maybe with a "Preview" banner overlaid)

Pre:

User-created preset exists

User has admin permissions

TODO

Coding

Each feature will be given its own issue in the tracker.
Tentative tracker issue list.