Skip to content
Snippets Groups Projects
Commit 81e624b4 authored by Martin Mareš's avatar Martin Mareš
Browse files

mo.score: Vynecháváme účastníky bez odevzdaných řešení

parent 5fec97b6
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !36. Comments created here will be created in the context of that merge request.
......@@ -7,6 +7,7 @@ from typing import Any, List, Tuple, Optional, Dict, Union
import mo.db as db
from mo.util import normalize_grade
from mo.util_format import inflect_with_number
class ScoreOrder:
......@@ -145,6 +146,18 @@ class Score:
self._load_tasks_and_sols(0, round, contest_subq)
self._mark_winners()
# Vynecháme účastníky, kteří nic neodevzdali
to_remove = []
for user_id, results in self._results.items():
if not results._sols[0]:
to_remove.append(user_id)
if to_remove:
self._add_message('info',
inflect_with_number(len(to_remove), 'Vynechán %s soutěžící', 'Vynecháni %s soutěžící', 'Vynecháno %s soutěžících')
+ ' bez odevzdaných řešení.')
for user_id in to_remove:
self._results.pop(user_id)
def _load_tasks_and_sols(self, step: int, round: db.Round, contest_subq: Union[Query, List[int]]):
"""Obecná funkce na načtení úloh a řešení tohoto nebo předchozího kola"""
if step in self._tasks:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment