This commit is contained in:
2026-07-26 07:20:16 -06:00
parent 66fac1f66d
commit 224960ac0f
4 changed files with 57 additions and 9 deletions

View File

@@ -23,6 +23,9 @@ class SQLProblemConfigError(Exception):
class SQLJudgeDispatcher(JudgeDispatcher):
# 在 worker 内用 sqlite3 判题,不经过 ChooseJudgeServer也就没有槽位可释放
uses_judge_server = False
def judge(self):
Submission.objects.filter(id=self.submission.id).update(result=JudgeStatus.JUDGING)
self._push_status(JudgeStatus.JUDGING, "judging")
@@ -56,6 +59,15 @@ class SQLJudgeDispatcher(JudgeDispatcher):
return
cases.append(case)
# 判题给出的中文提示(授权拒绝/超时/内存/无结果集)只存在测试点的 error_message 里,
# 前端只读 statistic_info.err_info这里把首个失败测试点的提示提上来否则学生看不到原因
failed = next((c for c in cases if c["result"] != JudgeStatus.ACCEPTED), None)
if failed and failed["error_message"]:
self.submission.statistic_info["err_info"] = failed["error_message"]
else:
# rejudge 时清掉上一轮的残留提示
self.submission.statistic_info.pop("err_info", None)
self._process_judge_result({"err": None, "data": cases})
def _system_error(self, message):