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

  1. Create questions
  2. Initialize QuizEngine
  3. Submit answers
  4. Finish quiz
  5. 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:

  1. Fork repository
  2. Create feature branch
  3. Commit changes
  4. 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.