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, }); }