Change rating system (DMOJ)
This commit is contained in:
parent
e261fc9e3b
commit
b6556a93f5
9 changed files with 369 additions and 117 deletions
|
@ -137,16 +137,17 @@ def api_v1_user_info(request, user):
|
|||
participations = ContestParticipation.objects.filter(user=profile, virtual=0, contest__is_visible=True,
|
||||
contest__is_private=False,
|
||||
contest__is_organization_private=False)
|
||||
for contest_key, rating, volatility in participations.values_list('contest__key', 'rating__rating',
|
||||
'rating__volatility'):
|
||||
for contest_key, rating, mean, performance in participations.values_list(
|
||||
'contest__key', 'rating__rating', 'rating__mean', 'rating__performance',
|
||||
):
|
||||
contest_history[contest_key] = {
|
||||
'rating': rating,
|
||||
'volatility': volatility,
|
||||
'raw_rating': mean,
|
||||
'performance': performance,
|
||||
}
|
||||
|
||||
resp['contests'] = {
|
||||
'current_rating': last_rating.rating if last_rating else None,
|
||||
'volatility': last_rating.volatility if last_rating else None,
|
||||
'history': contest_history,
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ def api_v2_user_info(request):
|
|||
|
||||
resp['contests'] = {
|
||||
"current_rating": last_rating[0].rating if last_rating else None,
|
||||
"volatility": last_rating[0].volatility if last_rating else None,
|
||||
'history': contest_history,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue