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',
};
@@ -5,7 +5,7 @@
<div class="medium-9 columns">
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Hack a submission') }}</h1>
<h1 class="section__title">{{ _('Hack submission') }} #{{ rid }}</h1>
</div>
<div class="section__body">
<form method="post" enctype="multipart/form-data">
@@ -53,7 +53,7 @@
<ol class="menu">
<li class="menu__item">
<a class="menu__link" href="{{ url('problem_hack', pid=pdoc.pid|default(pdoc.docId), rid=rdoc._id) }}">
<span class="icon icon-close"></span> {{ _('Hack') }}
<span class="icon icon-debug"></span> {{ _('Hack') }}
</a>
</li>
</ol>