portfolio / work / uquiz.mdoc
UQuiz
Study at your pace, or race the clock.
An offline-first Android quiz app built with Kotlin and Jetpack Compose, with a Study mode for self-paced review and a Game mode with adaptive timers, scoring and a personal ranking.
At a glance
- Problem
- Studying technical topics with my own questions needed an offline tool for both calm review and testing myself under pressure.
- My part
- A personal project end to end: product idea, screens, architecture, game rules and tests.
- What I delivered
- A completed offline Android app with Study and Game modes.
- Adaptive per-question timers and a personal ranking with nine tiers.
- Scoring and timing rules covered by unit tests.

Problem
I wanted to train technical knowledge (Angular, RxJS, Java…) with my own questions, offline, and in two moods: calm review when learning, and pressure when testing myself.
Solution
- Content: folders, packs and multiple-choice questions with 2–6 options, difficulty and an optional explanation. Packs can be shared as
.uquizJSON files. - Study mode: sequential review with immediate feedback and per-question mastery levels (New → Learning → Familiar → Mastered).
- Game mode: each question gets its own countdown, then an overtime window where answers still count but cost more.
- Ranking: a personal rank that smooths out the swings between games and does not flicker when the score sits near a border. Under the hood: an MMR with an exponentially weighted moving average, nine tiers from Initiate to Paragon, and hysteresis at the borders.
Technical decisions
An adaptive time budget
- Problem
- A fixed timer is unfair: long questions need more reading time than short ones.
- Decision
- An adaptive time budget per question: base time by difficulty plus a bonus by text length, blended with the user's history and clamped between 5 and 60 seconds.
- Alternatives
- One fixed timer per question or per difficulty.
- Trade-off
- The rule is harder to explain to players, so it is documented and covered by tests.
- Evidence
- Unit tests for base times, length bonus, its cap, the historical blend and the clamp.
Clean Architecture with Room
- Problem
- The app has to work without a connection and stay maintainable as features grow.
- Decision
- Clean Architecture with domain slices (content, attempts, stats, ranking, user, import/export) and Room as the only source of truth.
- Alternatives
- A single layer of screens talking to the database directly.
- Trade-off
- More files and mapping code per feature.
- Evidence
- The domain layer has no Android dependencies, so scoring and timing logic is tested without devices.
Quality
Unit tests cover the pure business logic: game scoring (every branch), the time budget calculation and game utilities. The first version is complete. An APK exists but is not published on Google Play; the code is public.
What I learned
In this project, writing the scoring and timing rules as formulas before coding them helped me find edge cases and tune the behaviour before implementing it.
Gallery
Home — streak, XP and progress to the next rank.
Library — questions organised into folders and packs.
Pack detail — questions, difficulty and both modes.
Study mode — review question by question with explanations.
Game mode — the pack's estimated duration, from its questions' time budgets.
Game summary — score, rank and MMR to the next tier.
Stats — study and game performance side by side.
Stack
| Layer | Technology | Why |
|---|---|---|
| Interface | Kotlin + Jetpack Compose | Declarative UI with a small in-house design system (tokens and base components). |
| Data | Room | Local SQLite storage so content and progress work fully offline. |
| Data | DataStore | User preferences such as theme and language. |
| Runtime | Coroutines + Flow | Reactive reads from repositories into ViewModels. |
| Tooling | Kotlinx Serialization | Import and export of question packs as .uquiz JSON files. |
| Quality | JUnit 4 + MockK | Unit tests for the scoring, timing and game utility logic. |
