diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index d204a31f..f1463034 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -442,6 +442,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler { const rdocs = await record.getMulti(domainId, { pid, contest: { $ne: new ObjectID('0'.repeat(24)) }, + status: { $ne: STATUS.STATUS_CANCELED }, 'files.hack': { $exists: false }, }).project({ _id: 1, contest: 1 }).toArray(); if (!this.pdoc.config || typeof this.pdoc.config === 'string') throw new ProblemConfigError(); diff --git a/packages/hydrooj/src/handler/record.ts b/packages/hydrooj/src/handler/record.ts index effd3568..1616ee71 100644 --- a/packages/hydrooj/src/handler/record.ts +++ b/packages/hydrooj/src/handler/record.ts @@ -216,7 +216,10 @@ class RecordDetailHandler extends ContestDetailBaseHandler { record.update(domainId, rid, $set), TaskModel.deleteMany({ rid: this.rdoc._id }), ]); - if (latest) await postJudge(latest); + if (latest) { + this.ctx.broadcast('record/change', latest); + await postJudge(latest); + } this.back(); } }