This commit is contained in:
Kirill Ivlev 2024-11-30 12:50:52 +04:00
parent 1f12ef292e
commit a70aa80d67

View file

@ -151,7 +151,7 @@ export class QuizService {
const winner = sortedAnswers.find((answer) => answer.valid);
let targetUser = 0;
if(winner) {
const totalWinningScore = 50;
const totalWinningScore = getRandomInt(40,60);
sortedAnswers.filter(x => x.valid).forEach((answer) => {
this.logger.debug(`Giving 1 point to all who answered right`);
this.commandBus.execute(new IncreasePlayerWinningRateCommand(answer.user,
@ -168,7 +168,7 @@ export class QuizService {
));
}
}
await this.commandBus.execute(new IncreasePlayerWinningRateCommand(sortedAnswers[0].user, 5));
await this.commandBus.execute(new IncreasePlayerWinningRateCommand(sortedAnswers[0].user, getRandomInt(4,9)));
this.logger.debug(`Giving 1 point to first`);
await this.commandBus.execute(new IncreasePlayerScoreCommand(winner.user,1));
targetUser = winner.user;