Use APScheduler to schedule and run the generate_daily_question function.
Remove unnecessary POST endpoints, since we don’t require them.
A new question must be generated once daily between 11:00 PM and 12:00 AM, before the next day starts (alternatively, the job can be scheduled for the afternoon if preferred).
If generation fails, raise an exception internally but do not break the API.
If no new question is generated, fallback to selecting one of the previously stored questions from the database.
Use APScheduler to schedule and run the generate_daily_question function.
Remove unnecessary POST endpoints, since we don’t require them.
A new question must be generated once daily between 11:00 PM and 12:00 AM, before the next day starts (alternatively, the job can be scheduled for the afternoon if preferred).
If generation fails, raise an exception internally but do not break the API.
If no new question is generated, fallback to selecting one of the previously stored questions from the database.