Need to create/delete web pages at certain times

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:

  1. Students receiving the link to the web page with unique id: https://site.com/?k={unique_id}
  2. 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.
  3. Students opening the page after entering the passcode.
  4. 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.
  5. 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.
  6. 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!

Could you add an open and close time to the database and check them on login rather than an ‘open’ field and cron job?
You could then load the close time as a property into the session and then check it each time a student answers a question?

Thanks for suggestions!
The reason for a cron is in additional monitoring, as if student will not open the link at a given time frame, then page will simply gone.

What about dynamic content? Page renders a content some times and a Expired message page others, depending on system (server side) setup (database, like period, start,end) and server time.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.