From 3dbd29135a858f51acd1beeebec4ea1f0ff13d44 Mon Sep 17 00:00:00 2001 From: Menci Date: Sat, 3 Dec 2016 17:38:05 +0800 Subject: [PATCH] Redirect to contest page after submit from contest --- modules/problem.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/problem.js b/modules/problem.js index 00ed540..bdfc251 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -241,7 +241,11 @@ app.post('/submit/:id', async (req, res) => { await waiting_judge.save(); - res.redirect(syzoj.utils.makeUrl(['judge_detail', judge_state.id])); + if (contest_id) { + res.redirect(syzoj.utils.makeUrl(['contest', contest_id])); + } else { + res.redirect(syzoj.utils.makeUrl(['judge_detail', judge_state.id])); + } } catch (e) { syzoj.log(e); res.render('error', {