mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: scoreboard
This commit is contained in:
1 parent
5c01cc44d8
commit
476457ac23
5 files changed
+9
-5
No files matched your search
@@ -208,7 +208,7 @@ export class ContestScoreboardDownloadHandler extends Handler {
|
||||
async get(domainId: string, tid: ObjectID, ext: string, ignoreLock = false) {
|
||||
await this.limitRate('scoreboard_download', 120, 3);
|
||||
const getContent = {
|
||||
csv: async (rows) => `\uFEFF${rows.map((c) => (c.map((i) => i.value).join(','))).join('\n')}`,
|
||||
csv: async (rows) => `\uFEFF${rows.map((c) => (c.map((i) => i.value.replace(/\n/g, ' ')).join(','))).join('\n')}`,
|
||||
html: (rows, tdoc) => this.renderHTML('contest_scoreboard_download_html.html', { rows, tdoc }),
|
||||
};
|
||||
const tdoc = await contest.get(domainId, tid);
|
||||
|
||||
@@ -210,6 +210,10 @@ class HomeworkScoreboardHandler extends Handler {
|
||||
const [tdoc, rows, udict, , nPages] = await contest.getScoreboard.call(
|
||||
this, domainId, tid, false, page,
|
||||
);
|
||||
const pdict = await problem.getList(domainId, tdoc.pids, true, undefined, false, [
|
||||
// Problem statistics display is allowed as we can view submission info in scoreboard.
|
||||
...problem.PROJECTION_CONTEST_LIST, 'nSubmit', 'nAccept',
|
||||
]);
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
['homework_main', 'homework_main'],
|
||||
@@ -218,7 +222,7 @@ class HomeworkScoreboardHandler extends Handler {
|
||||
];
|
||||
this.response.template = 'contest_scoreboard.html';
|
||||
this.response.body = {
|
||||
tdoc, rows, path, udict, page, nPages, page_name: 'homework_scoreboard',
|
||||
tdoc, rows, path, udict, pdict, page, nPages, page_name: 'homework_scoreboard',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user