From 5ef8c641f20ad5a4a4edbb0bd3c811edebc91ac9 Mon Sep 17 00:00:00 2001 From: rladydgn <39542757+rladydgn@users.noreply.github.com> Date: Sat, 2 Dec 2023 02:35:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95,?= =?UTF-8?q?=20=EB=A9=94=EC=84=9C=EB=93=9C=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/competition/gateways/competition.gateway.ts | 2 +- .../src/competition/services/competition.service.ts | 2 +- .../src/competition/services/problem.service.ts | 2 +- be/algo-with-me-api/src/dashboard/dashboard.service.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) 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; }