From 08238a8a11b06d6f72c20ce4719d0ed32dd54fc5 Mon Sep 17 00:00:00 2001 From: Menci Date: Mon, 26 Jun 2017 14:09:32 +0800 Subject: [PATCH] Disable non-traditional problem type --- modules/problem.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/problem.js b/modules/problem.js index 4e46988..726a4bd 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -485,6 +485,10 @@ app.post('/problem/:id/manage', app.multer.fields([{ name: 'testdata', maxCount: problem.file_io_input_name = req.body.file_io_input_name; problem.file_io_output_name = req.body.file_io_output_name; + if (req.body.type !== 'traditional') { + throw new ErrorMessage('暂不支持该题目类型。'); + } + if (problem.type === 'submit-answer' && req.body.type !== 'submit-answer' || problem.type !== 'submit-answer' && req.body.type === 'submit-answer') { if (await JudgeState.count({ problem_id: id }) !== 0) { throw new ErrorMessage('已有提交的题目不允许在提交答案和非提交答案之间更改。');