diff --git a/services/QuizService.ts b/services/QuizService.ts index 18da39998fc5bd9b12f82e03203c9bfc1cad1940..f742340858a31006ceb2f82de8d951c8f8dc4b20 100644 --- a/services/QuizService.ts +++ b/services/QuizService.ts @@ -184,10 +184,12 @@ export const useQuizService = () => { }; const getRandomQuiz = async (): Promise<QuizGenerateAnswer | HttpError> => { + const categories = await getCategories(); + const difficulties = ['easy', 'medium', 'hard']; const requestBody = { amount: 10, - category: 10, - difficulty: "easy", + category: categories[Math.floor(Math.random() * categories.length)].id, + difficulty: difficulties[Math.floor(Math.random() * difficulties.length)], }; try {