|
|
@ -75,7 +75,7 @@ app.get('/judge_detail/:id', async (req, res) => { |
|
|
|
let id = parseInt(req.params.id); |
|
|
|
let id = parseInt(req.params.id); |
|
|
|
let judge = await JudgeState.fromID(id); |
|
|
|
let judge = await JudgeState.fromID(id); |
|
|
|
|
|
|
|
|
|
|
|
judge.code = await syzoj.utils.highlight(judge.code, judge.language); |
|
|
|
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); |
|
|
|
if (judge.result.compiler_output) judge.result.compiler_output = syzoj.utils.ansiToHTML(judge.result.compiler_output); |
|
|
|
judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); |
|
|
|
judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); |
|
|
|
judge.allowedSeeCode = await judge.isAllowedSeeCodeBy(res.locals.user); |
|
|
|
judge.allowedSeeCode = await judge.isAllowedSeeCodeBy(res.locals.user); |
|
|
@ -96,7 +96,7 @@ app.get('/judge_detail/:id/ajax', async (req, res) => { |
|
|
|
let id = parseInt(req.params.id); |
|
|
|
let id = parseInt(req.params.id); |
|
|
|
let judge = await JudgeState.fromID(id); |
|
|
|
let judge = await JudgeState.fromID(id); |
|
|
|
|
|
|
|
|
|
|
|
judge.code = await syzoj.utils.highlight(judge.code, judge.language); |
|
|
|
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); |
|
|
|
if (judge.result.compiler_output) judge.result.compiler_output = syzoj.utils.ansiToHTML(judge.result.compiler_output); |
|
|
|
judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); |
|
|
|
judge.allowedSeeResult = await judge.isAllowedSeeResultBy(res.locals.user); |
|
|
|
judge.allowedSeeCode = await judge.isAllowedSeeCodeBy(res.locals.user); |
|
|
|
judge.allowedSeeCode = await judge.isAllowedSeeCodeBy(res.locals.user); |
|
|
|