Certificate expirations

Profile picture for user spennel
spennel
Forums
Hello, how can I create a certificate that has an expiration date? For example, if a student gets certified in fire safety training, how do I make that certificate only good for 12 months after the student earns it?
Profile picture for user James Aparicio
James Aparicio

Hi spennel,

Hi spennel,

First thing would be to implement a hook opigno_course_passed. This is trigger once a user passes a course and would allow you to save the exact date the user finished a specific course.

Having that you could easily implement a cron (hook_cron) function that checks all those occurrences of a user/specific_finish_date_of_course/course. Check if a year has passed, and if yes, remove the user from the group/delete the results for that user in the specific course. This would make the certificate no longer available for the user and make him have to take it again.

Best regards