๐ง Difficulty Setting
Users can choose their preferred difficulty level, which directly affects the types of questions they receive in the game.
๐ฏ Purpose
Allow users to play at a level that suits their skills:
- SIMPLE โ For beginners or kids.
- CHALLENGING โ For advanced learners looking for tough problems.
๐งโ๐ซ Available Levels
Defined in the Difficulty
enum:
SIMPLE
EASY
MEDIUM
HARD
CHALLENGING
These levels can be expanded or renamed as needed.
๐ง How It Works
- When the user selects a level, itโs saved using:
```kotlin DifficultyPreferences.setDifficulty(context, level) ````
- To retrieve the current level anywhere in the app:
kotlin
val level = DifficultyPreferences.getDifficulty(context)
- Game fragments (like Tap Mode, Shake Mode) use this level to load questions dynamically based on difficulty.
๐ Persistence
The selected difficulty is stored in SharedPreferences
under this key:
pref_difficulty_level