From 213123d0e69d13fbaba7a07475645ddf828754b1 Mon Sep 17 00:00:00 2001 From: artsiom aliakseyenka Date: Tue, 29 Aug 2023 14:37:17 +0200 Subject: [PATCH] fix: legacy rating --- nestjs/src/courses/interviews/interviews.service.ts | 2 +- server/src/services/stageInterview.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nestjs/src/courses/interviews/interviews.service.ts b/nestjs/src/courses/interviews/interviews.service.ts index fc31557e38..0e6652f3b6 100644 --- a/nestjs/src/courses/interviews/interviews.service.ts +++ b/nestjs/src/courses/interviews/interviews.service.ts @@ -176,7 +176,7 @@ export class InterviewsService { const ratingsCount = 4; const ratings = [htmlCss, common, dataStructures, programmingTask.codeWritingLevel].filter(Boolean) as number[]; - const rating = ratings.length === ratingsCount ? ratings.reduce((sum, num) => sum + num) / ratingsCount : 0; + const rating = (ratings.length === ratingsCount ? ratings.reduce((sum, num) => sum + num) / ratingsCount : 0) * 10; return { rating, htmlCss, common, dataStructures }; } diff --git a/server/src/services/stageInterview.service.ts b/server/src/services/stageInterview.service.ts index 50c3fb459f..f56e0810c9 100644 --- a/server/src/services/stageInterview.service.ts +++ b/server/src/services/stageInterview.service.ts @@ -16,7 +16,7 @@ export function getInterviewRatings({ skills, programmingTask, resume }: StageIn const ratingsCount = 4; const ratings = [htmlCss, common, dataStructures, programmingTask.codeWritingLevel].filter(Boolean) as number[]; - const rating = ratings.length === ratingsCount ? ratings.reduce((sum, num) => sum + num) / ratingsCount : 0; + const rating = (ratings.length === ratingsCount ? ratings.reduce((sum, num) => sum + num) / ratingsCount : 0) * 10; return { rating, htmlCss, common, dataStructures }; }