Accessibility plugin

From MoodleDocs

Accessibility is a local plugin that adds an accessibility panel to every Moodle page. Each user can change how Moodle looks and reads for them: text size, spacing, fonts, colours, line width, motion and more. The settings follow the user around the whole site, and visitors who are not logged in can use them too.

Installation

Install the plugin from the Moodle plugins directory, or download the ZIP file and follow Installing plugins. The files go in the folder local/accessibility. The plugin supports Moodle 4.5 to 5.3.

All features are built into the plugin. Versions before 3.0 used separate widget plugins; when you upgrade from 2.x, users' settings are carried over and the old widgets are removed (see Upgrading from version 2).

Using the panel

The panel, with one tile per setting and the profiles at the top.

Users open the panel in any of three ways (the administrator chooses which are available):

  • the floating button at the bottom right of the page,
  • Accessibility settings in the user menu,
  • the keyboard shortcut Alt+A.

The panel has one tile per setting. Each tile shows its current setting in words under its name, for example OpenDyslexic Alta under Font. Every option is shown and can be chosen directly, each with an icon or a preview. Short lists open under the tile; longer ones (text size, font, spacing, line width and colours) open their own view, with All settings to go back. The arrow keys move between options, and Enter or Space chooses one.

Changes show at once and are saved automatically. Reset All returns every setting to the site default.

Text size, spacing and line width

Text size, Line height, Letter spacing, Word spacing and Line width have no fixed list of values. Each has Smaller/Larger (or Less/More) buttons, which keep stepping while you hold them, a box where you can type a number and press Enter, and a Site default button. Text size also has Quick picks (100%, 125%, 150%, 200%, 250% and 300%).

When the text size changes, the whole page scales in proportion, including text that was given a fixed size in the editor. The ranges include the values of WCAG 1.4.12 (text spacing): line height 1.5, letter spacing 0.12 and word spacing 0.16.

Word spacing changes the spaces between words, so it has no effect on text written without spaces, such as Japanese. Line width is counted in characters the width of the digit "0"; a Japanese character takes about two of them.

Fonts

The Font view. Each font is shown in its own typeface.

The Font view offers:

  • Site default,
  • the device's own fonts: Sans-serif (device), Serif (device) and Monospace (device),
  • fonts included with the plugin: Atkinson Hyperlegible, Lexend, OpenDyslexic Alta and Comic Neue,
  • Japanese fonts from the device: Japanese UD Gothic, Japanese UD Mincho and Japanese textbook,
  • any fonts the administrator uploaded.

Each option is shown in its own font. The device fonts download nothing: a device that has none of the fonts in a list shows its own default font of that kind.

Profiles

A page with the Dyslexia profile.

Profiles are one-click bundles of settings, shown at the top of the panel: Dyslexia, Low vision, Focus and Seizure-safe. Choosing one replaces the current settings, after a confirmation. Administrators can replace the profiles with their own.

All settings

Setting Choices
Text size Any percentage up to 1000% (default 100%)
Font See Fonts
Spacing Line height, Letter spacing and Word spacing, each set separately
Alignment Site default, Left, Centre, Right, Justified
Colours Site default, High contrast, Yellow on black, Black on white, Cream, Dark, the site's own colour schemes, and Custom
Line width Full width, or a number of characters per line
Links Off, Underlined, Underline and outline, Highlighted
Images Shown, Dimmed, Hidden, alt text shown
Guide Off, Reading ruler, Reading mask
Motion On, Stopped
Read Off, Read aloud bar shown
Saturation Normal, Low, Greyscale, High
Focus ring Standard, Strong, Extra thick
Cursor Standard, Large, Extra large

Colours

A page with Yellow on black.

The colour schemes recolour the page while keeping lighter and darker areas distinct. With Custom colours, users choose their own background, text and link colours. Moodle adjusts them to reach a contrast ratio of 7:1 and shows the result; users who want their exact colours can tick Use my exact colours.

When a user first opens the panel, some settings can start from the device's own preferences for reduced motion and higher contrast.

Read aloud

Read shows a read-aloud bar with Read, Stop, Restart and Speed. It reads the page sentence by sentence with the browser's own voices. In a browser that has no voices, the tile is hidden.

Guests

Visitors who are not logged in keep their settings in a cookie in their own browser. Nothing is stored on the server for them.

Settings

The first site settings.

In Site administration > Plugins > Local plugins > Accessibility > Settings:

  • How users open the panel: Floating button and user menu, Floating button only or User menu only.
  • Keyboard shortcut Alt+A: open and close the panel with Alt+A.
  • Fonts users may choose: which of the device and included fonts the Font view offers. The site font is always offered.
  • Uploaded fonts: up to 20 font files (.woff2, .woff, .ttf or .otf) offered as extra fonts. The file name sets the font family and face: the part before the first hyphen or underscore is the family name, a name containing "Bold" makes a bold face, and one containing "Italic" or "Oblique" an italic face. For example, Family-Regular.woff2 and Family-Bold.woff2 make one font, Family, with two faces. Check that each font's licence allows it to be used on the web.
  • Site defaults: a starting value for each setting, for everyone. Each tile also has a lock (Lock followed by the tile name): a locked setting always uses the site default, and users cannot change it. Line height, letter spacing and word spacing share one lock.
  • Limits of number settings: Unlimited, including negative spacing (the default) lets users choose negative letter and word spacing and a line height under 1.0. Non-negative: no negative spacing, no line height under 1.0 keeps spacing at zero or more, line height at 1.0 or more, and text size and line width at 10 or more. Changing this does not rewrite saved settings: a saved value outside the limits is ignored and the site default is used instead.
  • Site colour schemes: extra colour schemes offered to users. Each one must reach a contrast ratio of 7:1 for text and links.
  • Profiles: your own profiles, to replace the ones that come with the plugin.
Manage features: turn features on or off and change their order.

In Site administration > Plugins > Local plugins > Accessibility > Manage features you can turn each feature on or off and change the order of the tiles in the panel.

Known limitations

  • Line height, letter spacing and word spacing are not applied to headings yet.
  • Content inside iframes, including H5P, is not changed.
  • Images dims or hides background images only when the page itself sets them (as the Tiles course format and the Dashboard course cards do).
  • The Moodle app does not load the plugin.
  • The contrast guarantee covers only what the plugin recolours, not images or embedded media.

Upgrading from version 2

Users' settings are carried over. Text size, line height and letter spacing keep their values. Paragraph widths of 25, 50 and 75 become line widths of 50, 60 and 70 characters, highlighted links become Underline and outline, and hidden images become Hidden, alt text shown.

The upgrade removes an old accessibility_* widget plugin when its folder is already gone. If the old widget folders are still in local/accessibility/widgets/ after the upgrade, delete each widget's folder (keep widgets/README.md) and then uninstall the leftover widgets in Site administration > Plugins > Plugins overview.

Capabilities

The plugin adds no capabilities. Every user, including guests, can use the panel. Its site settings need the usual site administration permissions.

Privacy

For logged-in users the plugin stores user preferences: the value of each accessibility setting they chose, their custom colour scheme, and whether they have saved any setting yet. Visitors who are not logged in keep their settings in a cookie in their own browser, and nothing is stored on the server for them.

The plugin implements the Privacy API: the preferences are included in data exports, and Moodle deletes them with the user's other preferences. See Data privacy.

Credits

Adam Jenkins maintains the plugin and wrote the 3.0 rebuild. Ponlawat Weerapanpisit wrote the original plugin and its widget framework. Bartlomiej Jencz moved the plugin to Moodle's hooks API in 2024.

The included fonts Atkinson Hyperlegible, Lexend and Comic Neue are under the SIL Open Font License 1.1. OpenDyslexic Alta is OpenDyslexic 2 by Abelardo Gonzalez.

See also