core: handle hack rejudge

This commit is contained in:
undefined committed 2022-09-06 13:02:46 +08:00
1 parent ce8627bce8
commit f87c320e42
7 files changed
+143 -46

No files matched your search

+2 -2
View File
@@ -62,12 +62,12 @@ class RecordModel {
};
}
static async judge(domainId: string, rid: ObjectID, priority = 0, config: ProblemConfigFile = {}) {
static async judge(domainId: string, rid: ObjectID, priority = 0, config: ProblemConfigFile = {}, meta: Partial<JudgeMeta> = {}) {
const rdoc = await RecordModel.get(domainId, rid);
if (!rdoc) return null;
let data: FileInfo[] = [];
let source = `${domainId}/${rdoc.pid}`;
const meta: JudgeMeta = { problemOwner: 1 };
meta = { ...meta, problemOwner: 1 };
if (rdoc.pid) {
let pdoc = await problem.get(rdoc.domainId, rdoc.pid);
if (!pdoc) throw new ProblemNotFoundError(rdoc.domainId, rdoc.pid);