Moodle Plugins directory: Extra Credit Checkbox: Versions: 1.11 | Moodle.org
Extra Credit Checkbox
Extra Credit Checkbox 1.11
Extra Credit Plugin for Moodle
Add an "Extra Credit" checkbox to all gradable activities in Moodle, allowing teachers to mark assignments, quizzes, and other activities as extra credit.
Description
This local plugin enhances Moodle's gradebook functionality by adding an "Extra Credit" checkbox to all gradable activities. When enabled, the activity's points are marked as extra credit in the gradebook, allowing students to earn points above the maximum course total.
The plugin works seamlessly with all Moodle gradebook aggregation methods: - Natural - Simple weighted mean of grades - Mean of grades (with extra credits) - Sum of grades
Features
- ✅ Adds "Extra Credit" checkbox to all gradable activities (Assignments, Quizzes, Lessons, etc.)
- ✅ Automatically hides/disables the checkbox for inappropriate grade types
- ✅ Works with all Moodle gradebook aggregation methods
- ✅ Preserves existing extra credit settings when editing activities
- ✅ Safe handling of mixed activities (points + outcomes)
- ✅ Privacy API compliant
- ✅ No database tables required
- ✅ Cross-database compatible (MySQL, MariaDB, PostgreSQL)
Requirements
- Moodle 4.3 or later
- PHP 8.0 or later
- MySQL 8.0+, MariaDB 10.6+, or PostgreSQL 13+
Installation
Method 1: Install from Moodle plugins Directory (Recommended)
- Log in to your Moodle site as an administrator
- Navigate to Site administration > Plugins > Install plugins
- Search for "Extra Credit"
- Click Install and follow the prompts
Method 2: Manual Installation via ZIP
- Download the latest release ZIP file from the Moodle Plugins Directory or GitHub Releases
- Log in to your Moodle site as an administrator
- Navigate to Site administration > Plugins > Install plugins
- Upload the ZIP file
- Click Install plugin from the ZIP file
- Follow the on-screen prompts to complete installation
Method 3: Manual Installation via File System
- Download the latest release or clone this repository
- Copy the
extracreditfolder to/path/to/moodle/local/ - The directory structure should be:
/local/extracredit/ - Log in to your Moodle site as an administrator
- Navigate to Site administration > Notifications
- Follow the prompts to complete the installation
Usage
For Teachers
- Create or edit any gradable activity (Assignment, Quiz, Lesson, etc.)
- Scroll to the Grade section
- You will see an Extra credit checkbox
- Check the box to mark this activity as extra credit
- Save the activity
- The activity will now be calculated as extra credit in the gradebook
When Extra Credit is Available
The Extra Credit checkbox appears and is enabled for: - ✅ Activities with point-based grades (Type: Point) - ✅ Activities with a maximum grade greater than 0
When Extra Credit is Disabled/Hidden
The Extra Credit checkbox is automatically disabled or hidden for: - ❌ Activities with no grade (Type: None) - ❌ Activities using scales instead of points - ❌ Activities using outcomes only (no point grade)
Mixed Activities (Points + Outcomes)
If an activity has both a point grade AND outcomes: - ✅ The Extra Credit checkbox is available - ✅ Extra credit applies only to the point grade - ✅ Outcomes are graded normally (not affected by extra credit)
How It Works
The plugin modifies the aggregationcoef and aggregationcoef2 fields in the Moodle grade_items table:
- Sets both fields to 1 when extra credit is enabled
- Sets both fields to 0 when extra credit is disabled
This ensures compatibility with all Moodle gradebook aggregation methods, as different methods use different coefficient fields.
Compatibility
Grade Types
| Grade Type | Extra Credit Support |
|---|---|
| Point (numeric) | ✅ Yes |
| Scale | ❌ No (disabled) |
| None | ❌ No (hidden) |
| Outcomes only | ❌ No (hidden) |
| Points + Outcomes | ✅ Yes (points only) |
Aggregation Methods
| Aggregation Method | Extra Credit Support |
|---|---|
| Natural | ✅ Yes |
| Simple weighted mean of grades | ✅ Yes |
| Mean of grades (with extra credits) | ✅ Yes |
| Sum of grades | ✅ Yes |
| Mean of grades | ✅ Yes |
| Weighted mean of grades | ✅ Yes |
| Median of grades | ✅ Yes |
| Lowest grade | ✅ Yes |
| Highest grade | ✅ Yes |
Tested On
- Moodle 4.3 LTS
- Moodle 4.4
- Moodle 4.5
- Ubuntu 22.04 LTS
- MySQL 8.0
- MariaDB 10.6
- PostgreSQL 13+
Troubleshooting
Extra Credit checkbox doesn't appear
Solution: Verify the activity supports point-based grading. The checkbox will not appear for activities set to "No grade" or using scales.
Error when grading outcome-only activities
Solution: This was fixed in version 1.0. If upgrading from an earlier version, run this SQL query (replace mdl_ with your table prefix):
UPDATE mdl_grade_items
SET aggregationcoef = 0, aggregationcoef2 = 0
WHERE itemtype = 'mod'
AND itemnumber = 0
AND gradetype = 0
AND (aggregationcoef > 0 OR aggregationcoef2 > 0);
Then purge all caches: Site administration > Development > Purge all caches
Extra credit not calculating correctly
Solution: Check your course gradebook aggregation method. Extra credit works with all methods but calculates differently depending on the method chosen.
Checkbox appears but is disabled/grayed out
Solution: This is expected behavior when: - Grade type is set to "None" - Grade is set to 0 points - Activity is using a scale instead of points
Uninstallation
- Navigate to Site administration > Plugins > Plugins overview
- Find "Extra Credit" in the list
- Click Uninstall
- Follow the prompts
Note: Uninstalling will remove the Extra Credit checkbox from activities, but existing extra credit flags in the gradebook will remain. To remove all extra credit flags, run this SQL query before uninstalling:
UPDATE mdl_grade_items
SET aggregationcoef = 0, aggregationcoef2 = 0
WHERE itemtype = 'mod'
AND (aggregationcoef > 0 OR aggregationcoef2 > 0);
Privacy
This plugin does not store any personal data. It only modifies grade item settings to mark activities as extra credit. The plugin is fully compliant with Moodle's Privacy API and GDPR requirements.
Contributing
Contributions are welcome! Please:
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code: - Follows Moodle coding style - Includes appropriate PHPDoc comments - Has been tested with developer debugging enabled - Works with both MySQL/MariaDB and PostgreSQL
Support
- Bug Reports: GitHub Issues
- Documentation: This README and inline code comments
- Moodle Forums: Plugins Forum
License
This program 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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Author
Brian A. Pool
National Trail Local Schools
Changelog
Version 1.0 (2024-11-05)
- Initial stable release
- Support for all Moodle gradebook aggregation methods
- Automatic handling of outcome-only activities
- Safe handling of mixed point + outcome activities
- Ability to enable and disable extra credit on activities
- Compatibility with scales and no-grade activities
- Privacy API implementation
- Cross-database compatibility (MySQL, MariaDB, PostgreSQL)
Acknowledgments
Special thanks to the Moodle community for their support and feedback during development.
If you find this plugin useful, please consider starring the repository! ⭐
Version information
- Version build number
- 2024110501
- Version release name
- 1.11
- Maturity
- Beta
- MD5 Sum
- 24cba832177e51aec40f9931dee1fdcf
- Supported software
- Moodle 4.3, Moodle 4.4, Moodle 4.5, Moodle 5.0, Moodle 5.1
- Latest release for Moodle 4.3
- Latest release for Moodle 4.4
- Latest release for Moodle 4.5
- Latest release for Moodle 5.0
- Latest release for Moodle 5.1
Version control information
- Version control system (VCS)
- Other...
- VCS repository URL
Default installation instructions for plugins of the type Local plugins
- Make sure you have all the required versions.
- Download and unpack the module.
- Place the folder in the "local" subdirectory.
- Visit http://yoursite.com/admin to finish the installation.