Configure Moodle Conditional Activities to Control Visibility Based on Completion Criteria
Learn how to hide or show Moodle activities using Conditional activities based on completion status or grade thresholds. This step‑by‑step guide covers prerequisites, configuration, verification, and recovery options.
14 Nov 2025, 19:20 UTC

Problem Statement
In many courses you want to pace learners by hiding a quiz, assignment or resource until they finish a prerequisite activity or reach a minimum grade. Moodle’s Conditional activities plugin lets you enforce these rules without manual intervention. This guide walks you through the exact steps, checks, and recovery options for a typical scenario.
Desired Outcome
Hide the Final Quiz activity until the student completes the Reading Material activity and scores at least 70 % on the Pre‑test.
Prerequisites
| Item | Requirement |
|---|---|
| Moodle Site | Version 4.0 or newer (Conditional activities shipped in core) |
| Roles | Editing teacher or higher to modify course settings |
| Completion Tracking | Enabled at course level for all relevant activities |
| Prerequisite Activities | Reading Material and Pre‑test must have completion criteria set |
| Conditional Activities Plugin | Installed and enabled (core in 4.0+) |
Step‑by‑Step Procedure
- Verify Completion Tracking
- Navigate to Course administration > Settings > Availability.
- Ensure
Activity completionis set toEnabledfor the course. - For each prerequisite activity, edit its settings and set
Completion criteria(e.g.,Mark as complete when the user has viewed the activityorMark as complete when the user has achieved a grade of 70 %).
- Set Up the Conditional Activity
- In the course page, click
Edit settingsfor theFinal Quiz. - Scroll to the
Restrict accesssection and clickAdd restriction. - Select
Activity completionfrom the list. - Configure the condition:
- Prerequisite activity:
Reading Material - Completion status:
Completed - Grade threshold (optional):
70 %– checkRequire a grade of at least 70 %. - Condition type:
All of the following(if multiple prerequisites)
- Prerequisite activity:
- Optionally, set
Hide activitytoYesso it remains invisible until the condition is met. - Click
Save and return to course.
- In the course page, click
- Preview the Result
- Log in as a student (or use
Preview as a user). - Verify that the
Final Quizis either greyed out or hidden. - Complete the
Reading MaterialandPre‑testto meet the criteria. - Refresh the course page and confirm the
Final Quizbecomes available.
- Log in as a student (or use
Expected Checks
- In the student view, the target activity should display
Lockedor be invisible until prerequisites are satisfied. - In the teacher view, the
Restrict accessblock should list the condition you added. - After meeting the prerequisites, the activity icon should change from
LockedtoAvailable(a green check or unlocked icon). - Use the
Activity completion reportsto confirm the status flags update correctly.
Recovery & Troubleshooting
- Condition Not Working
- Check that completion tracking is indeed enabled on the course and on each prerequisite activity.
- Verify that the student’s role has the
View activity completioncapability; otherwise the system cannot evaluate the condition. - Confirm that the grade threshold is calculated against the correct grading method (e.g., highest grade, weighted average).
- Activity Becomes Unavailable After Completion
- Re‑edit the
Restrict accessblock and ensure the condition is set toCompleted(notNot completed). - Remove any conflicting restrictions that may override the desired behavior.
- Re‑edit the
- Rollback Plan
- If the conditional logic unintentionally blocks all students, edit the activity and remove the
Restrict accessrestriction. - Alternatively, restore a recent course backup taken before the changes.
- Note: Deleting completion records can affect the condition; avoid purging data unless necessary.
- If the conditional logic unintentionally blocks all students, edit the activity and remove the
Limitations & Performance Considerations
- Conditional activities rely on completion data; if your course has thousands of activities, the database can grow quickly. Monitor
mdl_logstore_standard_logandmdl_completion_criteriatables. - Grade‑based conditions use the current grade calculation algorithm; any changes to grading scales will affect the condition dynamically.
- Conditional activities are evaluated on page load; heavy conditions may increase page rendering time.
- Users with the
View all activitiescapability (e.g., administrators) can bypass restrictions; ensure role permissions align with your security model.
Practical Verification Checklist
- [ ] Confirm completion tracking is enabled.
- [ ] Verify each prerequisite activity has a valid completion criterion.
- [ ] Ensure the target activity’s
Restrict accessblock lists the intended condition. - [ ] Test with a student account: activity is hidden until prerequisites are met.
- [ ] Review the activity completion report to see status flags change.
- [ ] Document any custom conditions for future reference.
Diagram Labels
Site administration → Course settings → Availability → Conditional activities Course view → Edit settings → Restrict access → Activity completion condition Student preview → Lock icon → Unlock after completion
Conclusion
By enabling completion tracking and configuring Conditional activities, you can enforce a logical learning flow without manual intervention. The steps above provide a repeatable pattern that scales from small courses to large, multi‑section programs. Remember to test thoroughly in a staging environment before deploying to production, and keep an eye on database growth if you enable many conditions.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.