Browse Source

Change default user & guest's preferFormattedCode to true

pull/6/head
Menci 6 years ago
parent
commit
a1caa0d305
  1. 3
      models/user.js
  2. 2
      modules/submission.js

3
models/user.js

@ -55,7 +55,8 @@ class User extends Model {
sex: 0,
is_show: syzoj.config.default.user.show,
rating: syzoj.config.default.user.rating,
register_time: parseInt((new Date()).getTime() / 1000)
register_time: parseInt((new Date()).getTime() / 1000),
prefer_formatted_code: true
}, val)));
}

2
modules/submission.js

@ -174,7 +174,7 @@ app.get('/submission/:id', async (req, res) => {
roughResult: getRoughResult(judge, displayConfig, false),
code: (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,
preferFormattedCode: res.locals.user ? res.locals.user.prefer_formatted_code : true,
detailResult: processOverallResult(judge.result, displayConfig),
socketToken: (judge.pending && judge.task_id != null) ? jwt.sign({
taskId: judge.task_id,

Loading…
Cancel
Save