Tuesday, 10 May 2016

MALVO for Colosseum'16

This year has been pretty busy for now. I had been wanting to create a new platform for Lord of the Code, a college programming competition. It's held each year on Colosseum, our technical fest. The competition includes two rounds. Round one consists of MCQ challenges where each team is served with 50 questions on the language of their choice (C or Java). The finalists of the first round enter second round to solve programming challenges. There are ten questions to be solved in 2 hours of time. The job to create such a platform doesn't really look big until you begin and somehow enter the mid phase.

I had to build the entire site from scratch. For my platform I had to build both the front-end and back-end. I decided to go with Semantic-UI on front and with Django at back-end. Also I had a different idea for the implementation.

The MCQs round being the first round always had a lot of participants. It consisted of 50 MCQs that had to be solved within one hour. The MCQs on their site were served one for every request. So if you solved MCQ one (/mcq/1) you would then be directed to MCQ two (/mcq/2), and this goes on for other 48 MCQs. The server had to bear a lot of load. My idea was to send the MCQs at the client all at once. The team would then solve all the problems and upload all the answers once. Basically a single page application. The second round had fewer teams than the first one, so challenges were served at requests (/challege/<no>), no new stuff there. Plus it would have been more complex for an SPA because of the varying number of input test cases and therefore varying form fields.

I wanted the site to be neat. Semantic-UI looked great when I implemented it in templates. I also put up markdown support for question text and syntax highlighting for code (Yup! previous site didn't have syntax highlighting for code). MD support was provided by Showdownjs and highlighting by HighlightJS. Both are awesome libraries.

On a side note, I did not know you could download a custom package for HighlightJS depending on your language choices. Since the only two languages we were concerned with were C and Java, I didn't have to download the entire default HighlightJS library. I could download a custom package that supports only C and Java. Noice!

This project was pretty big, considering I had to create all models/views/templates from scratch. It was the biggest project by me in terms of lines of code (>6000), and I was happy that I completed it before the event date. Unfortunately, the organizers didn't use it for the MCQ round and decided to go with the older platform.

The Older software has been in use for more than three years.

They let me setup the site for the second round though. It worked great and didn't have any issues. Although watching it work as expected in the MCQ round would have been great. Anyways, I'll be setting up the site for the next competition, Code Connoisseur'16, which will be in August I think. I might even join the society and be a part of the organizing team. Why I didn't join it before? that would start another story.

Here's the source for the project: malvo. I'll be creating a Docker image so deployment becomes easier. But that's for some other day... probably.

Some edits were made to the post...