Browse Source

Do not start pushing if task id is null.

master
t123yh 7 years ago
parent
commit
31db093646
  1. 4
      modules/contest.js
  2. 4
      modules/submission.js

4
modules/contest.js

@ -360,7 +360,7 @@ app.get('/contest/:id/submissions', async (req, res) => {
contest: contest, contest: contest,
items: judge_state.map(x => ({ items: judge_state.map(x => ({
info: getSubmissionInfo(x, displayConfig), info: getSubmissionInfo(x, displayConfig),
token: (getRoughResult(x, displayConfig) == null) ? jwt.sign({ token: (getRoughResult(x, displayConfig) == null && x.task_id != null) ? jwt.sign({
taskId: x.task_id, taskId: x.task_id,
type: pushType, type: pushType,
displayConfig: displayConfig displayConfig: displayConfig
@ -415,7 +415,7 @@ app.get('/contest/submission/:id', async (req, res) => {
roughResult: getRoughResult(judge, displayConfig), roughResult: getRoughResult(judge, displayConfig),
code: (displayConfig.showCode && judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '', code: (displayConfig.showCode && judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '',
detailResult: processOverallResult(judge.result, displayConfig), detailResult: processOverallResult(judge.result, displayConfig),
socketToken: (displayConfig.showDetailResult && judge.pending) ? jwt.sign({ socketToken: (displayConfig.showDetailResult && judge.pending && x.task_id != null) ? jwt.sign({
taskId: judge.task_id, taskId: judge.task_id,
displayConfig: displayConfig, displayConfig: displayConfig,
type: 'detail' type: 'detail'

4
modules/submission.js

@ -109,7 +109,7 @@ app.get('/submissions', async (req, res) => {
// judge_state: judge_state, // judge_state: judge_state,
items: judge_state.map(x => ({ items: judge_state.map(x => ({
info: getSubmissionInfo(x, displayConfig), info: getSubmissionInfo(x, displayConfig),
token: (getRoughResult(x, displayConfig) == null) ? jwt.sign({ token: (x.pending && x.task_id != null) ? jwt.sign({
taskId: x.task_id, taskId: x.task_id,
type: 'rough', type: 'rough',
displayConfig: displayConfig displayConfig: displayConfig
@ -162,7 +162,7 @@ app.get('/submission/:id', async (req, res) => {
roughResult: getRoughResult(judge, displayConfig), roughResult: getRoughResult(judge, displayConfig),
code: (judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '', code: (judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '',
detailResult: processOverallResult(judge.result, displayConfig), detailResult: processOverallResult(judge.result, displayConfig),
socketToken: judge.pending ? jwt.sign({ socketToken: (judge.pending && judge.task_id != null) ? jwt.sign({
taskId: judge.task_id, taskId: judge.task_id,
type: 'detail', type: 'detail',
displayConfig: displayConfig displayConfig: displayConfig

Loading…
Cancel
Save