Skip to content

Commit

Permalink
Support update problem_quantity for csg cpc
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 committed Oct 13, 2024
1 parent 8fe8855 commit 21db58d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contest_name": "", "start_time": 1694912400, "end_time": 1694930400, "frozen_time": 3600, "penalty": 1200, "problem_quantity": 0, "problem_id": [], "group": {"official": "\u6b63\u5f0f\u961f\u4f0d", "unofficial": "\u6253\u661f\u961f\u4f0d"}, "organization": "School", "status_time_display": {"correct": true, "incorrect": true, "pending": true}, "medal": {}, "options": {}}
{"contest_name": "", "start_time": 1694912400, "end_time": 1694930400, "frozen_time": 3600, "penalty": 1200, "problem_quantity": 11, "problem_id": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"], "group": {"official": "\u6b63\u5f0f\u961f\u4f0d", "unofficial": "\u6253\u661f\u961f\u4f0d"}, "organization": "School", "status_time_display": {"correct": true, "incorrect": true, "pending": true}, "medal": {}, "balloon_color": [{"color": "#fff", "background_color": "rgba(189, 14, 14, 0.7)"}, {"color": "#fff", "background_color": "rgba(149, 31, 217, 0.7)"}, {"color": "#fff", "background_color": "rgba(16, 32, 96, 0.7)"}, {"color": "#000", "background_color": "rgba(38, 185, 60, 0.7)"}, {"color": "#000", "background_color": "rgba(239, 217, 9, 0.7)"}, {"color": "#fff", "background_color": "rgba(243, 88, 20, 0.7)"}, {"color": "#fff", "background_color": "rgba(12, 76, 138, 0.7)"}, {"color": "#000", "background_color": "rgba(156, 155, 155, 0.7)"}, {"color": "#000", "background_color": "rgba(4, 154, 115, 0.7)"}, {"color": "#fff", "background_color": "rgba(159, 19, 236, 0.7)"}, {"color": "#000", "background_color": "rgba(42, 197, 202, 0.7)"}], "options": {}}
18 changes: 14 additions & 4 deletions xcpcio_board_spider/spider/csg_cpc/v1/csg_cpc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import typing
import requests
import json
import os
import typing

from xcpcio_board_spider import Contest, Team, Teams, Submission, Submissions, utils, constants
import requests

from xcpcio_board_spider import (
Contest,
Submission,
Submissions,
Team,
Teams,
constants,
utils,
)


class CSG_CPC():
Expand Down Expand Up @@ -211,7 +220,8 @@ def update_contest(self):

self.contest.start_time = self.get_timestamp_from_date(start_time)
self.contest.end_time = self.get_timestamp_from_date(end_time)

self.contest.frozen_time = int(frozen_minute) * 60
self.contest.problem_quantity = len(self.raw_problem_data)
self.contest.fill_problem_id().fill_balloon_color()

return self

0 comments on commit 21db58d

Please sign in to comment.