Skip to content

Commit ea5ce65

Browse files
committed
Fix bugs & Optimize
1 parent 2a975c9 commit ea5ce65

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

cms/server/contest/handlers/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ def render_params(self):
8383

8484
if self.current_user is not None:
8585
participation = ret["participation"]
86+
should_show_task_overview = (
87+
ret["actual_phase"] >= 0 or participation.unrestricted
88+
)
8689

8790
# ContestHandler may have already loaded a fully-joined participation
8891
# while computing sidebar scores. Reuse it to avoid a duplicate query.
8992
already_preloaded_for_scores = "sidebar_task_scores" in ret
90-
if self.contest.show_task_scores_in_overview:
93+
if self.contest.show_task_scores_in_overview and should_show_task_overview:
9194
if not already_preloaded_for_scores:
9295
loaded_participation = self._load_participation_for_scores(
9396
participation

cms/server/contest/handlers/tasksubmission.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,14 @@ def get(self, task_name):
144144

145145
public_score, is_public_score_partial = task_score(
146146
participation, task, public=True, rounded=True)
147-
tokened_score, is_tokened_score_partial = task_score(
148-
participation, task, only_tokened=True, rounded=True)
149-
# These two should be the same, anyway.
147+
if self.r_params["actual_phase"] == 3:
148+
tokened_score, is_tokened_score_partial = task_score(
149+
participation, task, rounded=True
150+
)
151+
else:
152+
tokened_score, is_tokened_score_partial = task_score(
153+
participation, task, only_tokened=True, rounded=True
154+
)
150155
is_score_partial = is_public_score_partial or is_tokened_score_partial
151156

152157
submissions_left_contest = None

0 commit comments

Comments
 (0)