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

99 lines
3.8 KiB

<% this.title = '评测详细信息' %>
8 years ago
<% include header %>
<div class="padding">
<table class="ui very basic center aligned table">
<thead>
<tr>
<th>编号</th>
<th>题目名称</th>
<th>状态</th>
<th>分数</th>
<th>总时间</th>
<th>提交者</th>
<th>提交时间</th>
</tr>
</thead>
<tbody>
<tr>
8 years ago
<td>#<%= judge.id %></td>
<td><a href="<%= syzoj.utils.makeUrl(['problem', judge.problem_id]) %>">#<%= judge.problem_id %>. <%= judge.problem.title %></a></td>
8 years ago
<% if (judge.allowedSeeResult) { %>
<td class="status <%= getStatusMeta(judge.result.status).toLowerCase().split(' ').join('_') %>">
<i class="<%= icon[getStatusMeta(judge.status)] || 'remove' %> icon"></i>
<%= judge.result.status %>
</td>
8 years ago
<td class="score score_<%= parseInt(judge.result.score / 10) || 0 %>"><%= judge.result.score %></td>
<td><%= judge.result.total_time %></td>
8 years ago
<% } else { %>
<td>隐藏</td>
<td>隐藏</td>
<td>隐藏</td>
<% } %>
<td><a href="<%= syzoj.utils.makeUrl(['user', judge.user_id]) %>"><%= judge.user.username %></a><% if (judge.user.nameplate) { %><%- judge.user.nameplate %><% } %></td>
<td><%= syzoj.utils.formatDate(judge.submit_time) %></td>
</tr>
</tbody>
</table>
8 years ago
<% if (judge.allowedSeeCode) { %>
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%- judge.code %></code></pre></div>
8 years ago
<% } %>
<% if (judge.result.compiler_output && judge.result.status === 'Compile Error' && judge.allowedSeeCode) { %>
<h3 class="ui header">编译信息</h3>
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%- judge.result.compiler_output %></code></pre></div>
8 years ago
<% } else if (judge.allowedSeeResult) { %>
<div class="ui styled fluid accordion">
<% for (let i = 0; i < judge.result.case_num; i++) { %>
<%
let testcase = judge.result[i], pending = false;
if (!testcase) {
pending = true;
if (i == 0 || judge.result[i - 1]) {
testcase = {
status: 'Running'
};
} else {
testcase = {
status: 'Waiting'
};
}
}
%>
<div class="title<% if (pending) { %> pending<% } %>"<% if (pending) { %> style="cursor: auto; "<% } %>>
8 years ago
<div class="ui grid">
<div class="three wide column"><i class="dropdown icon"></i>测试点 #<%= i + 1 %></div>
<div class="four wide column status status_detail <%= getStatusMeta(testcase.status).toLowerCase().split(' ').join('_') %>">
<i class="<%= icon[getStatusMeta(testcase.status)] || 'remove' %> icon"></i>
8 years ago
<%= testcase.status %></div>
<% if (!pending) { %>
<div class="four wide column">用时:<span style="font-weight: normal; "><%= testcase.time_used %> ms</span></div>
<div class="four wide column">内存:<span style="font-weight: normal; "><%= testcase.memory_used %> KiB</span></div>
<% } %>
8 years ago
</div>
</div>
<% if (!pending) { %>
<div class="content">
<p>
<strong>输入文件</strong>
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%= testcase.input %></code></pre></div>
<strong>期望输出</strong>
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%= testcase.answer %></code></pre></div>
<strong>你的输出</strong>
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%= testcase.user_out %></code></pre></div>
</p>
</div>
<% } %>
<% } %>
8 years ago
</div>
<% } %>
8 years ago
<script>
$(function() {
$('.ui.accordion').accordion({
selector: {
trigger: '.title:not(.pending)'
}
});
});
8 years ago
</script>
<% include footer %>