|
|
|
@ -1,3 +1,26 @@
|
|
|
|
|
<% |
|
|
|
|
// Sanitize judge results for backward compatibility and clarity |
|
|
|
|
if (!judge.result.subtasks) { |
|
|
|
|
judge.result.subtasks = [ |
|
|
|
|
{ case_num: judge.result.case_num, status: judge.result.status, score: judge.result.score } |
|
|
|
|
]; |
|
|
|
|
for (let i = 0; i < judge.result.case_num; ++i) { |
|
|
|
|
judge.result.subtasks[0][i] = judge.result[i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let runningFound = false; |
|
|
|
|
for (let s of judge.result.subtasks) { |
|
|
|
|
s.pending = (s.status === 'Waiting' || s.status.startsWith('Running')); |
|
|
|
|
for (let i = 0; i < s.case_num; ++i) if (!s[i]) { |
|
|
|
|
s[i] = { |
|
|
|
|
pending: true, |
|
|
|
|
status: runningFound ? 'Waiting' : 'Running' |
|
|
|
|
}; |
|
|
|
|
runningFound = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
%> |
|
|
|
|
|
|
|
|
|
<div class="padding"> |
|
|
|
|
<table class="ui very basic center aligned table" id="status_table"> |
|
|
|
|
<thead> |
|
|
|
@ -58,52 +81,59 @@
|
|
|
|
|
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%- judge.result.compiler_output %></code></pre></div> |
|
|
|
|
<% } else if (judge.allowedSeeResult) { %> |
|
|
|
|
<div class="ui styled fluid accordion" id="testcases_list"> |
|
|
|
|
<% 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; "<% } %>> |
|
|
|
|
<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> |
|
|
|
|
<%= testcase.status %></div> |
|
|
|
|
<% if (!pending) { %> |
|
|
|
|
<% if (!testcase.score) testcase.score = testcase.status === 'Accepted' ? 100 : 0; %> |
|
|
|
|
<div class="three wide column">得分:<span style="font-weight: normal; "><%= parseFloat((testcase.score / judge.result.case_num).toFixed(2)).toString() %></span></div> |
|
|
|
|
<div class="three wide column">用时:<span style="font-weight: normal; "><%= testcase.time_used %> ms</span></div> |
|
|
|
|
<div class="three wide column">内存:<span style="font-weight: normal; "><%= testcase.memory_used %> KiB</span></div> |
|
|
|
|
<% let subtask_count = 0; %> |
|
|
|
|
<% for (let subtask_cases of (judge.result.subtasks || [])) { %> |
|
|
|
|
<% if (judge.result.subtasks.length !== 1) { %> |
|
|
|
|
<div class="title"> |
|
|
|
|
<div class="ui grid"> |
|
|
|
|
<div class="three wide column"><i class="dropdown icon"></i>子任务 #<%= ++subtask_count %></div> |
|
|
|
|
<div class="four wide column status status_detail <%= getStatusMeta(subtask_cases.status).toLowerCase().split(' ').join('_') %>"> |
|
|
|
|
<i class="<%= icon[getStatusMeta(subtask_cases.status)] || 'remove' %> icon"></i> |
|
|
|
|
<%= subtask_cases.status %></div> |
|
|
|
|
<% if (!subtask_cases.pending) { %> |
|
|
|
|
<div class="three wide column">得分:<span style="font-weight: normal; "><%= parseFloat(subtask_cases.score.toFixed(2)).toString() %></span></div> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="content"> |
|
|
|
|
<div class="accordion" id="testcases_list_subtask<%= subtask_count %>"> |
|
|
|
|
<% } %> |
|
|
|
|
<% for (let i = 0; i < subtask_cases.case_num; i++) { %> |
|
|
|
|
<% let testcase = subtask_cases[i]; %> |
|
|
|
|
<div class="title<% if (testcase.pending) { %> testcase.pending<% } %>"<% if (testcase.pending) { %> style="cursor: auto; "<% } %>> |
|
|
|
|
<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> |
|
|
|
|
<%= testcase.status %></div> |
|
|
|
|
<% if (!testcase.pending) { %> |
|
|
|
|
<% if (!testcase.score) testcase.score = testcase.status === 'Accepted' ? 100 : 0; %> |
|
|
|
|
<div class="three wide column">得分:<span style="font-weight: normal; "><%= parseFloat(testcase.score.toFixed(2)).toString() %></span></div> |
|
|
|
|
<div class="three wide column">用时:<span style="font-weight: normal; "><%= testcase.time_used %> ms</span></div> |
|
|
|
|
<div class="three wide column">内存:<span style="font-weight: normal; "><%= testcase.memory_used %> KiB</span></div> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="content"> |
|
|
|
|
<% if (!testcase.pending) { %> |
|
|
|
|
<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> |
|
|
|
|
<% if (testcase.spj_message) { %> |
|
|
|
|
<strong>Special Judge 信息</strong> |
|
|
|
|
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%= testcase.spj_message %></code></pre></div> |
|
|
|
|
<% } %> |
|
|
|
|
</p> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="content"> |
|
|
|
|
<% if (!pending) { %> |
|
|
|
|
<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> |
|
|
|
|
<% if (testcase.spj_message) { %> |
|
|
|
|
<strong>Special Judge 信息</strong> |
|
|
|
|
<div class="ui existing segment"><pre style="margin-top: 0; margin-bottom: 0; "><code><%= testcase.spj_message %></code></pre></div> |
|
|
|
|
<% } %> |
|
|
|
|
</p> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
<% if (judge.result.subtasks.length !== 1) { %> |
|
|
|
|
</div></div> |
|
|
|
|
<% } %> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
<% } %> |
|
|
|
@ -146,6 +176,6 @@ function update_judge_detail() {
|
|
|
|
|
}); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
update_judge_detail(); |
|
|
|
|
//update_judge_detail(); |
|
|
|
|
<% } %> |
|
|
|
|
</script> |
|
|
|
|