core: fix hack data add to testdata

This commit is contained in:
panda authored and undefined committed 2022-09-06 13:02:46 +08:00
1 parent e0929476d5
commit bdc0b21e88
4 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -85,7 +85,7 @@ export async function postJudge(rdoc: RecordDoc) {
try {
const config = yaml.load(pdoc.config as string) as ProblemConfigFile;
assert(config.subtasks instanceof Array);
const file = await storage.get(`submission/${rdoc.files.hack}`);
const file = await storage.get(`submission/${rdoc.files.hack.split('#')[0]}`);
assert(file);
const hackSubtask = config.subtasks[config.subtasks.length - 1];
hackSubtask.cases ||= [];
+1
View File
@@ -564,6 +564,7 @@ export class ProblemHackHandler extends ProblemDetailHandler {
this.response.body = {
pdoc: this.pdoc,
udoc: this.udoc,
rid: this.rdoc._id,
title: this.pdoc.title,
page_name: this.tdoc ? 'contest_detail_problem_hack' : 'problem_hack',
};