diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index 30c12de4e..2ee3f7dcf 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -502,17 +502,35 @@ const strictioi = buildContestRule({ } } for (const pid of tdoc.pids) { - row.push({ - type: 'record', - value: ((tsddict[pid]?.score || 0) * ((tdoc.score?.[pid] || 100) / 100)).toString() || '', - hover: Object.values(tsddict[pid]?.subtasks || {}).map((i: SubtaskResult) => `${STATUS_SHORT_TEXTS[i.status]} ${i.score}`).join(','), - raw: tsddict[pid]?.rid, - score: tsddict[pid]?.score, - style: tsddict[pid]?.status === STATUS.STATUS_ACCEPTED - && tsddict[pid].rid.getTimestamp().getTime() - (tsdoc.startAt || tdoc.beginAt).getTime() === meta?.first?.[pid] - ? 'background-color: rgb(217, 240, 199);' - : undefined, - }); + const index = `${tsdoc.uid}/${tdoc.domainId}/${pid}`; + const n: ScoreboardNode = (!config.isExport && !config.lockAt && isDone(tdoc) + && meta?.psdict?.[index]?.rid + && tsddict[pid]?.rid?.toHexString() !== meta?.psdict?.[index]?.rid?.toHexString() + && meta?.psdict?.[index]?.rid?.getTimestamp() > tdoc.endAt) + ? { + type: 'records', + value: '', + raw: [{ + value: ((tsddict[pid]?.score || 0) * ((tdoc.score?.[pid] || 100) / 100)).toString() || '', + raw: tsddict[pid]?.rid || null, + score: tsddict[pid]?.score, + }, { + value: ((meta?.psdict?.[index]?.score || 0) * ((tdoc.score?.[pid] || 100) / 100)).toString() || '', + raw: meta?.psdict?.[index]?.rid ?? null, + score: meta?.psdict?.[index]?.score, + }], + } : { + type: 'record', + value: ((tsddict[pid]?.score || 0) * ((tdoc.score?.[pid] || 100) / 100)).toString() || '', + raw: tsddict[pid]?.rid, + score: tsddict[pid]?.score, + }; + n.hover = Object.values(tsddict[pid]?.subtasks || {}).map((i: SubtaskResult) => `${STATUS_SHORT_TEXTS[i.status]} ${i.score}`).join(','); + if (tsddict[pid]?.status === STATUS.STATUS_ACCEPTED + && tsddict[pid].rid.getTimestamp().getTime() - (tsdoc.startAt || tdoc.beginAt).getTime() === meta?.first?.[pid]) { + n.style = 'background-color: rgb(217, 240, 199);'; + } + row.push(n); } return row; },