diff --git a/modules/contest.js b/modules/contest.js index dbc8151..a32add8 100644 --- a/modules/contest.js +++ b/modules/contest.js @@ -423,8 +423,10 @@ app.get('/contest/submission/:id', async (req, res) => { info: getSubmissionInfo(judge, displayConfig), roughResult: getRoughResult(judge, displayConfig), code: (displayConfig.showCode && judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '', + formattedCode: judge.formattedCode ? judge.formattedCode.toString("utf8") : null, + preferFormattedCode: res.locals.user ? res.locals.user.prefer_formatted_code : false, detailResult: processOverallResult(judge.result, displayConfig), - socketToken: (displayConfig.showDetailResult && judge.pending && x.task_id != null) ? jwt.sign({ + socketToken: (displayConfig.showDetailResult && judge.pending && judge.task_id != null) ? jwt.sign({ taskId: judge.task_id, displayConfig: displayConfig, type: 'detail'