This project is not covered by Drupal’s security advisory policy.
This module provides a focus mode for activities in courses built with the Drupal LMS module. When a student enters focus mode, the site's header, menus, sidebars and footer are hidden and the activity fills the browser window. Exiting focus mode restores the page to its original layout.
Features
- You can set two modes for students when they view an activity: In Optional mode the activity displays as usual, with a button in a corner of the page to enter and exit focus mode. In Required mode the activity is shown behind a start screen with a Start activity button, which opens it in focus mode.
- The mode can be set site-wide, per activity type, per course, per lesson or per activity. The most specific setting gets applied.
- Themes can keep or hide elements with a class, change colors and spacing with CSS custom properties, and replace the button and start screen components.
Post-Installation
Focus mode is disabled by default on all activities after installation. Site-wide settings are at Administration > LMS > LMS Settings > Focus mode (/admin/lms/settings/focus-mode) and require the "administer lms" permission. The settings include:
- the site-wide default mode
- whether courses, lessons and activities show a focus mode setting on their edit forms
- the position of the focus mode button
- the message shown on the start screen
- page elements that stay visible in focus mode
Each activity type's edit form has a default for that activity type. Courses, lessons and activities can be set individually from their edit forms.
Notes:
- Focus mode supports one activity per page.
- Hiding the page requires browser support for the CSS :has() selector.
- Focus mode hides most of the page. Sites with their own accessibility features should test them with focus mode on.
Additional Requirements
- Drupal 10.3 or 11
- Drupal LMS 1.2 and Group
- The core Options module
Recommended modules/libraries
- LMS xAPI and LMS H5P provide the activities focus mode was designed to be used with.
Parts of this module have been written using AI coding assistants.
Project information
- Project categories: Content display
- Ecosystem: Drupal LMS
- Created by mindewen on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

