My Start
So, about four months ago, one of our seniors (yep, just a regular college student here) introduced us to this new thing called Compiler - basically a code judge. They laid down the law saying we could only submit projects to the college if we got certificates showing we knew the basics of a programming language.
I won't bore you with the details, but basically, the questions in these assessments were supposed to be solved using basic programming stuff like if/else statements and string tricks. Sounds simple, right? Well, the real headache was dealing with the code judge itself. It was a mess. Most of us failed multiple times, had to redo the assessments, and the whole process lacked transparency.
Fed up with the system, I decided to take matters into my own hands. I set out on a mission to create something that could do what the current system did, but better. And that's where Judge0 comes into play.
The Tools I Used
I stuck with what I knew best - the MERN stack. But instead of MongoDB, I went with MySQL because I had some experience with it.
Instead of manually running code in different languages, we opted for Judge0. It was easy to use, no complicated setups needed, and it supported a bunch of languages. Why? Well, setting up separate servers for each language was risky business in terms of security. Plus, with our tight deadline, we needed something quick and reliable.
I also set up automatic deployment with Vercel for both frontend and backend. To keep costs down, I used Rapid API's pre-hosted Judge0 instance and freedb.tech's MySQL instance.
Behind the Scenes
I'm no design guru, so I borrowed some ideas from platforms like LeetCode for the interface. When a user clicks Run or Submit, the code gets sent to the backend along with test cases. Public test cases go straight to Judge0, while private ones hang out in our database first.
Judge0 sends back a token to track submissions, stored in our database for private tests and sent to the frontend for real-time updates. Oh, and I threw in some multiple-choice questions for fun, inspired by Kahoot.
When the user finishes the test, answers are submitted, and MySQL triggers kick in to calculate scores based on passed test cases.
What's Next?
I've got some more features implemented - like adding questions, a supervisor segment for physical tests, and a student dashboard by dragging a few buddies into this project, so maybe they'll have some thoughts too.
You can check out the project here, but honestly, I'm not completely satisfied with it yet. If I find the time, I might give it another go and see what I can improve.
Top comments (0)