I’m looking for better solution to implement the temporary web page creation and then deletion at certain periods.
This is mainly for running the online tests for students.
Here is my solution:
- Students receiving the link to the web page with unique id: https://site.com/?k={unique_id}
- WebApp is writing to the database the time when link has been generated, time interval (alive period) and then set the link status to OPEN.
- Students opening the page after entering the passcode.
- A small cron job is running every 5 minutes and checking the status of link. It changes the status to CLOSE when time is out.
- Also, cron job is measuring the time left after the CLOSING the link and deleting the link from the database after some period of time.
- When student is clicking on the link, he/she receiving the working page or warning message that page has been expired, or page not found
So, while cron is working in the background, how to determine the status of link while students are working on a webpage? Embed a timer to the webpage?
There will be 50+ students running tests at different times, so I suppose some sort of load balancing will also be needed to keep it working smoothly.
Is this solution sounds good for such project?
Thanks!