core: fix OI mode contest score leak (#860)

Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
Langning Chenandundefined authored and GitHub committed 2024-08-12 11:56:36 +08:00
1 parent d33a3a1fb0
commit e274330191
1 file changed
+2 -1
+2 -1
View File
@@ -222,7 +222,7 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler {
contest.getMultiClarification(domainId, tid, this.user._id),
]);
this.response.body = {
pdict, psdict: {}, udict, rdict: {}, tdoc: this.tdoc, tsdoc: this.tsdoc, tcdocs,
pdict, psdict: {}, udict, rdict: {}, tdoc: this.tdoc, tcdocs,
};
this.response.template = 'contest_problemlist.html';
this.response.body.showScore = Object.values(this.tdoc.score || {}).some((i) => i && i !== 100);
@@ -231,6 +231,7 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler {
await contest.setStatus(domainId, tid, this.user._id, { startAt: new Date() });
this.tsdoc.startAt = new Date();
}
this.response.body.tsdoc = pick(this.tsdoc, ['attend', 'startAt', ...(this.tdoc.duration ? ['endAt'] : [])]);
this.response.body.psdict = this.tsdoc.detail || {};
const psdocs: any[] = Object.values(this.response.body.psdict);
const canViewRecord = contest.canShowSelfRecord.call(this, this.tdoc);