算法评测平台前端。
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.

53 lines
2.0 KiB

<%
let subtaskType = {
sum: '测试点分数按百分比相加',
min: '取各测试点最低分',
mul: '测试点分数按百分比相乘'
};
%>
<% if (testcases && testcases.error) { %>
<h4>数据包错误:<%= testcases.error %></h4>
<%
} else if (testcases) {
%>
<% if (testcases.spj) { %>
<p>评测方式:Special Judge</p>
<% } else if (problem.type === 'interaction') { %>
<p>评测方式:交互</p>
<% } else { %>
<p>评测方式:文本比较</p>
<% } %>
<table class="ui celled table">
<tbody>
<% let i = 0; %>
<% for (let subtask of testcases) { %>
<% if (testcases.length !== 1) { %>
<tr>
8 years ago
<td style="background-color: #F9FAFB" colspan="<%= problem.type === 'submit-answer' ? 3 : 2 %>"><h4 style="margin-bottom: 3px; ">子任务 <%= ++i %></h4><span style="font-weight: normal; "><%= subtaskType[subtask.type] %>,总分值 <%= subtask.score %></span></th>
</tr>
<% } else { %>
<tr>
8 years ago
<td style="background-color: #F9FAFB" colspan="<%= problem.type === 'submit-answer' ? 3 : 2 %>"><h4 style="margin-bottom: 3px; ">单个子任务</h4><span style="font-weight: normal; "><%= subtaskType[subtask.type] %></span></th>
</tr>
<% } %>
<% for (let testcase of subtask.cases) { %>
8 years ago
<% if (problem.type === 'submit-answer') { %>
<tr class="center aligned">
<td style="width: 33%; "><%= testcase.input || '-' %></td>
<td style="width: 33%; "><%= testcase.output || '-' %></td>
<td style="width: 33%; "><%= testcase.answer || '-' %></td>
8 years ago
</tr>
<% } else { %>
<tr class="center aligned">
<td style="width: 50%; "><%= testcase.input || '-' %></td>
<td style="width: 50%; "><%= testcase.output || '-' %></td>
8 years ago
</tr>
<% } %>
<% } %>
<% } %>
</tbody>
</table>
<% } else { %>
<h4 style="text-align: center; ">无测试数据</h4>
8 years ago
<% } %>