Using Moodle Conditional Activities to Enforce Prerequisites: A Practical Guide
Learn how Moodle’s Conditional Activities let you lock assignments behind quizzes or other triggers. Step‑by‑step example, trade‑offs, and a practical checklist help you implement prerequisites without extra plugins.
23 Dec 2025, 06:04 UTC

Why Do Students Need Prerequisites?
In many courses, a quiz or reading must be completed before an assignment can be accessed. Without a formal system, instructors rely on manual checks or ad‑hoc communication, which scales poorly and can lead to confusion.
Conditional Activities: The Built‑in Solution
Moodle’s Conditional activities feature (core since 2.3) lets you lock any activity or resource behind a rule. The rule can be based on completion, a quiz score, a time window, or any other trigger that Moodle tracks. Because it’s part of the core distribution, no extra plugins are required and the learning curve is minimal for seasoned Moodle users.
How It Works Internally
When you create a conditional activity, Moodle stores the rule in mdl_conditionalactivity and the target activity in mdl_conditionalactivity_target. At runtime, Moodle checks the condition against the student’s record and toggles visibility accordingly. The process is transparent to the student; they simply see a locked activity until the rule is satisfied.
Step‑by‑Step Example
Below is a concrete scenario: a quiz must be passed before an assignment can be accessed.
- Create a test course (e.g., “Intro to Moodle”).
- Course format: Weekly.
- Enable activity completion tracking.
- Add a quiz:
- Quiz name: Quiz 1.
- Set
Restrict access→Quiz completion→Must complete→Score of 70%.
- Add an assignment:
- Assignment name: Assignment 1.
- Under
Restrict access, clickAdd condition→Conditional activity. - Select the previously created quiz as the trigger.
- Choose
Must passand setScore of 70%if you want a pass‑rate check.
- Save changes and switch to student role to test.
- Students should see the assignment listed but with a lock icon until they complete the quiz.
- After passing the quiz, the lock disappears and the assignment becomes accessible.
Verification steps:
- Check the
mdl_conditionalactivitytable for a record linking the assignment to the quiz. - Use the
Activity completionreport to confirm that the assignment is marked as “Not available” until the prerequisite is met.
Trade‑offs and Limitations
While conditional activities are powerful, they come with caveats:
- Complexity: A single activity can have multiple conditions, and conditions can reference other conditional activities. Excessive nesting can create confusing access loops or circular dependencies that Moodle prevents but can still lead to unintended locking.
- Performance: Each page load triggers a check against the
mdl_conditionalactivitytables. On sites with thousands of rules, this can add noticeable latency. For most small‑to‑medium installations the impact is negligible. - Theme and plugin compatibility: Some custom themes or third‑party plugins may not honor the visibility flag, causing locked activities to appear incorrectly.
Practical Checklist for Implementation
- Define clear prerequisite logic before adding activities.
- Keep the number of conditions per activity to a minimum; use a single rule when possible.
- Test with a student account immediately after setting up each conditional activity.
- Document the prerequisites in the course handbook so students know what to expect.
- Monitor the
Activity completionreport for any anomalies or stuck states. - Periodically review the
mdl_conditionalactivitytables for orphaned records that may accumulate after course resets.
Conclusion
Conditional activities provide a low‑friction, core‑Moodle way to enforce prerequisites, gating, and completion logic. By following the step‑by‑step example and adhering to the checklist, instructors can create predictable learning paths without adding plugin overhead. Keep an eye on complexity and performance, especially in large courses, and you’ll harness Moodle’s built‑in capability to its full potential.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.