Skip to content

Commit 55a9d26

Browse files
committed
Socreboard fixes
1 parent ae48df6 commit 55a9d26

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

omogenjudge/contests/scoreboard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _process_team(self, team: Team, submissions: Dict[int, List[Submission]]) ->
112112
if team.contest_start_time:
113113
elapsed = self.now - team.contest_start_time
114114
if (not self._at_time or elapsed <= self._at_time) and elapsed <= self.contest.duration:
115-
sc_team.virtual_time = self.now - team.contest_start_time
115+
sc_team.virtual_time = elapsed
116116
teams.append(sc_team)
117117
if not self._at_time and (not teams or problem_results != upsolved_results):
118118
upsolve_team = ScoreboardTeam(
@@ -267,8 +267,10 @@ def _process_problem(self, submissions: List[Submission], scoreboard_problem: Sc
267267
}
268268

269269

270-
def load_scoreboard(contest: Contest, *, now: datetime.datetime = timezone.now(),
270+
def load_scoreboard(contest: Contest, *, now: Optional[datetime.datetime] = None,
271271
at_time: Optional[datetime.timedelta] = None) -> ScoreboardMaker:
272+
if not now:
273+
now = timezone.now()
272274
problems = list(contest_problems_with_grading(contest))
273275
teams = list(contest_teams(contest))
274276
registered_user_ids = [tm.account_id for team in teams for tm in team.teammember_set.all()]

omogenjudge/frontend/jinja2/problems/view_problem.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
document.querySelectorAll('.tex2jax_process').forEach(
2424
el => renderMathInElement(el, { delimiters: [
2525
{left: '$', right: '$', display: false},
26+
{left: '$$', right: '$$', display: true},
2627
{left: '\\(', right: '\\)', display: false},
28+
{left: '\\[', right: '\\]', display: true},
2729
],
2830
ignoredClasses: ['*']
2931
}));

omogenjudge/frontend/jinja2/scoreboard/view_scoreboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1 class="text-center">{{ contest.title }}</h1>
3333
{% if contest_started %}
3434
{% for cproblem in scoreboard.problems %}
3535
{% if cproblem.label %}
36-
<th style="width: 2em">
36+
<th style="width: 2em" class="text-center">
3737
<a href="{{ contest_url('problem', cproblem.problem.short_name) }}">
3838
<span class="badge me-1 bg-primary"
3939
data-bs-toggle="tooltip" data-bs-placement="top"

0 commit comments

Comments
 (0)