judge: support HYDRO_TESTCASE

This commit is contained in:
undefined committed 2022-02-11 00:13:49 +08:00
1 parent 9ea781f800
commit ede8a26253
5 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@hydrooj/hydrojudge", "name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js", "bin": "bin/hydrojudge.js",
"version": "2.13.3", "version": "2.13.4",
"main": "package.json", "main": "package.json",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",
+1 -1
View File
@@ -75,7 +75,7 @@ function judgeCase(c: Case, sid: string) {
checker_type: ctx.config.checker_type, checker_type: ctx.config.checker_type,
score: ctxSubtask.subtask.score, score: ctxSubtask.subtask.score,
detail: ctx.config.detail ?? true, detail: ctx.config.detail ?? true,
env: ctx.env, env: { ...ctx.env, HYDRO_TESTCASE: c.id.toString() },
}); });
} }
} else if (status === STATUS.STATUS_RUNTIME_ERROR && code) { } else if (status === STATUS.STATUS_RUNTIME_ERROR && code) {
+1 -1
View File
@@ -35,7 +35,7 @@ function judgeCase(c: Case) {
time: ctxSubtask.subtask.time * 2 * ctx.executeInteractor.time, time: ctxSubtask.subtask.time * 2 * ctx.executeInteractor.time,
memory: ctxSubtask.subtask.memory * 2, memory: ctxSubtask.subtask.memory * 2,
copyOut: ['/w/tout?'], copyOut: ['/w/tout?'],
env: ctx.env, env: { ...ctx.env, HYDRO_TESTCASE: c.id.toString() },
}, },
); );
// TODO handle tout (maybe pass to checker?) // TODO handle tout (maybe pass to checker?)
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.4.19", "version": "3.4.20",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+2 -1
View File
@@ -256,8 +256,9 @@ export function flushNodes(domainId: string) {
export async function getVnode(domainId: string, type: number, id: string, uid?: number) { export async function getVnode(domainId: string, type: number, id: string, uid?: number) {
if (type === document.TYPE_PROBLEM) { if (type === document.TYPE_PROBLEM) {
const pdoc = await problem.get(domainId, Number.isSafeInteger(+id) ? +id : id); let pdoc = await problem.get(domainId, Number.isSafeInteger(+id) ? +id : id, problem.PROJECTION_LIST);
if (!pdoc) throw new DiscussionNodeNotFoundError(id); if (!pdoc) throw new DiscussionNodeNotFoundError(id);
if (pdoc.hidden) pdoc = problem.default;
return { ...pdoc, type, id: pdoc.docId }; return { ...pdoc, type, id: pdoc.docId };
} }
if ([document.TYPE_CONTEST, document.TYPE_TRAINING, document.TYPE_HOMEWORK].includes(type as any)) { if ([document.TYPE_CONTEST, document.TYPE_TRAINING, document.TYPE_HOMEWORK].includes(type as any)) {