From 857964e1bc1c4576ba84964fc4ef87057aba22d9 Mon Sep 17 00:00:00 2001 From: aoengin Date: Sun, 15 Dec 2024 09:27:12 +0300 Subject: [PATCH] refactor: update quiz result integration --- .../app/(tabs)/quizzes/quizResults.tsx | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/mobile/bulingo/app/(tabs)/quizzes/quizResults.tsx b/mobile/bulingo/app/(tabs)/quizzes/quizResults.tsx index bc4b5979..47fc33dd 100644 --- a/mobile/bulingo/app/(tabs)/quizzes/quizResults.tsx +++ b/mobile/bulingo/app/(tabs)/quizzes/quizResults.tsx @@ -15,12 +15,33 @@ const QuizResults = () => { const styles = getStyles(colorScheme); const [quizResult, setQuizResult] = useState<{ - quiz: { id: number; title: string }; - score: number; - time_taken: number; - level: string; - question_count: number; + questions: { + choice_images: any[]; + choices: any[]; + correct_choice: number; + is_correct: boolean; + question_image: string | null; + question_number: number; + question_text: string; + user_answer: number | null; + }[]; + quiz_result: { + author: { id: number; username: string }; + id: number; + is_bookmarked: boolean; + is_liked: boolean; + level: string; + like_count: number; + question_count: number; + quiz: { id: number; title: string }; + quiz_progress: number; + score: number; + time_taken: number; + user: { id: number; username: string }; + }; + quiz_title_image: string | null; } | null>(null); + const [loading, setLoading] = useState(true); const [error, setError] = useState(null); @@ -118,10 +139,10 @@ const QuizResults = () => { {quizResult ? ( ) : (