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 %> -