|
|
@ -27,26 +27,27 @@ function processOverallResult(source, config) { |
|
|
|
} |
|
|
|
} |
|
|
|
return { |
|
|
|
return { |
|
|
|
compile: source.compile, |
|
|
|
compile: source.compile, |
|
|
|
judge: config.showDetailResult ? (source.judge && { |
|
|
|
judge: { |
|
|
|
subtasks: source.judge.subtasks && source.judge.subtasks.map(st => ({ |
|
|
|
subtasks: source.judge && source.judge.subtasks ? source.judge.subtasks.map(st => ({ |
|
|
|
score: st.score, |
|
|
|
score: st.score, |
|
|
|
cases: st.cases.map(cs => ({ |
|
|
|
cases: st.cases.map(cs => ({ |
|
|
|
status: cs.status, |
|
|
|
status: cs.status, |
|
|
|
result: cs.result && { |
|
|
|
errorMessage: cs.errorMessage, |
|
|
|
type: cs.result.type, |
|
|
|
result: cs.result && { |
|
|
|
time: config.showUsage ? cs.result.time : undefined, |
|
|
|
type: cs.result.type, |
|
|
|
memory: config.showUsage ? cs.result.memory : undefined, |
|
|
|
time: config.showUsage ? cs.result.time : undefined, |
|
|
|
scoringRate: cs.result.scoringRate, |
|
|
|
memory: config.showUsage ? cs.result.memory : undefined, |
|
|
|
systemMessage: cs.result.systemMessage, |
|
|
|
scoringRate: cs.result.scoringRate, |
|
|
|
input: config.showTestdata ? cs.result.input : undefined, |
|
|
|
systemMessage: cs.result.systemMessage, |
|
|
|
output: config.showTestdata ? cs.result.output : undefined, |
|
|
|
input: config.showTestdata ? cs.result.input : undefined, |
|
|
|
userOutput: config.showTestdata ? cs.result.userOutput : undefined, |
|
|
|
output: config.showTestdata ? cs.result.output : undefined, |
|
|
|
userError: config.showTestdata ? cs.result.userError : undefined, |
|
|
|
userOutput: config.showTestdata ? cs.result.userOutput : undefined, |
|
|
|
spjMessage: config.showTestdata ? cs.result.spjMessage : undefined, |
|
|
|
userError: config.showTestdata ? cs.result.userError : undefined, |
|
|
|
} |
|
|
|
spjMessage: config.showTestdata ? cs.result.spjMessage : undefined, |
|
|
|
})) |
|
|
|
} |
|
|
|
})) |
|
|
|
})) |
|
|
|
}) : null |
|
|
|
})) : null |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
function getCompileStatus(status) { |
|
|
|
function getCompileStatus(status) { |
|
|
@ -149,7 +150,8 @@ function initializeSocketIO(s) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
ok: true, |
|
|
|
ok: true, |
|
|
|
finished: false, |
|
|
|
finished: false, |
|
|
|
running: false |
|
|
|
running: false, |
|
|
|
|
|
|
|
result: processOverallResult(finishedJudgeList[taskId], clientDisplayConfigList[socket.id]) |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|