From 83d8d747158a58f0a49ea7f639050c9dbbec5c1b Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 2 Nov 2020 22:14:19 +0800 Subject: [PATCH] =?UTF-8?q?judge:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/service.ts | 2 +- packages/hydrooj/package.json | 2 +- packages/hydrooj/src/model/record.ts | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 9b5153f1c..69dce590e 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.1.18", + "version": "2.1.19", "main": "package.json", "author": "masnn", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/service.ts b/packages/hydrojudge/src/service.ts index 001d6a32e..3c7842732 100644 --- a/packages/hydrojudge/src/service.ts +++ b/packages/hydrojudge/src/service.ts @@ -207,7 +207,7 @@ async function postInit() { this.domainId = this.request.domainId; this.lang = this.request.lang; this.code = this.request.code; - this.data = this.request.data; + this.data = this.request.data.toString(); this.config = this.request.config; this.next = getNext(this); this.end = getEnd(this.domainId, this.rid); diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 648963bfb..83db440f7 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.13.34", + "version": "2.13.35", "bin": "bin/hydrooj.js", "main": "dist/loader.js", "typings": "dist/loader.d.ts", diff --git a/packages/hydrooj/src/model/record.ts b/packages/hydrooj/src/model/record.ts index 3f03119d1..c938f05bb 100644 --- a/packages/hydrooj/src/model/record.ts +++ b/packages/hydrooj/src/model/record.ts @@ -57,9 +57,11 @@ export async function get(domainId: string, _id: ObjectID): Promise export async function judge(domainId: string, rid: ObjectID) { const rdoc = await get(domainId, rid); let config: RunConfig | ProblemConfig = rdoc.config; - if (!config) { + let data; + if (rdoc.pid) { const pdoc = await problem.get(domainId, rdoc.pid); - config = pdoc?.config || {}; + if (!config) config = pdoc?.config || {}; + data = pdoc.data; } delete rdoc._id; await task.add({ @@ -68,6 +70,7 @@ export async function judge(domainId: string, rid: ObjectID) { rid, domainId, config, + data, }); }