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