Skip to content

Commit

Permalink
hotfix: 정답 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-byeong committed Dec 5, 2024
1 parent 4eb9597 commit c141fb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/server/src/module/game/games/game.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,12 @@ export class GameGateway implements OnGatewayConnection, OnGatewayDisconnect {

matchingAnswer(selectedAnswer: Number[], currentChoicesData) {
const correctAnswers = currentChoicesData
.map((choice, index) => (choice.isCorrect ? index : null))
.map((choice) => (choice.isCorrect ? choice.position : null))
.filter((index) => index !== null);

console.log('correctAnswers : ', correctAnswers);
console.log('selectedAnswer : ', selectedAnswer);

const equals = (a: Number[], b: Number[]) =>
a.length === b.length && a.every((v, i) => v === b[i]);

Expand Down

0 comments on commit c141fb1

Please sign in to comment.