mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: 修复contest-scoreboard不进行排序的问题
This commit is contained in:
1 parent
2e8f3e42cd
commit
ccc8ee23f2
5 files changed
+9
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.13.42",
|
||||
"version": "2.13.43",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -12,6 +12,7 @@ import { PERM, PRIV, CONSTANT } from '../model/builtin';
|
||||
import * as contest from '../model/contest';
|
||||
import * as document from '../model/document';
|
||||
import * as problem from '../model/problem';
|
||||
import * as domain from '../model/domain';
|
||||
import * as record from '../model/record';
|
||||
import * as user from '../model/user';
|
||||
import * as message from '../model/message';
|
||||
@@ -308,6 +309,8 @@ class ContestProblemSubmitHandler extends ContestProblemHandler {
|
||||
});
|
||||
const [rdoc] = await Promise.all([
|
||||
record.get(domainId, rid),
|
||||
problem.inc(domainId, this.pdoc.docId, 'nSubmit', 1),
|
||||
domain.incUserInDomain(domainId, this.user._id, 'nSubmit'),
|
||||
contest.updateStatus(domainId, this.tdoc.docId, this.user._id, rid, this.pdoc.docId),
|
||||
]);
|
||||
bus.boardcast('record/change', rdoc);
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
Route, Handler, Types, param,
|
||||
} from '../service/server';
|
||||
import * as bus from '../service/bus';
|
||||
import * as domain from '../model/domain';
|
||||
import { PERM, CONSTANT } from '../model/builtin';
|
||||
import * as user from '../model/user';
|
||||
import * as contest from '../model/contest';
|
||||
@@ -186,6 +187,8 @@ class HomeworkDetailProblemSubmitHandler extends HomeworkDetailProblemHandler {
|
||||
});
|
||||
const [rdoc] = await Promise.all([
|
||||
record.get(domainId, rid),
|
||||
problem.inc(domainId, pid, 'nSubmit', 1),
|
||||
domain.incUserInDomain(domainId, this.user._id, 'nSubmit'),
|
||||
contest.updateStatus(domainId, tid, this.user._id,
|
||||
rid, pid, false, 0, document.TYPE_HOMEWORK),
|
||||
]);
|
||||
|
||||
@@ -282,6 +282,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true);
|
||||
const [rdoc] = await Promise.all([
|
||||
record.get(domainId, rid),
|
||||
problem.inc(domainId, this.pdoc.docId, 'nSubmit', 1),
|
||||
domain.incUserInDomain(domainId, this.user._id, 'nSubmit'),
|
||||
]);
|
||||
bus.boardcast('record/change', rdoc);
|
||||
|
||||
@@ -495,7 +495,7 @@ export const ContestHandlerMixin = (c) => class extends c {
|
||||
): Promise<[Tdoc, ScoreboardNode[][], Udict]> {
|
||||
const tdoc = await get(domainId, tid, docType);
|
||||
if (!this.canShowScoreboard(tdoc)) throw new ContestScoreboardHiddenError(tid);
|
||||
const tsdocs = await getMultiStatus(domainId, { docId: tid }, docType).toArray();
|
||||
const tsdocs = await getMultiStatus(domainId, { docId: tid }, docType).sort(RULES[tdoc.rule].statusSort).toArray();
|
||||
const uids = tsdocs.map((tsdoc) => tsdoc.uid);
|
||||
const [udict, pdict] = await Promise.all([
|
||||
user.getList(domainId, uids),
|
||||
|
||||
Reference in new issue
Block a user