DMOJ / online-judge

A modern open-source online judge and contest platform system.
https://dmoj.ca
GNU Affero General Public License v3.0
908 stars 352 forks source link

Rating and medals #13

Closed FatalEagle closed 8 years ago

FatalEagle commented 9 years ago

Contest rating and/or medals would be a nice incentive for people to actually participate.

quantum5 commented 9 years ago

Any idea how the rating systems usually work? Any idea on who, where, when, and what the medals will be awarded?

FatalEagle commented 9 years ago

Elo rating system sounds like a good start. Medals can be awarded to participants in contests, with number of medals awarded being manually configurable or based on total number of participants who have nonzero scores. Maybe medals can each have a unique description?

quantum5 commented 9 years ago

Design considerations:

class Rating(models.Model):
    profile = models.ForeignKey(Profile)
    contest = models.ForeignKey(Contest)
    rating = models.IntegerField()
    volatility = models.IntegerField()
    last_rated = models.DateTimeField()

This model will serve as the user's rating history. To save queries, we might consider saving the rating in the Profile model. The rating history, when used, will be sorted by the end time of the contest. Every single rating will be calculated from the previous chronological contest, and doing so should (optionally) automatically calculate the subsequent ratings.

Hopefully calculating ratings will not be too slow, but again, you don't calculate them on every request.

FatalEagle commented 9 years ago

A contest with serious mistakes in test data or statements should be unrated (therefore not all contests should be rated).

quantum5 commented 9 years ago

Guess a rated boolean field on the contest should work. Probably only admins should be able to set it.

quantum5 commented 8 years ago

Rating is implemented a long time ago. Any other reward will be a separate ticket.