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,
items: judge_state.map(x => ({
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,
type: pushType,
displayConfig: displayConfig
@ -415,7 +415,7 @@ app.get('/contest/submission/:id', async (req, res) => {
roughResult: getRoughResult(judge, displayConfig),
code: (displayConfig.showCode && judge.problem.type !== 'submit-answer') ? judge.code.toString("utf8") : '',
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,
displayConfig: displayConfig,
type: 'detail'

4
modules/submission.js

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

Loading…
Cancel
Save