Skip to content

Commit

Permalink
fix: 한 문제의 채점이 완료되었을 경우 완료 이벤트 메시지를 클라이언트에게 전송
Browse files Browse the repository at this point in the history
  • Loading branch information
rladydgn committed Dec 9, 2023
1 parent f2ac625 commit ae1dd16
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ export class CompetitionService {
throw error;
}

result['problemId'] = submission.problemId;
result['stderr'] = scoreResultDto.stderr;
this.server.to(scoreResultDto.socketId).emit('scoreResult', result);

// 모두 제출했는지 확인
const testcaseNum: number = await this.problemService.getProblemTestcaseNum(
submission.problemId,
Expand Down Expand Up @@ -368,10 +372,11 @@ export class CompetitionService {
RESULT[totalResult],
competition.startsAt,
);

this.server
.to(scoreResultDto.socketId)
.emit('problemResult', { message: RESULT[totalResult], problemId: submission.problemId });
}
result['problemId'] = submission.problemId;
result['stderr'] = scoreResultDto.stderr;
this.server.to(scoreResultDto.socketId).emit('scoreResult', result);
}

async findCompetitionProblemList(competitionId: number) {
Expand Down

0 comments on commit ae1dd16

Please sign in to comment.