Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
81e624b4
Commit
81e624b4
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/score.py
+13
-0
13 additions, 0 deletions
mo/score.py
with
13 additions
and
0 deletions
mo/score.py
+
13
−
0
View file @
81e624b4
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment