Course Prerequisites
Prerequisites let you require a student to finish one or more other courses before they can enrol in this one. It is how you enforce a learning order instead of letting students jump straight to the advanced material.
What you can do
- Require one or several other courses to be completed before a student can enrol in this course.
- Block enrollment for any student who has not finished all of the required courses.
- Show the required courses on the course page as links, so a student can discover and take them first.
- Leave prerequisites empty to keep a course open to everyone.

How to use it
Step 1 -- open the Prerequisites section
Edit the course and open the Prerequisites, Difficulty & Target section of the course editor. The prerequisite picker appears when you are editing an existing course and there is at least one other course to choose from.
Step 2 -- pick the required courses
Use the search box to filter the course list, then tick each course a student must complete first. You can select as many as you need. The course you are editing is never shown in its own list.
Step 3 -- save
Save the course. Prerequisites are stored as a list of course IDs on the course.
Step 4 -- what the student sees
On the course page, the required courses render under a Prerequisites heading as links, so a student can go take them. When a student tries to enrol, Learnomy checks that they hold a completed enrollment for every required course. If any is missing or only in progress, enrollment is refused with a message to complete the prerequisites first.
Settings and options
- Completed, not just enrolled. A prerequisite is satisfied only by a completed enrollment. An active (in-progress) enrollment in a required course does not unlock the target course.
- All required courses must pass. Every course in the list must be completed; there is no "any one of" mode.
- Enforced everywhere. The prerequisite check runs at the service layer, so it applies to REST, admin, and CLI enrollment paths alike, not just the front-end Enrol button.
- Empty means open. A course with no prerequisites is open to everyone (subject to its pricing and access model).
For developers
Service (Learnomy\Services\Course_Service):
check_prerequisites( $user_id, $course_id )-- returns true when the user holds a completed enrollment for every prerequisite course, or the course has none. Called fromEnrollment_Service::enroll()before any enrollment row is created; a failed check makesenroll()return 0.
Storage: lrn_courses.prerequisites holds a JSON array of course IDs. The courses REST controller accepts a prerequisites array on create/update and stores it as JSON.
REST: POST to the enrollments endpoint returns a validation error ("You must complete the required prerequisite courses first.") when prerequisites are unmet.