修改比赛排名的bug
This commit is contained in:
@@ -396,7 +396,7 @@ def _cmp(x, y):
|
|||||||
def contest_rank_page(request, contest_id):
|
def contest_rank_page(request, contest_id):
|
||||||
contest = Contest.objects.get(id=contest_id)
|
contest = Contest.objects.get(id=contest_id)
|
||||||
contest_problems = ContestProblem.objects.filter(contest=contest).order_by("sort_index")
|
contest_problems = ContestProblem.objects.filter(contest=contest).order_by("sort_index")
|
||||||
result = ContestSubmission.objects.values("user_id").annotate(total_submit=Count("user_id"))
|
result = ContestSubmission.objects.values("user_id").annotate(total_submit=Sum("total_submission_number"))
|
||||||
for i in range(0, len(result)):
|
for i in range(0, len(result)):
|
||||||
# 这个人所有的提交
|
# 这个人所有的提交
|
||||||
submissions = ContestSubmission.objects.filter(user_id=result[i]["user_id"])
|
submissions = ContestSubmission.objects.filter(user_id=result[i]["user_id"])
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ forloop.counter }}</th>
|
<th scope="row">{{ forloop.counter }}</th>
|
||||||
<td>{{ item.user.username }}</td>
|
<td>{{ item.user.username }}</td>
|
||||||
<td>{{ item.total_ac }} / {{ item.total_submission_number }}</td>
|
<td>{{ item.total_ac }} / {{ item.total_submit }}</td>
|
||||||
<td>{% if item.total_time %}{{ item.total_time }} min{% else %}--{% endif %}</td>
|
<td>{% if item.total_time %}{{ item.total_time }} min{% else %}--{% endif %}</td>
|
||||||
{% for problem in contest_problems %}
|
{% for problem in contest_problems %}
|
||||||
<td class="{% submission_problem_result_class problem item.submissions %}">
|
<td class="{% submission_problem_result_class problem item.submissions %}">
|
||||||
|
|||||||
Reference in New Issue
Block a user