๐ Building an AI-Powered Quiz App with React Native: Introducing Imo Quiz

๐ Introduction
Education is changing, and our approach to learning and testing our knowledge should change too. As a passionate developer in the UK, I wanted to merge my passion for clean user experiences with meaningful functionality to create something exciting: Imo Quiz. This AI-assisted React Native quiz app not only tests your knowledge but also adapts to your learning style. The term "imo" is a Yoruba word that means "knowledge."
In this post, Iโll walk you through how I built Imo Quiz: a smart educational app that adjusts question difficulty based on your performance, offers real-time AI-style feedback, and stores your scores using Firebase.
๐ช Tech Stack
React Native (TypeScript) โ for building cross-platform UI
Expo Go โ for seamless testing on iOS and Android
Firebase (Firestore) โ to store user scores and usernames
Open Trivia DB API โ for real quiz questions with difficulty levels
AsyncStorage โ for temporary session management (future use)
๐ง Features
โจ Adaptive difficulty logic: Easy โ Medium โ Hard, based on correct streaks
๐ค AI assistant gives tips and contextual guidance
๐ Smooth UI with gradient backgrounds and animations
๐ Real-time score storage with Firebase
โ๏ธ No sign-up required; just enter your username and go!
๐ Project Structure
imo-quiz-app/
โโโ assets/
โโโ src/
โ โโโ api/
โ โโโ components/
โ โโโ constants/
โ โ โโโ tips.ts
โ โโโ screens/
โ โโโ types/
โโโ App.tsx, app.json, etc.
๐ชก Adaptive Difficulty Logic
We track the user's correct streak and update difficulty accordingly:
if (correctStreak >= 3) setDifficulty('hard');
else if (correctStreak === 0) setDifficulty('easy');
else setDifficulty('medium');
Then we fetch new questions with:
https://opentdb.com/api.php?amount=10&difficulty=${difficulty}&type=multiple
This ensures that the app is neither too easy nor too hard for any user.
๐งโ๐ป Firebase Integration
Each user's best score is stored by username. We check if theyโve played before:
const docSnap = await getDoc(scoreRef);
if (docSnap.exists() && score > docSnap.data().score) {
await setDoc(scoreRef, { score });
}
This makes it easy to display personal bests and leaderboard logic (coming soon).
๐ AI Assistant Tips
All assistant text is stored in a reusable tips.ts
file:
export const tips = {
welcome: "Welcome, [username]! Ready to test your brain?",
start: "Click an option to begin. Let's go!",
correct: "Nice one! You're on a roll.",
wrong: "Oops! That was tough. Try the next one.",
result: "Well done! Want to try again?",
};
Then we inject them throughout the UI:
<Text>{tips.welcome.replace('[username]', username)}</Text>
๐จ Home Screen Design
Animated AI assistant icon (in
assets/assistant.png
)ImageBackground
with a semi-transparent overlayClean input and big, bold call-to-action button
<ImageBackground source={require('../../assets/assistant.png')}>
<Text>Welcome to Imo Quiz</Text>
<Text>{tips.welcome.replace('[username]', username)}</Text>
</ImageBackground>
๐ฎ Challenges Faced
TypeScript prop typing with React Navigation
Firebase async logic and preventing score overwrite
Adaptive difficulty UI flow
Making the app look polished but still fast
๐ What's Next?
Add leaderboard view
Add Firebase Auth for secure sign-in
Add voice-over or text-to-speech assistant
Track question-level performance
Add category filters
๐ Try It Yourself!
- ๐ GitHub Repository
๐ Conclusion
Imo Quiz helped me sharpen my skills in React Native, adaptive logic, and user-centric design. More importantly, it gave me the chance to build something fun, personal, and educational.
Would love your feedback โ or even collaboration if you're working on something similar!
Thanks for reading! ๐
Subscribe to my newsletter
Read articles from Ayooluwa ogundeko directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
