Skip to content

Commit

Permalink
Fix minor error
Browse files Browse the repository at this point in the history
  • Loading branch information
SeoulSKY committed Apr 30, 2024
1 parent 69cb3ea commit e441582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/screens/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const userId = 1;
const botId = 2;

const minNumUserMessagesForQuiz = 10;
const quizPercentage = 0.1;
const quizProbability = 0.1;

const quizLoadingMessages = [
"Let's engage our minds with a simple quiz!",
Expand Down Expand Up @@ -290,7 +290,7 @@ export default function () {
return;
}

let isQuiz = Math.random() < quizPercentage &&
let isQuiz = Math.random() < quizProbability &&
history.filter(m => m.user._id === userId).length >= minNumUserMessagesForQuiz;

if (isQuiz) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default class Quiz {
const data = {
chatHistory: chatHistory.map(message => {
return {author: message.author, text: message.text};
}).slice(0, -2), // remove the last chat history
}).slice(0, -1), // remove the last chat history
evaluation: this.evaluate(chatHistory),
};

Expand Down

0 comments on commit e441582

Please sign in to comment.