mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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 unknownSchool = this.translate('Unknown School');
|
||||
const statusMap = {
|
||||
[STATUS.STATUS_ACCEPTED]: 'AC',
|
||||
[STATUS.STATUS_ACCEPTED]: 'OK',
|
||||
[STATUS.STATUS_WRONG_ANSWER]: 'WA',
|
||||
[STATUS.STATUS_COMPILE_ERROR]: 'CE',
|
||||
[STATUS.STATUS_TIME_LIMIT_EXCEEDED]: 'TL',
|
||||
@@ -820,8 +820,10 @@ export async function apply(ctx: Context) {
|
||||
].concat(
|
||||
tdoc.pids.map((i, idx) => `@p ${pid(idx)},${escape(pdict[i]?.title || 'Unknown Problem')},20,0`),
|
||||
teams.map((i, idx) => {
|
||||
const teamName = `${i.rank ? '*' : ''}${escape(udict[i.uid].school || unknownSchool)}-${escape(udict[i.uid].uname)}`;
|
||||
return `@t ${idx + 1},0,1,${teamName}`;
|
||||
const showName = this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) && udict[i.uid].displayName
|
||||
? 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,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user