diff --git a/modules/judge.js b/modules/judge.js index 8509d03..b33d28b 100644 --- a/modules/judge.js +++ b/modules/judge.js @@ -75,6 +75,7 @@ app.get('/judge_detail/:id', async (req, res) => { let id = parseInt(req.params.id); let judge = await JudgeState.fromID(id); + judge.codeLength = judge.code.length; judge.code = await syzoj.utils.highlight(judge.code, syzoj.config.languages[judge.language].highlight); if (judge.result.compiler_output) judge.result.compiler_output = syzoj.utils.ansiToHTML(judge.result.compiler_output); judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); @@ -96,6 +97,7 @@ app.get('/judge_detail/:id/ajax', async (req, res) => { let id = parseInt(req.params.id); let judge = await JudgeState.fromID(id); + judge.codeLength = judge.code.length; judge.code = await syzoj.utils.highlight(judge.code, syzoj.config.languages[judge.language].highlight); if (judge.result.compiler_output) judge.result.compiler_output = syzoj.utils.ansiToHTML(judge.result.compiler_output); judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); diff --git a/views/judge_detail_item.ejs b/views/judge_detail_item.ejs index 447e868..650cb7d 100644 --- a/views/judge_detail_item.ejs +++ b/views/judge_detail_item.ejs @@ -25,7 +25,7 @@