In Moodle environments that rely on the Attendance plugin for grading, administrators occasionally encounter a frustrating problem: attendance is marked correctly for learners, but grades do not update in the gradebook. This often surfaces around the function mod_attendance_update_user_status, which is responsible for recalculating and syncing attendance grades.
While the issue may appear minor at first, it can have serious consequences. Learners may see incorrect final grades, instructors lose trust in reporting accuracy, and administrators end up performing time-consuming manual grade adjustments. In regulated or corporate training environments, inaccurate grade data can also create compliance and audit risks. Understanding why this happens and how to approach fixing it is essential for maintaining a reliable Moodle platform.
I recently migrated my site to Mindfield from another host, and the experience couldn’t have been better. Mindfield kept working until they were certain that my site was operating as well as it was before, and they even helped clean up a few issues to improve my site’s performance – issues my prior host never mentioned. I also found Mindfield’s communication to be excellent. Before the migration, they prepared me for what to expect, and during the migration they kept me well-informed. No small feat considering that changing hosts is inherently stressful! They also provided clear and concise explanations when required. I’d highly recommend Mindfield if you’re looking for an IT consultant, developer, or host.
Jim Benedek
Owner, Student First Media Inc.
review Source: Google Reviews
Outline
Why This Issue Matters

In Moodle environments that rely on the Attendance plugin for grading, administrators occasionally encounter a frustrating problem: attendance is marked correctly for learners, but grades do not update in the gradebook. This often surfaces around the function mod_attendance_update_user_status, which is responsible for recalculating and syncing attendance grades.
While the issue may appear minor at first, it can have serious consequences. Learners may see incorrect final grades, instructors lose trust in reporting accuracy, and administrators end up performing time-consuming manual grade adjustments. In regulated or corporate training environments, inaccurate grade data can also create compliance and audit risks.
Understanding why this happens and how to approach fixing it is essential for maintaining a reliable Moodle platform.
What Is mod_attendance_update_user_status and Where Things Go Wrong
The Attendance plugin calculates grades based on session status updates, such as Present, Late, or Absent. The function mod_attendance_update_user_status is triggered when a user’s attendance status changes and is expected to:
-
Recalculate the attendance grade
-
Update the gradebook item
-
Reflect the change immediately in course grades
When grades do not update, it usually means the status update occurred, but the grade sync failed or was skipped. This gap between attendance data and the gradebook is where most troubleshooting begins.
Common Causes of Attendance Grades Not Updating

Gradebook Configuration Issues
One of the most frequent causes is misalignment between Attendance settings and the gradebook. This includes:
-
Attendance activity set to “No grade” or incorrectly weighted
-
Grade aggregation methods that ignore attendance
-
Hidden grade items or overridden grades in the gradebook
Even when attendance data is correct, these settings can prevent recalculated grades from being displayed.
Attendance Plugin Settings or Version Mismatch
Attendance plugin behavior can vary by version. Issues may arise if:
-
The plugin version is outdated relative to the Moodle core version
-
A recent Moodle upgrade introduced compatibility changes
-
Custom patches modified attendance behavior without updating related callbacks
In these cases, mod_attendance_update_user_status may execute without triggering a grade update.
Caching and Delayed Recalculation
Moodle relies heavily on caching for performance. Sometimes:
-
Grades update in the database but not in the UI
-
Recalculation is deferred until a cron run
-
Cached grade data masks recent changes
This can make the issue appear intermittent or user-specific.
Custom Code or Third-Party Integrations
In more complex deployments, custom logic may interfere with grade updates. Common scenarios include:
-
Custom enrollment or completion logic
-
External reporting integrations
-
Plugins that override grade update events
Any of these can interrupt the expected flow after mod_attendance_update_user_status runs.
Different Approaches to Fixing the Issue

Quick Configuration Checks
Before diving into code or logs, start with the basics:
-
Confirm the Attendance activity is graded
-
Verify grade aggregation and category settings
-
Check for manually overridden grades
-
Force a gradebook recalculation
These steps resolve a surprising number of cases with minimal effort.
Plugin and Core Validation
If configuration looks correct, the next step is to validate the technical setup:
-
Confirm Attendance plugin version compatibility
-
Review recent Moodle upgrades or patches
-
Test grade updates in a clean or test course
This helps isolate whether the issue is systemic or course-specific.
Database and Cron Verification
For deeper troubleshooting:
-
Verify attendance grades are written to the database
-
Confirm cron jobs are running and not failing
-
Look for delayed or queued grade recalculations
In some cases, grades exist but are never surfaced to users due to background task failures.
Code-Level Investigation
When all else fails, a code-level review may be necessary. This includes:
-
Confirming that
mod_attendance_update_user_statusis being triggered -
Checking whether grade update functions are called afterward
-
Reviewing event observers or overridden callbacks
This approach is usually required in highly customized Moodle environments.
Best Practices to Prevent Attendance Grade Issues

High-maturity Moodle platforms typically:
-
Standardize attendance grading across courses
-
Document gradebook configuration rules
-
Test plugins after every core upgrade
-
Avoid unnecessary custom overrides in grading logic
Preventive governance reduces the risk of silent grade failures later.
When Attendance Grades Fail, Experience Matters

Attendance grade problems tied to mod_attendance_update_user_status are rarely caused by a single misconfiguration. In many cases, the attendance status is recorded correctly, but the grade update fails somewhere between the activity, the gradebook, and Moodle’s background processing. This makes the issue difficult to diagnose using the user interface alone.
Hiring Moodle experts helps move troubleshooting beyond guesswork. Experienced specialists understand how attendance plugins interact with grade aggregation, overrides, caching, cron execution, and custom logic. Instead of applying surface-level fixes, they can trace the full grade update path and identify where recalculation or synchronization breaks down.
Expert review also reduces long-term risk. Attendance-based grading often plays a role in compliance, reporting, or completion tracking. Incorrect or delayed grades can undermine learner trust and create operational overhead through manual corrections. A structured analysis ensures grade updates remain reliable across upgrades, plugin changes, and evolving course designs.
Most importantly, Moodle experts help prevent the same issue from resurfacing. By documenting gradebook standards, validating plugin compatibility, and tightening governance around customizations, they turn a one-off fix into a stable, repeatable grading workflow. This is especially valuable in scaled or multi-tenant Moodle environments where small inconsistencies can quickly become systemic problems.

