|
|
|
@ -542,6 +542,7 @@ app.post('/problem/:id/submit', async (req, res) => {
|
|
|
|
|
if (contest_id) { |
|
|
|
|
let contest = await Contest.fromID(contest_id); |
|
|
|
|
if (!contest) throw new ErrorMessage('无此比赛。'); |
|
|
|
|
if (!await contest.isRunning()) throw new ErrorMessage('比赛未开始或已结束。'); |
|
|
|
|
let problems_id = await contest.getProblems(); |
|
|
|
|
if (!problems_id.includes(id)) throw new ErrorMessage('无此题目。'); |
|
|
|
|
|
|
|
|
|