Moodle Plugins directory: Course End Date Restriction | Moodle.org
Course End Date Restriction
Description
This local plugin automates the process of restricting access to course modules based on the course end date. It listens to course update events and automatically applies a "prevent access after course end date" availability restriction to all modules that are tracked for course completion.
Instead of manually editing the deadline for every single activity when a course schedule changes, administrators and teachers can simply update the course end date. The plugin will instantly sync the deadline across all relevant activities.
Key Features
- Automatic Synchronization: Instantly updates module availability restrictions when the course end date is modified.
- Safe Merging (Non-destructive): The plugin intelligently parses the existing availability JSON. It safely adds or updates the date restriction without overwriting or destroying existing conditions (e.g., group restrictions, grade requirements, or user profiles).
- Targeted Action: Only applies restrictions to activities that have course completion criteria enabled, leaving optional resources untouched.
- Cleanup: If the completion tracking is removed from a module, the plugin automatically removes the injected date restriction while keeping any other conditions intact.
Installation
- Download the plugin and extract the
.zipfile. - Rename the extracted folder to
enddateaccess(if it isn't already). - Upload or move the
enddateaccessfolder into thelocal/directory of your Moodle installation. - Log in as an administrator and go to Site administration > Notifications (or run the upgrade script via CLI) to complete the installation process.
Usage
The plugin works silently in the background. To trigger it:
- Ensure your course has an End date set in the course settings.
- Add an activity (like a Quiz or Assignment) and configure its Activity completion settings to require a specific condition (e.g., "Student must view this activity to complete it" or "Student must receive a grade").
- Save the activity. The plugin will automatically append the date restriction based on the course end date.
Requirements
- Moodle 3.5 or later (Requires version
2018051700).
License
This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
I would like to know how a quiz activity would behave in the following scenario:
Activity: Quiz
Course end date: June 30, 2026
Access restriction start date: June 20, 2026
The plugin is enabled.
Will the student have access to the quiz until June 20 or until June 30?
Ricardo
If that June 20th restriction is configured as a start date ("From"), the student will have access to the quiz from June 20th to June 30th.
The plugin respects the start date you manually set and automatically adds the closing limit to match the course end date exactly (June 30th).
Best regards, and thank you for using the plugin!