Skip to content

Commit

Permalink
fix: fixed progress indication bug
Browse files Browse the repository at this point in the history
  • Loading branch information
seo-rii committed Jan 4, 2022
1 parent 682e352 commit d25f8ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/judge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function judge(problem: string) {
sendMessage(WebSocketResponseType.JUDGE_PROGRESS, {
uid: (problemMap.get(problem) as JudgeRequest).uid,
progress: 0,
reason: 'CP',
resultCode: 'CP',
})
executeJudge(problemMap.get(problem) as JudgeRequest).then(
(res: JudgeResult) => {
Expand Down
4 changes: 3 additions & 1 deletion src/runner/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export default function commonJudge(
sendMessage(WebSocketResponseType.JUDGE_PROGRESS, {
uid: data.uid,
progress:
(parseInt(i) + 1) / subtask.data.length / subtask.data +
(parseInt(i) + 1) /
subtask.data.length /
data.dataSet.length +
parseInt(subtaskI) / data.dataSet.length,
resultCode: 'RUN',
})
Expand Down

0 comments on commit d25f8ee

Please sign in to comment.