diff --git a/packages/server/src/module/game/games/game.gateway.ts b/packages/server/src/module/game/games/game.gateway.ts index 6bd3d37..569cb89 100644 --- a/packages/server/src/module/game/games/game.gateway.ts +++ b/packages/server/src/module/game/games/game.gateway.ts @@ -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]);