Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
/ judge Public archive

A blazingly fast online judge/ autograder ⚖️ built with Python and the Django framework to test cases against your solution. Check out the sponsor links and help fund DomeCode.

License

Notifications You must be signed in to change notification settings

arthtyagi/judge

Repository files navigation

Judge ⚖️

judge (1)

GitHub codebeat badge Discord GitHub Pipenv locked dependency version GitHub Pipenv locked Python version PyPI - Implementation Downloads Downloads Downloads

GitHub commit activity

image

An online judge built with Python and the Django framework to test cases against your solution. A better version of this is to be implemented in DomeCode. Check out the sponsor links and help fund DomeCode.

I'm trying to build an online judge to allow users of DomeCode to practice coding problems online. DomeCode is a project of mine in the making that allows people to learn code by practicing,participating in DomeCode's forum and using the resources compiled from all over the internet and woven together to create a one-stop experience for programmers.

The autograder for DomeCode is also being built on top of this with more ramifications and a few more features for the first release. But in actuality, this is the underlying piece of code in the most minimalistic way.

Tl,dr; This package just compares your solution text to the actual solution for the question. It just adds some ease of use to that task. You need to add the solutions to your questions from the admin and that's it, you're done. The use will upload their solution in the text form, this library will compare those two solutions and grade accordingly.

Update : Now we just use the Judge0 RapidAPI at DomeCode, might consider building an alternative to it.

Why? 🤔

To put it simply, adding a compiler like Cloud9 IDE or Sphere online judge is gonna cost me some bucks so initially I plan on building an in-house solution to allow users to practice coding problems like they did on Google Kickstart before 2019 or the way Coursera's autograder does. I hope this works out since the concept is sound as per my understanding.

How to use this? 💡

  • Add “coder” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
    ...
    'coder',
]

Include the polls URLconf in your project urls.py like this:

path('coder/', include('coder.urls')), Run python manage.py migrate to create the polls models.

  • Run the migrations!

  • Run the server. And get on your localhost:8000/admin

  • You will notice the coder app and it's models quite like this : image

  • Create a new question. I included the RichTextEditor too so that should make it easier to include photos, symbols, charts and more. image image

I just submitted the correct solution and as you can see, the autograder evaluated it as a correct answer. image

  • Yes, I know. I need to add a checkmark next to the question if it's evaluated correct but this is just to show that the autograder works and you can head back to the homepage of the website and submit your answer to the question! The possibilities tread as far as your imagination on how to use this. Modify this code to suit your purpose, it's MIT Licensing so have at it!

Most importantly though, if you liked using this, STAR ⭐ and FORK 🍴 this repository. That would make me happier and I would feel motivated to add new exciting features to this.

How does the autograder work so blazingly fast?

If you actually used this, you might be wondering how does the autograder make the process so blazingly fast in comparision to other autograders that might take a while ( ~10-15 secs whereas this app does it within ~2-3 seconds ), the reason lies within the fact that it never actually reads from the disk while evaluating the user's solution, it directly reads from the memory and does not overwhelm the system either since text files are generally smaller.

You should know this!

If this project actually gets a decent number of stars and forks, I will be implementing a few more core features to this including but not limited to :

  • Search functionality 🔍

  • Displaying whether the answer is correct in Question's submission panel. ✅

  • Displaying whether the question attempted by the user is correct in the Question List View. ✅ image

  • Adding an actual compiler ( resource-heavy so well yeah it's expensive when run on the cloud ) 💸

  • Better admin interface 🌟

  • Rich text editing for coding problems to include pictures and more!✨

Support this project 🤗

Since I've already started to build this, I'm probably gonna learn to build a cloud based compiler as well and add it on this existing version of Online Judge/autograder to make it a full-fledged Online Judge to the likes of Sphere Online Judge.

I intend to keep the source code absolutely open source forever for people to use and instead of paying services like Cloud9 IDE or Sphere Online Judge, this would allow users to implement this in the form a PyPi package ( will ship it soon ) and use it for their own applications and host it on AWS/GCP/Digital Ocean for slightly cheaper than you might with a pre built online judge to be embedded in your application.

This open source project is here to stay and be maintained so I would urge you to consider supporting this project by sponsoring it! Links included on the Github repo info panel.

Also checkout one of the other projects, Geddit 🦄 having base structural code for some of the features of DomeCode.

A word of thanks

I also want to thank the Django Developer Community all over the internet for being a good help when I got stuck.

About

A blazingly fast online judge/ autograder ⚖️ built with Python and the Django framework to test cases against your solution. Check out the sponsor links and help fund DomeCode.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published