fix(diff): get cases path
All checks were successful
build / build (pull_request) Successful in 2m32s
build / build (push) Successful in 2m35s

This commit is contained in:
李衍志523370910113 2025-02-27 15:45:25 +08:00
parent 1f0ee639dd
commit 05207037f5

View File

@ -276,7 +276,13 @@ def fix_diff(
stage_cases.append( stage_cases.append(
result.OptionalCmd( result.OptionalCmd(
stdin=result.CmdFile( stdin=result.CmdFile(
src=f"/home/tt/.config/joj/{task_conf.task.type_}/{stdin}" src=(
(task_conf.root / task_conf.path)
.parent.joinpath(stdin)
.name
if task_conf.root is not None and task_conf.path is not None
else f"/home/tt/.config/joj/{task_conf.task.type_}/{stdin}"
)
), ),
args=(shlex.split(command) if command is not None else None), args=(shlex.split(command) if command is not None else None),
cpu_limit=cpu_limit, cpu_limit=cpu_limit,
@ -299,7 +305,16 @@ def fix_diff(
{ {
"score": diff_output.score, "score": diff_output.score,
"fileName": "stdout", "fileName": "stdout",
"answerPath": f"/home/tt/.config/joj/{task_conf.task.type_}/{stdout}", "answerPath": (
(task_conf.root / task_conf.path)
.parent.joinpath(stdout)
.name
if (
task_conf.root is not None
and task_conf.path is not None
)
else f"/home/tt/.config/joj/{task_conf.task.type_}/{stdout}"
),
"forceQuitOnDiff": diff_output.forcequit, "forceQuitOnDiff": diff_output.forcequit,
"alwaysHide": diff_output.hide, "alwaysHide": diff_output.hide,
"compareSpace": not diff_output.ignorespaces, "compareSpace": not diff_output.ignorespaces,