精简 Problem 模型:移除 rule_type / total_score / io_mode

系统只用 ACM 模式且题目固定标准 IO,这三列已无实际用途:
- rule_type / total_score:OI 专用,删除后 judge/dispatcher 的 OI 分支全部塌缩为 ACM
- io_mode:判题改为固定发送 Standard IO 常量;languages.py 的 seccomp_rule
  保留 dict 形态但改用字面量 key,不改判题机 wire 契约
- prompt 字段保留(预留给未来 AI 分析)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 11:40:38 -06:00
parent 4743b0398a
commit 9535b64a4b
11 changed files with 58 additions and 140 deletions

View File

@@ -13,24 +13,6 @@ class ProblemTag(models.Model):
db_table = "problem_tag"
class ProblemRuleType(models.TextChoices):
ACM = "ACM", "ACM"
OI = "OI", "OI"
class ProblemIOMode(models.TextChoices):
STANDARD = "Standard IO", "Standard IO"
FILE = "File IO", "File IO"
def _default_io_mode():
return {
"io_mode": ProblemIOMode.STANDARD,
"input": "input.txt",
"output": "output.txt",
}
class Problem(models.Model):
# display ID
_id = models.TextField(db_index=True)
@@ -58,18 +40,14 @@ class Problem(models.Model):
time_limit = models.IntegerField()
# MB
memory_limit = models.IntegerField()
# io mode
io_mode = models.JSONField(default=_default_io_mode)
rule_type = models.TextField(choices=ProblemRuleType.choices)
visible = models.BooleanField(default=True, db_default=True)
difficulty = models.TextField(choices=Difficulty.choices)
tags = models.ManyToManyField(ProblemTag)
source = models.TextField(null=True)
# 预留:题目考察知识点,供未来 AI 分析使用(当前未接线)
prompt = models.TextField(null=True)
# [{language: "python", code: "..."}]
answers = models.JSONField(null=True)
# for OI mode
total_score = models.IntegerField(default=0, db_default=0)
submission_number = models.BigIntegerField(default=0, db_default=0)
accepted_number = models.BigIntegerField(default=0, db_default=0)
# {JudgeStatus.ACCEPTED: 3, JudgeStatus.WRONG_ANSWER: 11}, the number means count