Queue System for Exam Portal

Замовник: AI | Опубліковано: 15.11.2025

I’ve built a PHP-based placement-training exam portal and everything works smoothly until many students hit the “Run Test Cases” button at once. The server then responds with HTTP 429 (“Too Many Requests”). To solve this, I want to introduce a lightweight queue on the take_exam.php page. Here’s the flow I have in mind. When a student clicks Run Test Cases, the request is added to a first-come, first-served queue. While waiting, the page should: • lock every interactive element so nothing else can be pressed (buttons remain inactive) • show a clear on-screen message explaining the short delay • when it was entered into queue then the exam timer should be stop until the queue cleared and gets testcases • display both a countdown timer and a simple progress indicator so students know exactly how long they’ll wait As soon as their turn arrives, a pop-up notifies them and normal controls are restored so the code can be executed without triggering 429s. I’m happy with a solution that relies on PHP, JavaScript (vanilla or a lightweight framework), and AJAX/Fetch for the background polling, but I’m open to any approach that keeps the UI responsive and the server load under control. Deliverables 1. Queue logic integrated into take_exam.php, ensuring serialised code execution. 2. Front-end waiting screen with timer, progress bar, and explanatory text. 3. Pop-up notification that releases the lock when the queue reaches the student’s slot. 4. Clean, commented code plus a short read-me so I can maintain the feature. If you’ve tackled rate-limiting or real-time queues in PHP before, your experience will be invaluable. Let me know any clarifications you need; I’m ready to move quickly once I find the right fit.