# Expiration Duration

Expiration Duration acts as an automated "timer." It ensures that once a student finishes their course requirements, they only remain in the class for a pre-defined amount of time before the system automatically removes them from the active enrollment list.

#### <span style="color: rgb(18, 64, 114);">**How to set the Expiration Duration:**</span>

To configure the timer for a specific class, follow these steps:

- Navigate to the Side Drawer &gt; Program &gt; Manage Course Instances.

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-hfj9ztbw.png)

- Search for your target class and click its name to open the settings.

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-2era4wqx.png)

- Click the Edit button at the top of the page.

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-loitqgf7.png)

- Locate the Expiration Duration field.
- Enter a value using the system timing codes (e.g., 2i for 2 minutes or 24h for 24 hours).
- Scroll to the bottom and click Save Changes.

###   
Testing Enrollment and Course Completion

To verify the feature is working, you must simulate a student finishing the course:

- Switch to the Enrollments tab within the Course Instance.
- Click Enroll Student, select a test user using the Arrow Icon, and click the Green Tick to save.

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-7nhdy65i.png)

- Log in as the student and navigate to the Learnexify Course linked to this class.
- Complete all required activities, assignments, or lessons so the student’s status updates to "Completed."

###   
Running System Automation (Cron)

Learnexify processes background tasks through a system engine called Cron (Scheduled Tasks). The Cron runs automatically every minute, so expired enrollments are normally processed without any manual action.

For testing purposes, you can also trigger the Cron manually:

- Navigate to the Administrator Dashboard.
- Locate the Scheduled Tasks (Cron) section.
- Run the script manually to force the system to check for expired enrollments immediately.

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-bliqwpaw.png)

###   
Verifying the Automated Unenrollment

Once the configured duration (e.g., 2 or 5 minutes) has passed and the Cron has run:

- Return to Manage Course Instance &gt; Enrollments.
- Refresh the page.
- Check the Currently Enrolled list.

**Result:** The student will no longer appear in the list. The system automatically unenrolls the student once the configured expiration duration is reached.

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-mav8g25w.png)

![](https://wiki.paktaleem.net/uploads/images/gallery/2026-07/embedded-image-s8xalvpr.png)