core: support display after contest record score on ioi-strict (#1004)

This commit is contained in:
panda authored and GitHub committed 2025-06-30 10:09:07 +01:00
1 parent e479cb94ea
commit db68d25e30
1 file changed
+29 -11
+29 -11
View File
@@ -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;
},