|
|
@ -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"> |
|
|
|
<div class="padding"> |
|
|
|
<table class="ui very basic center aligned table" id="status_table"> |
|
|
|
<table class="ui very basic center aligned table" id="status_table"> |
|
|
|
<thead> |
|
|
|
<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> |
|
|
|
<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) { %> |
|
|
|
<% } else if (judge.allowedSeeResult) { %> |
|
|
|
<div class="ui styled fluid accordion" id="testcases_list"> |
|
|
|
<div class="ui styled fluid accordion" id="testcases_list"> |
|
|
|
<% for (let i = 0; i < judge.result.case_num; i++) { %> |
|
|
|
<% let subtask_count = 0; %> |
|
|
|
<% |
|
|
|
<% for (let subtask_cases of (judge.result.subtasks || [])) { %> |
|
|
|
let testcase = judge.result[i], pending = false; |
|
|
|
<% if (judge.result.subtasks.length !== 1) { %> |
|
|
|
if (!testcase) { |
|
|
|
<div class="title"> |
|
|
|
pending = true; |
|
|
|
<div class="ui grid"> |
|
|
|
if (i == 0 || judge.result[i - 1]) { |
|
|
|
<div class="three wide column"><i class="dropdown icon"></i>子任务 #<%= ++subtask_count %></div> |
|
|
|
testcase = { |
|
|
|
<div class="four wide column status status_detail <%= getStatusMeta(subtask_cases.status).toLowerCase().split(' ').join('_') %>"> |
|
|
|
status: 'Running' |
|
|
|
<i class="<%= icon[getStatusMeta(subtask_cases.status)] || 'remove' %> icon"></i> |
|
|
|
}; |
|
|
|
<%= subtask_cases.status %></div> |
|
|
|
} else { |
|
|
|
<% if (!subtask_cases.pending) { %> |
|
|
|
testcase = { |
|
|
|
<div class="three wide column">得分:<span style="font-weight: normal; "><%= parseFloat(subtask_cases.score.toFixed(2)).toString() %></span></div> |
|
|
|
status: 'Waiting' |
|
|
|
<% } %> |
|
|
|
}; |
|
|
|
</div> |
|
|
|
} |
|
|
|
</div> |
|
|
|
} |
|
|
|
<div class="content"> |
|
|
|
%> |
|
|
|
<div class="accordion" id="testcases_list_subtask<%= subtask_count %>"> |
|
|
|
<div class="title<% if (pending) { %> pending<% } %>"<% if (pending) { %> style="cursor: auto; "<% } %>> |
|
|
|
<% } %> |
|
|
|
<div class="ui grid"> |
|
|
|
<% for (let i = 0; i < subtask_cases.case_num; i++) { %> |
|
|
|
<div class="three wide column"><i class="dropdown icon"></i>测试点 #<%= i + 1 %></div> |
|
|
|
<% let testcase = subtask_cases[i]; %> |
|
|
|
<div class="four wide column status status_detail <%= getStatusMeta(testcase.status).toLowerCase().split(' ').join('_') %>"> |
|
|
|
<div class="title<% if (testcase.pending) { %> testcase.pending<% } %>"<% if (testcase.pending) { %> style="cursor: auto; "<% } %>> |
|
|
|
<i class="<%= icon[getStatusMeta(testcase.status)] || 'remove' %> icon"></i> |
|
|
|
<div class="ui grid"> |
|
|
|
<%= testcase.status %></div> |
|
|
|
<div class="three wide column"><i class="dropdown icon"></i>测试点 #<%= i + 1 %></div> |
|
|
|
<% if (!pending) { %> |
|
|
|
<div class="four wide column status status_detail <%= getStatusMeta(testcase.status).toLowerCase().split(' ').join('_') %>"> |
|
|
|
<% if (!testcase.score) testcase.score = testcase.status === 'Accepted' ? 100 : 0; %> |
|
|
|
<i class="<%= icon[getStatusMeta(testcase.status)] || 'remove' %> icon"></i> |
|
|
|
<div class="three wide column">得分:<span style="font-weight: normal; "><%= parseFloat((testcase.score / judge.result.case_num).toFixed(2)).toString() %></span></div> |
|
|
|
<%= testcase.status %></div> |
|
|
|
<div class="three wide column">用时:<span style="font-weight: normal; "><%= testcase.time_used %> ms</span></div> |
|
|
|
<% if (!testcase.pending) { %> |
|
|
|
<div class="three wide column">内存:<span style="font-weight: normal; "><%= testcase.memory_used %> KiB</span></div> |
|
|
|
<% 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> |
|
|
|
|
|
|
|
<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> |
|
|
|
</div> |
|
|
|
<% } %> |
|
|
|
<% } %> |
|
|
@ -146,6 +176,6 @@ function update_judge_detail() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, 500); |
|
|
|
}, 500); |
|
|
|
} |
|
|
|
} |
|
|
|
update_judge_detail(); |
|
|
|
//update_judge_detail(); |
|
|
|
<% } %> |
|
|
|
<% } %> |
|
|
|
</script> |
|
|
|
</script> |
|
|
|