From de2fe7c2aa700403e052e13ed6de9e77e34076fc Mon Sep 17 00:00:00 2001 From: Menci Date: Sun, 19 Mar 2017 22:02:03 +0800 Subject: [PATCH] Add spj compile message --- modules/submission.js | 2 -- views/submission_content.ejs | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/submission.js b/modules/submission.js index 3779c98..14dfb20 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -88,7 +88,6 @@ app.get('/submission/:id', async (req, res) => { judge.codeLength = judge.code.length; judge.code = await syzoj.utils.highlight(judge.code, syzoj.config.languages[judge.language].highlight); - if (judge.result.compiler_output) judge.result.compiler_output = syzoj.utils.ansiToHTML(judge.result.compiler_output); judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); judge.allowedSeeCode = await judge.isAllowedSeeCodeBy(res.locals.user); judge.allowedRejudge = await judge.problem.isAllowedEditBy(res.locals.user); @@ -123,7 +122,6 @@ app.get('/submission/:id/ajax', async (req, res) => { judge.codeLength = judge.code.length; judge.code = await syzoj.utils.highlight(judge.code, syzoj.config.languages[judge.language].highlight); - if (judge.result.compiler_output) judge.result.compiler_output = syzoj.utils.ansiToHTML(judge.result.compiler_output); judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); judge.allowedSeeCode = await judge.isAllowedSeeCodeBy(res.locals.user); judge.allowedRejudge = await judge.problem.isAllowedEditBy(res.locals.user); diff --git a/views/submission_content.ejs b/views/submission_content.ejs index 6ca08f3..2350959 100644 --- a/views/submission_content.ejs +++ b/views/submission_content.ejs @@ -90,7 +90,10 @@ else problemUrl = syzoj.utils.makeUrl(['problem', judge.problem_id]); <% } %> <% if (judge.result.compiler_output && judge.result.status === 'Compile Error' && judge.allowedSeeCode) { %>

编译信息

-
<%- judge.result.compiler_output %>
+
<%- syzoj.utils.ansiToHTML(judge.result.compiler_output) %>
+<% } else if (judge.result.spj_compiler_output) { %> +

Special Judge 编译信息

+
<%- syzoj.utils.ansiToHTML(judge.result.spj_compiler_output) %>
<% } else if (judge.allowedSeeResult) { %>
<% let subtask_count = 0; %>