Skip to content

Commit

Permalink
feat: support update contest for DOMjudge v3
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 committed Nov 9, 2023
1 parent 103d12c commit 2b0dc41
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xcpcio_board_spider/spider/domjudge/v3/domjudge.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math

from xcpcio_board_spider.type import Contest, Team, Teams, Submission, Submissions, constants
from xcpcio_board_spider.type import Contest, Team, Teams, Submission, Submissions, constants, Color

from domjudge_utility import Dump, DumpConfig

Expand Down Expand Up @@ -136,3 +136,12 @@ def parse_runs(self):
self.runs.append(submission)

return self

def update_contest(self):
self.contest.problem_quantity = len(self.dump.problems)
self.contest.fill_problem_id()

self.contest.balloon_color = []
for p in self.dump.problems:
self.contest.balloon_color.append(
Color(background_color=p["rgb"], color="#000"))

0 comments on commit 2b0dc41

Please sign in to comment.