From d6b5971d13503f3649dbcf639ed73e54f326aee4 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Fri, 2 Aug 2019 14:52:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9C=A8=E6=AF=94=E8=B5=9B=E6=B5=8B?= =?UTF-8?q?=E8=AF=84=E9=A1=B5=E9=9D=A2=E9=87=8C=E5=A2=9E=E5=8A=A0=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=AF=94=E8=B5=9B=E7=9A=84=E5=85=A5=E5=8F=A3=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E4=BF=AE=E6=94=B9=E8=B7=AF=E5=BE=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/contest.js | 3 +- modules/problem.js | 2 + views/submission_contest.ejs | 163 +++++++++++------------------------ 3 files changed, 56 insertions(+), 112 deletions(-) diff --git a/modules/contest.js b/modules/contest.js index 656c772..a9ea304 100644 --- a/modules/contest.js +++ b/modules/contest.js @@ -463,7 +463,8 @@ app.get('/contest/submission/:id', async (req, res) => { judge.code = await syzoj.utils.highlight(judge.code, syzoj.languages[judge.language].highlight); } - res.render('submission', { + res.render('submission_contest', { + contest_id: contest.id, info: getSubmissionInfo(judge, displayConfig), roughResult: getRoughResult(judge, displayConfig), code: (displayConfig.showCode && judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '', diff --git a/modules/problem.js b/modules/problem.js index 50903cb..9934b51 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -769,6 +769,8 @@ app.post('/problem/:id/submit', app.multer.fields([{ name: 'answer', maxCount: 1 if (contest && (!await contest.isSupervisior(curUser))) { res.redirect(syzoj.utils.makeUrl(['contest', contest_id, 'submissions'])); + } else if(contest) { + res.redirect(syzoj.utils.makeUrl(['contest','submission', judge_state.id])); } else { res.redirect(syzoj.utils.makeUrl(['submission', judge_state.id])); } diff --git a/views/submission_contest.ejs b/views/submission_contest.ejs index 79fcf77..ab367a6 100644 --- a/views/submission_contest.ejs +++ b/views/submission_contest.ejs @@ -3,40 +3,39 @@ <% include header %>
+ 返回比赛 + @@ -55,12 +54,9 @@
已分享 编号 题目 状态
-
<%= cid %>
-
<%= pid %>
-
<%= sid %>
- <% if (formattedCode !== null) { %> - + <% if (formattedCode !== null) { %> + @@ -68,7 +64,7 @@ 格式化代码 - <% } %> + <% } %> @@ -135,9 +131,9 @@ -<% include submissions_item %> + <% include submissions_item %> -