diff --git a/packages/hydrojudge/src/service.ts b/packages/hydrojudge/src/service.ts index 1ac55dfee..2d0f06202 100644 --- a/packages/hydrojudge/src/service.ts +++ b/packages/hydrojudge/src/service.ts @@ -37,8 +37,9 @@ async function postInit() { if (!global.Hydro.isFirstWorker) return; const judge = require('./judge'); - const { task, system, setting } = global.Hydro.model; - const { storage } = global.Hydro.service; + const { + task, system, setting, storage, + } = global.Hydro.model; const _judge = global.Hydro.handler.judge as any; if (system.get('hydrojudge.disable')) return; diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 2304fe1c3..4f31c673f 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.29.21", + "version": "2.29.22", "bin": "bin/hydrooj.js", "main": "dist/loader.js", "typings": "dist/loader.d.ts", diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index 97074f128..5dff3a915 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -270,10 +270,13 @@ export class ContestProblemHandler extends Handler { // @ts-ignore if (this.pdoc.domainId !== domainId) this.pdoc.docId = `${this.pdoc.domainId}:${this.pdoc.docId}`; this.attended = this.tsdoc && this.tsdoc.attend === 1; + const showAccept = contest.canShowScoreboard.call(this, this.tdoc, true); + if (!showAccept) this.pdoc.nAccept = 0; if (contest.isNotStarted(this.tdoc)) throw new ContestNotLiveError(tid); if (!contest.isDone(this.tdoc) && !this.attended) throw new ContestNotAttendedError(tid); this.response.template = 'problem_detail.html'; this.response.body = { + showAccept, tdoc: this.tdoc, tsdoc: this.tsdoc, pdoc: this.pdoc, diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 6d1ab0f27..3a9c36d95 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.12.15", + "version": "4.12.16", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/templates/problem_detail.html b/packages/ui-default/templates/problem_detail.html index ab84fbb35..7ceb850a1 100644 --- a/packages/ui-default/templates/problem_detail.html +++ b/packages/ui-default/templates/problem_detail.html @@ -39,13 +39,14 @@