You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
5.5 KiB
134 lines
5.5 KiB
8 years ago
|
<% this.title = '上传测试数据'; %>
|
||
8 years ago
|
<% include header %>
|
||
8 years ago
|
<div class="padding">
|
||
8 years ago
|
<div class="ui grid">
|
||
8 years ago
|
<div class="row">
|
||
|
<div class="seven wide column">
|
||
8 years ago
|
<% if (problem.testdata) { %>
|
||
|
<p>数据包:<%= problem.testdata.filename %></p>
|
||
8 years ago
|
<%
|
||
|
try {
|
||
|
let list = syzoj.utils.parseTestData(problem.testdata.getPath());
|
||
|
%>
|
||
8 years ago
|
<% if (list.spj) { %>
|
||
|
<p>评测方式:Special Judge</p>
|
||
|
<% } else { %>
|
||
|
<p>评测方式:文本比较</p>
|
||
|
<% } %>
|
||
8 years ago
|
<table class="ui very basic table">
|
||
|
<thead>
|
||
8 years ago
|
<tr>
|
||
|
<th>输入文件</th>
|
||
|
<th>输出文件</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
8 years ago
|
<% for (let subtask of list) { %>
|
||
|
<% if (list.length !== 1) { %>
|
||
8 years ago
|
<tr>
|
||
8 years ago
|
<td colspan='2'><strong>→ 子任务评分方式:<%= subtask.type %>,分值:<%= subtask.score %></strong></td>
|
||
8 years ago
|
</tr>
|
||
8 years ago
|
<% } %>
|
||
|
<% for (let testcase of subtask.cases) { %>
|
||
|
<tr>
|
||
|
<td><%= testcase.input %></td>
|
||
|
<td><%= testcase.output %></td>
|
||
|
</tr>
|
||
|
<% } %>
|
||
8 years ago
|
<% } %>
|
||
|
</tbody>
|
||
8 years ago
|
</table>
|
||
8 years ago
|
<% } catch (e) { %>
|
||
|
<h3>数据包错误:<%= e %></h3>
|
||
|
<% } %>
|
||
8 years ago
|
<% } else { %>
|
||
|
<h3>数据未上传</h3>
|
||
|
<% } %>
|
||
|
</div>
|
||
8 years ago
|
<div class="nine wide column">
|
||
8 years ago
|
<form class="ui form" method="post" enctype="multipart/form-data">
|
||
8 years ago
|
<div class="two fields">
|
||
|
<div class="field">
|
||
|
<label for="doc-ds-ipt-1">时间限制(单位: ms)</label>
|
||
|
<input type="number" name="time_limit" value="<%= problem.time_limit %>">
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<label for="doc-ds-ipt-1">内存限制(单位: MiB)</label>
|
||
|
<input type="number" name="memory_limit" value="<%= problem.memory_limit %>">
|
||
|
</div>
|
||
|
</div>
|
||
8 years ago
|
<% if (!problem.file_io) { %>
|
||
|
<div class="inline fields">
|
||
|
<label>IO 方式</label>
|
||
|
<div class="field">
|
||
|
<div class="ui radio checkbox">
|
||
|
<input name="io_method" value="std-io" id="std-io" type="radio" onclick="goDisable()" checked>
|
||
|
<label for="std-io">标准 IO</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<div class="ui radio checkbox">
|
||
|
<input name="io_method" value="file-io" id="file-io" type="radio" onclick="goEnable()">
|
||
|
<label for="file-io">文件 IO</label>
|
||
|
</div>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
</div>
|
||
|
<div class="two fields">
|
||
|
<div class="field">
|
||
|
<label for="file_io_input_name">输入文件名</label>
|
||
|
<input type="text" id="file-io-input-name" name="file_io_input_name" value="<%= problem.file_io_input_name %>" disabled>
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<label for="file_io_output_name">输出文件名</label>
|
||
|
<input type="text" id="file-io-output-name" name="file_io_output_name" value="<%= problem.file_io_output_name %>" disabled>
|
||
|
</div>
|
||
|
</div>
|
||
|
<% } else { %>
|
||
|
<div class="inline fields">
|
||
|
<label>IO 方式</label>
|
||
|
<div class="field">
|
||
|
<div class="ui radio checkbox">
|
||
|
<input name="io_method" value="std-io" id="std-io" type="radio" onclick="goDisable()">
|
||
|
<label for="std-io">标准 IO</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<div class="ui radio checkbox">
|
||
|
<input name="io_method" value="file-io" id="file-io" type="radio" onclick="goEnable()" checked>
|
||
|
<label for="file-io">文件 IO</label>
|
||
|
</div>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
</div>
|
||
|
<div class="two fields">
|
||
|
<div class="field">
|
||
|
<label for="file_io_input_name">输入文件名</label>
|
||
|
<input type="text" id="file-io-input-name" name="file_io_input_name" value="<%= problem.file_io_input_name %>">
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<label for="file_io_output_name">输出文件名</label>
|
||
|
<input type="text" id="file-io-output-name" name="file_io_output_name" value="<%= problem.file_io_output_name %>">
|
||
|
</div>
|
||
|
</div>
|
||
|
<% } %>
|
||
|
<div class="field">
|
||
8 years ago
|
<label for="testdata">测试数据</label>
|
||
|
<input type="file" id="testdata" name="testdata">
|
||
8 years ago
|
</div>
|
||
8 years ago
|
<button type="submit" class="ui button">提交</button>
|
||
|
<a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>" class="ui blue button">返回题目</a>
|
||
8 years ago
|
</form>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
</div>
|
||
|
<div>
|
||
8 years ago
|
<script>
|
||
8 years ago
|
function goEnable() {
|
||
|
document.getElementById('file-io-input-name').disabled = false;
|
||
|
document.getElementById('file-io-output-name').disabled = false;
|
||
|
}
|
||
|
function goDisable() {
|
||
|
document.getElementById('file-io-input-name').disabled = true;
|
||
|
document.getElementById('file-io-output-name').disabled = true;
|
||
|
}
|
||
8 years ago
|
</script>
|
||
|
<% include footer %>
|