diff --git a/modules/api.js b/modules/api.js index 7ae5bdc..77bca5f 100644 --- a/modules/api.js +++ b/modules/api.js @@ -132,7 +132,7 @@ app.get('/api/waiting_judge', async (req, res) => { judge_id: judge_state.id, code: judge_state.code, language: judge_state.language, - testdata: judge_state.problem.testdata.md5, + testdata: judge_state.problem.testdata ? judge_state.problem.testdata.md5 : '', time_limit: judge_state.problem.time_limit, memory_limit: judge_state.problem.memory_limit, file_io: judge_state.problem.file_io, diff --git a/static/style.css b/static/style.css index 72fd771..99da201 100644 --- a/static/style.css +++ b/static/style.css @@ -47,26 +47,46 @@ th { :not(.status_detail).status.runtime_error, .title:hover .status_detail.status.runtime_error, -.title.active .status_detail.status.runtime_error { +.title.active .status_detail.status.runtime_error, +:not(.status_detail).status.file_error, +.title:hover .status_detail.status.file_error, +.title.active .status_detail.status.file_error { color: darkorchid; } -:not(.status_detail).status.memory_limit_exceed, -.title:hover .status_detail.status.memory_limit_exceed, -.title.active .status_detail.status.memory_limit_exceed, -:not(.status_detail).status.time_limit_exceed, -.title:hover .status_detail.status.time_limit_exceed, -.title.active .status_detail.status.time_limit_exceed, -:not(.status_detail).status.output_limit_exceed, -.title:hover .status_detail.status.output_limit_exceed, -.title.active .status_detail.status.output_limit_exceed { +:not(.status_detail).status.memory_limit_exceeded, +.title:hover .status_detail.status.memory_limit_exceeded, +.title.active .status_detail.status.memory_limit_exceeded, +:not(.status_detail).status.time_limit_exceeded, +.title:hover .status_detail.status.time_limit_exceeded, +.title.active .status_detail.status.time_limit_exceeded, +:not(.status_detail).status.output_limit_exceeded, +.title:hover .status_detail.status.output_limit_exceeded, +.title.active .status_detail.status.output_limit_exceeded { color: sandybrown; } -:not(.status_detail).status.waiting, :not(.status_detail).status.system_error { +:not(.status_detail).status.waiting, +.title:hover .status_detail.status.waiting, +.title.active .status_detail.status.waiting, +:not(.status_detail).status.system_error { color: grey; } +:not(.status_detail).status.running, +.title:hover .status_detail.status.running, +.title.active .status_detail.status.running { + color: #6cf; +} + +:not(.status_detail).status.compiling { + color: #00b5ad; +} + +:not(.status_detail).status.no_testdata { + color: brown; +} + :not(.status_detail).status.compile_error { color: rgb(0, 68, 136); } diff --git a/views/header.ejs b/views/header.ejs index aae1cdf..24f06b2 100644 --- a/views/header.ejs +++ b/views/header.ejs @@ -1,3 +1,25 @@ +<% +this.getStatusMeta = (status) => { + if (status.startsWith('Running')) return 'Running'; + else return status; +} + +this.icon = { + 'Accepted': 'checkmark', + 'Wrong Answer': 'remove', + 'Runtime Error': 'bomb', + 'Time Limit Exceeded': 'clock', + 'Memory Limit Exceeded': 'disk outline', + 'Output Limit Exceeded': 'print', + 'File Error': 'file outline', + 'Waiting': 'hourglass half', + 'Running': 'spinner', + 'Compiling': 'spinner', + 'Compile Error': 'code', + 'System Error': 'server', + 'No Testdata': 'folder open outline' +} +%> diff --git a/views/judge_detail.ejs b/views/judge_detail.ejs index 7e22727..f26d57d 100644 --- a/views/judge_detail.ejs +++ b/views/judge_detail.ejs @@ -18,21 +18,8 @@ #<%= judge.id %> #<%= judge.problem_id %>. <%= judge.problem.title %> <% if (judge.allowedSeeResult) { %> - - <% - let icon = { - 'Accepted': 'checkmark', - 'Wrong Answer': 'remove', - 'Runtime Error': 'bomb', - 'Time Limit Exceed': 'clock', - 'Memory Limit Exceed': 'disk outline', - 'Output Limit Exceed': 'expand', - 'Waiting': 'spinner', - 'Compile Error': 'code', - 'System Error': 'server' - } - %> - + + <%= judge.result.status %> <%= judge.result.score %> @@ -56,30 +43,34 @@ <% } else if (judge.allowedSeeResult) { %>
<% for (let i = 0; i < judge.result.case_num; i++) { %> - <% let testcase = judge.result[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' + }; + } + } + %> +
style="cursor: auto; "<% } %>>
测试点 #<%= i + 1 %>
-
- <% - let icon = { - 'Accepted': 'checkmark', - 'Wrong Answer': 'remove', - 'Runtime Error': 'bomb', - 'Time Limit Exceed': 'clock', - 'Memory Limit Exceed': 'disk outline', - 'Output Limit Exceed': 'expand', - 'Waiting': 'spinner', - 'Compile Error': 'code', - 'System Error': 'server' - } - %> - +
+ <%= testcase.status %>
-
用时:<%= testcase.time_used %> ms
-
内存:<%= testcase.memory_used %> KiB
+ <% if (!pending) { %> +
用时:<%= testcase.time_used %> ms
+
内存:<%= testcase.memory_used %> KiB
+ <% } %>
+ <% if (!pending) { %>

输入文件 @@ -91,12 +82,17 @@

<% } %> + <% } %>
<% } %> <% include footer %> diff --git a/views/judge_state.ejs b/views/judge_state.ejs index 9d93ded..8d2e5af 100644 --- a/views/judge_state.ejs +++ b/views/judge_state.ejs @@ -35,21 +35,8 @@ #<%= judge.problem_id %>. <%= judge.problem.title %> <% if (!judge.hidden) { %> - - <% - let icon = { - 'Accepted': 'checkmark', - 'Wrong Answer': 'remove', - 'Runtime Error': 'bomb', - 'Time Limit Exceed': 'clock', - 'Memory Limit Exceed': 'disk outline', - 'Output Limit Exceed': 'expand', - 'Waiting': 'spinner', - 'Compile Error': 'code', - 'System Error': 'server' - } - %> - + + <%= judge.status %> diff --git a/views/problem_set.ejs b/views/problem_set.ejs index 1b0a4f5..e622c72 100644 --- a/views/problem_set.ejs +++ b/views/problem_set.ejs @@ -28,19 +28,6 @@ <% if (user) { %> <% if (problem.judge_state) { %> - <% - let icon = { - 'Accepted': 'checkmark', - 'Wrong Answer': 'remove', - 'Runtime Error': 'bomb', - 'Time Limit Exceed': 'clock', - 'Memory Limit Exceed': 'disk outline', - 'Output Limit Exceed': 'expand', - 'Waiting': 'spinner', - 'Compile Error': 'code', - 'System Error': 'server' - } - %>