mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix hack data add to testdata
This commit is contained in:
1 parent
e0929476d5
commit
bdc0b21e88
4 files changed
+4
-3
No files matched your search
@@ -85,7 +85,7 @@ export async function postJudge(rdoc: RecordDoc) {
|
|||||||
try {
|
try {
|
||||||
const config = yaml.load(pdoc.config as string) as ProblemConfigFile;
|
const config = yaml.load(pdoc.config as string) as ProblemConfigFile;
|
||||||
assert(config.subtasks instanceof Array);
|
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);
|
assert(file);
|
||||||
const hackSubtask = config.subtasks[config.subtasks.length - 1];
|
const hackSubtask = config.subtasks[config.subtasks.length - 1];
|
||||||
hackSubtask.cases ||= [];
|
hackSubtask.cases ||= [];
|
||||||
|
|||||||
@@ -564,6 +564,7 @@ export class ProblemHackHandler extends ProblemDetailHandler {
|
|||||||
this.response.body = {
|
this.response.body = {
|
||||||
pdoc: this.pdoc,
|
pdoc: this.pdoc,
|
||||||
udoc: this.udoc,
|
udoc: this.udoc,
|
||||||
|
rid: this.rdoc._id,
|
||||||
title: this.pdoc.title,
|
title: this.pdoc.title,
|
||||||
page_name: this.tdoc ? 'contest_detail_problem_hack' : 'problem_hack',
|
page_name: this.tdoc ? 'contest_detail_problem_hack' : 'problem_hack',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="medium-9 columns">
|
<div class="medium-9 columns">
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="section__header">
|
<div class="section__header">
|
||||||
<h1 class="section__title">{{ _('Hack a submission') }}</h1>
|
<h1 class="section__title">{{ _('Hack submission') }} #{{ rid }}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="section__body">
|
<div class="section__body">
|
||||||
<form method="post" enctype="multipart/form-data">
|
<form method="post" enctype="multipart/form-data">
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<ol class="menu">
|
<ol class="menu">
|
||||||
<li class="menu__item">
|
<li class="menu__item">
|
||||||
<a class="menu__link" href="{{ url('problem_hack', pid=pdoc.pid|default(pdoc.docId), rid=rdoc._id) }}">
|
<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>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|||||||
Reference in new issue
Block a user