zeba_academy_quiz_engine
A powerful, modular, and offlineβfirst Flutter quiz engine designed for education apps, learning platforms, and assessment systems.
β¨ Overview
zeba_academy_quiz_engine is a reusable Flutter package that provides a complete quiz infrastructure including question handling, timers, analytics, offline storage, scoring, and result presentation.
It is built with scalability and clean architecture principles so it can be integrated into small learning apps or enterpriseβlevel academy platforms.
π Features
-
β Multiple Question Types
- MCQ (Multiple Choice Questions)
- True / False
- Fill in the Blank
-
β Question randomization
-
β Timer support
- Per question
- Full quiz timer
-
β Automatic score calculation
-
β Performance analytics
-
β Offline quiz storage
-
β Result summary screen UI
-
β Clean and extensible API
-
β Nullβsafe & production ready
π¦ Installation
Add the package to your pubspec.yaml:
dependencies:
zeba_academy_quiz_engine:
path: ../zeba_academy_quiz_engine
Then run:
flutter pub get
π§ Basic Concepts
Question Types
enum QuestionType {
mcq,
trueFalse,
fillBlank,
}
Quiz Flow
- Create questions
- Initialize QuizEngine
- Submit answers
- Finish quiz
- Show result screen
π§© Creating Questions
final questions = [
QuizQuestion(
id: "1",
question: "Capital of France?",
type: QuestionType.mcq,
options: ["Paris", "London", "Rome"],
correctAnswer: "Paris",
marks: 2,
),
];
βοΈ Initialize Quiz Engine
final engine = QuizEngine(
questions,
shuffle: true,
);
β± Timer Usage
engine.startTimer(() {
print("Timer tick");
});
Stop timer automatically when quiz finishes:
final result = engine.finishQuiz();
β Submitting Answers
engine.submitAnswer("Paris");
engine.nextQuestion();
π Get Quiz Result
final result = engine.finishQuiz();
print(result.score);
print(result.correct);
print(result.wrong);
π Analytics
final accuracy = QuizAnalytics.accuracy(result);
final level = QuizAnalytics.performanceLevel(result);
Performance Levels:
| Accuracy | Level |
|---|---|
| 80%+ | Excellent |
| 60β79% | Good |
| 40β59% | Average |
| <40% | Needs Improvement |
πΎ Offline Quiz Storage
Save Quiz
await QuizStorage.saveQuiz(questions);
Load Quiz
final storedQuestions = await QuizStorage.loadQuiz();
π₯ Result Screen UI
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => QuizResultScreen(result: result),
),
);
π Architecture
lib/
βββ models β Data models
βββ engine β Quiz logic
βββ analytics β Performance calculations
βββ storage β Offline persistence
βββ ui β Readyβmade screens
βββ public API
π§ͺ Testing
Run tests using:
flutter test
Static analysis:
flutter analyze
π§ Customization
You can extend:
- Custom scoring systems
- Negative marking
- Difficulty levels
- Adaptive quizzes
- Remote sync providers
π Example Use Cases
- Learning apps
- Online academies
- Certification exams
- Practice test apps
- School assessment systems
π‘ Null Safety
This package fully supports Dart null safety.
π€ Contributing
Contributions, issues, and feature requests are welcome.
Steps:
- Fork repository
- Create feature branch
- Commit changes
- Submit pull request
π License
MIT License
π¨βπ» Author
Zeba Academy
β Support
If this package helps your project, consider giving it a star and sharing feedback.
Productionβready Flutter Quiz Engine for modern education apps.