mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 修复ACM赛制计分
This commit is contained in:
1 parent
a764211eee
commit
7c6e97fdfc
9 files changed
+25
-19
No files matched your search
@@ -307,10 +307,13 @@ export class ContestProblemFileDownloadHandler extends ContestProblemHandler {
|
||||
}
|
||||
|
||||
class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
|
||||
async prepare() {
|
||||
if (!contest.isOngoing(this.tdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
||||
}
|
||||
|
||||
@param('tid', Types.ObjectID)
|
||||
@param('pid', Types.UnsignedInt)
|
||||
async prepare(domainId: string, tid: ObjectID, pid: number) {
|
||||
if (!contest.isOngoing(this.tdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
||||
async get(domainId: string, tid: ObjectID, pid: number) {
|
||||
let rdocs = [];
|
||||
if (contest.canShowRecord.call(this, this.tdoc)) {
|
||||
rdocs = await record.getUserInProblemMulti(
|
||||
@@ -318,7 +321,6 @@ class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
|
||||
this.pdoc.docId, true,
|
||||
).sort({ _id: -1 }).limit(10).toArray();
|
||||
}
|
||||
this.response.template = 'problem_submit.html';
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
['contest_main', 'contest_main'],
|
||||
@@ -335,6 +337,7 @@ class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
|
||||
rdocs,
|
||||
page_name: 'contest_detail_problem_submit',
|
||||
};
|
||||
this.response.template = 'problem_submit.html';
|
||||
}
|
||||
|
||||
@param('tid', Types.ObjectID)
|
||||
|
||||
@@ -117,6 +117,9 @@ class RecordDetailHandler extends Handler {
|
||||
rdoc,
|
||||
pdoc,
|
||||
};
|
||||
if (rdoc.contest) {
|
||||
this.response.body.tdoc = await contest.get(domainId, rdoc.contest.tid, rdoc.contest.type);
|
||||
}
|
||||
}
|
||||
|
||||
@param('rid', Types.ObjectID)
|
||||
|
||||
Reference in new issue
Block a user