From 9c05e0120095f53f23b97b0568a47e6d47cfaa40 Mon Sep 17 00:00:00 2001 From: hankeke303 Date: Mon, 13 May 2019 22:05:33 +0800 Subject: [PATCH] fix code unable to be submitted in contests --- modules/problem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/problem.js b/modules/problem.js index fd25b15..751b89f 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -637,7 +637,7 @@ app.post('/problem/:id/submit', app.multer.fields([{ name: 'answer', maxCount: 1 code_length: size, language: null, user_id: curUser.id, - problem_id: req.params.id, + problem_id: id, is_public: problem.is_public }); } else { @@ -658,7 +658,7 @@ app.post('/problem/:id/submit', app.multer.fields([{ name: 'answer', maxCount: 1 code_length: Buffer.from(code).length, language: req.body.language, user_id: curUser.id, - problem_id: req.params.id, + problem_id: id, is_public: problem.is_public }); }