Browse Source

Fix submit after contest

pull/6/head
Menci 8 years ago
parent
commit
6da6c43a53
  1. 1
      modules/problem.js

1
modules/problem.js

@ -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('无此题目。');

Loading…
Cancel
Save