diff --git a/be/algo-with-me-api/src/competition/gateways/competition.gateway.ts b/be/algo-with-me-api/src/competition/gateways/competition.gateway.ts index d570d47..8f416aa 100644 --- a/be/algo-with-me-api/src/competition/gateways/competition.gateway.ts +++ b/be/algo-with-me-api/src/competition/gateways/competition.gateway.ts @@ -48,7 +48,7 @@ export class CompetitionGateWay implements OnGatewayConnection, OnGatewayInit { client.handshake.auth.token, ); const user: User = await this.userService.getByEmail(authTokenPayloadDto.sub); - const testcaseNum: number = await this.problemService.getProblenTestcaseNum( + const testcaseNum: number = await this.problemService.getProblemTestcaseNum( createSubmissionDto.problemId, ); this.competitionService.scoreSubmission(createSubmissionDto, client.id, user); diff --git a/be/algo-with-me-api/src/competition/services/competition.service.ts b/be/algo-with-me-api/src/competition/services/competition.service.ts index adb1cbb..b064f76 100644 --- a/be/algo-with-me-api/src/competition/services/competition.service.ts +++ b/be/algo-with-me-api/src/competition/services/competition.service.ts @@ -237,7 +237,7 @@ export class CompetitionService { this.submissionRepository.save(submission); // 모두 제출했는지 확인 - const testcaseNum: number = await this.problemService.getProblenTestcaseNum( + const testcaseNum: number = await this.problemService.getProblemTestcaseNum( submission.problemId, ); let totalResult: keyof typeof RESULT = 'CORRECT'; diff --git a/be/algo-with-me-api/src/competition/services/problem.service.ts b/be/algo-with-me-api/src/competition/services/problem.service.ts index e1561d5..edbc3a6 100644 --- a/be/algo-with-me-api/src/competition/services/problem.service.ts +++ b/be/algo-with-me-api/src/competition/services/problem.service.ts @@ -37,7 +37,7 @@ export class ProblemService { return ProblemResponseDto.from(problem, content); } - async getProblenTestcaseNum(id: number) { + async getProblemTestcaseNum(id: number) { const problem = await this.problemRepository.findOneBy({ id }); return problem.testcaseNum; } diff --git a/be/algo-with-me-api/src/dashboard/dashboard.service.ts b/be/algo-with-me-api/src/dashboard/dashboard.service.ts index 666b6c4..53fdb0c 100644 --- a/be/algo-with-me-api/src/dashboard/dashboard.service.ts +++ b/be/algo-with-me-api/src/dashboard/dashboard.service.ts @@ -61,7 +61,7 @@ export class DashboardService { const record = await JSON.parse(await this.redis.get(recordKey)); console.log(record); - if (this.isCorrected(record, problemId)) return; + if (this.isAlreadyCorrect(record, problemId)) return; if (result !== RESULT.CORRECT) { record[problemId] = -1; @@ -150,7 +150,7 @@ export class DashboardService { } } - isCorrected(value: object, problemId: number) { + isAlreadyCorrect(value: object, problemId: number) { if (value[problemId] === null || Number(value[problemId]) === -1) return false; return true; }