mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix submit answer subtask id (#1191)
This commit is contained in:
1 parent
cded9cc13b
commit
0e688f77b7
1 file changed
+3
-2
@@ -3,10 +3,10 @@ import { fs } from '@hydrooj/utils';
|
|||||||
import checkers from '../checkers';
|
import checkers from '../checkers';
|
||||||
import { runFlow } from '../flow';
|
import { runFlow } from '../flow';
|
||||||
import { runQueued } from '../sandbox';
|
import { runQueued } from '../sandbox';
|
||||||
import { Context } from './interface';
|
import { Context, ContextSubTask } from './interface';
|
||||||
|
|
||||||
function judgeCase(c: NormalizedCase) {
|
function judgeCase(c: NormalizedCase) {
|
||||||
return async (ctx: Context) => {
|
return async (ctx: Context, ctxSubtask: ContextSubTask) => {
|
||||||
const chars = /[a-zA-Z0-9_.-]/;
|
const chars = /[a-zA-Z0-9_.-]/;
|
||||||
const name = (ctx.config.filename && /^[a-zA-Z0-9-_#.]+$/.test(ctx.config.filename))
|
const name = (ctx.config.filename && /^[a-zA-Z0-9-_#.]+$/.test(ctx.config.filename))
|
||||||
? ctx.config.filename.replace('#', c.id.toString())
|
? ctx.config.filename.replace('#', c.id.toString())
|
||||||
@@ -56,6 +56,7 @@ function judgeCase(c: NormalizedCase) {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: c.id,
|
id: c.id,
|
||||||
|
subtaskId: ctxSubtask.subtask.id,
|
||||||
status,
|
status,
|
||||||
score,
|
score,
|
||||||
time: 0,
|
time: 0,
|
||||||
|
|||||||
Reference in new issue
Block a user