mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix contest ghost export (#996)
This commit is contained in:
1 parent
db68d25e30
commit
8ed74053d5
1 file changed
+5
-3
@@ -795,7 +795,7 @@ export async function apply(ctx: Context) {
|
|||||||
const escape = (i: string) => i.replace(/[",]/g, '');
|
const escape = (i: string) => i.replace(/[",]/g, '');
|
||||||
const unknownSchool = this.translate('Unknown School');
|
const unknownSchool = this.translate('Unknown School');
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
[STATUS.STATUS_ACCEPTED]: 'AC',
|
[STATUS.STATUS_ACCEPTED]: 'OK',
|
||||||
[STATUS.STATUS_WRONG_ANSWER]: 'WA',
|
[STATUS.STATUS_WRONG_ANSWER]: 'WA',
|
||||||
[STATUS.STATUS_COMPILE_ERROR]: 'CE',
|
[STATUS.STATUS_COMPILE_ERROR]: 'CE',
|
||||||
[STATUS.STATUS_TIME_LIMIT_EXCEEDED]: 'TL',
|
[STATUS.STATUS_TIME_LIMIT_EXCEEDED]: 'TL',
|
||||||
@@ -820,8 +820,10 @@ export async function apply(ctx: Context) {
|
|||||||
].concat(
|
].concat(
|
||||||
tdoc.pids.map((i, idx) => `@p ${pid(idx)},${escape(pdict[i]?.title || 'Unknown Problem')},20,0`),
|
tdoc.pids.map((i, idx) => `@p ${pid(idx)},${escape(pdict[i]?.title || 'Unknown Problem')},20,0`),
|
||||||
teams.map((i, idx) => {
|
teams.map((i, idx) => {
|
||||||
const teamName = `${i.rank ? '*' : ''}${escape(udict[i.uid].school || unknownSchool)}-${escape(udict[i.uid].uname)}`;
|
const showName = this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) && udict[i.uid].displayName
|
||||||
return `@t ${idx + 1},0,1,${teamName}`;
|
? udict[i.uid].displayName : udict[i.uid].uname;
|
||||||
|
const teamName = `${i.rank ? '*' : ''}${escape(udict[i.uid].school || unknownSchool)}-${escape(showName)}`;
|
||||||
|
return `@t ${idx + 1},0,1,"${teamName}"`;
|
||||||
}),
|
}),
|
||||||
submissions,
|
submissions,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user