Browse Source

bugfix: 修复不让所有人查看比赛提交细节的bug,修复因为比赛分值改变导致统计出现偏差的bug。

pull/28/head
zjz1993 5 years ago
parent
commit
96627e4b6f
  1. 4
      modules/contest.js

4
modules/contest.js

@ -207,7 +207,7 @@ app.get('/contest/:id', async (req, res) => {
for (let player of players) {
if (player.score_details[problem.problem.id]) {
problem.statistics.attempt++;
if ((contest.type === 'acm' && player.score_details[problem.problem.id].accepted) || ((contest.type === 'noi' || contest.type === 'ioi') && player.score_details[problem.problem.id].score === 100)) {
if ((contest.type === 'acm' && player.score_details[problem.problem.id].accepted) || ((contest.type === 'noi' || contest.type === 'ioi') && player.score_details[problem.problem.id].score >= 100)) {
problem.statistics.accepted++;
}
@ -458,12 +458,12 @@ app.get('/contest/submission/:id', async (req, res) => {
judge.problem_id = problems_id.indexOf(judge.problem_id) + 1;
judge.problem.title = syzoj.utils.removeTitleTag(judge.problem.title);
displayConfig.showUsage = true;
displayConfig.showResult=true;
displayConfig.showDetailResult=true;
if (judge.problem.type !== 'submit-answer') {
judge.codeLength = Buffer.from(judge.code).length;
judge.code = await syzoj.utils.highlight(judge.code, syzoj.languages[judge.language].highlight);
}
res.render('submission_contest', {
contest_id: contest.id,
info: getSubmissionInfo(judge, displayConfig),

Loading…
Cancel
Save