1.0.4 • Published 5 months ago
@3bbas/quizme v1.0.4
QuizMe - Interactive CLI Quiz Tool
QuizMe is an interactive command-line quiz tool that transforms JSON-based question banks into engaging quizzes. Perfect for students, or anyone who wants to test their knowledge in a fun and interactive way.
Features
- Interactive CLI Interface: Colorful and engaging command-line interface
 - Multiple Question Sources: Load questions from local files or remote URLs
 - LaTeX Support: Automatic conversion of LaTeX math formulas to Unicode
 - True/False and Multiple-Choice: Support for different question formats
 - Randomized Questions: Questions are shuffled for a fresh experience every time
 - Timed Quizzes: Track how long it takes to complete each quiz
 - Results Summary: Review your performance with detailed statistics
 - Error Handling: Robust validation for file paths and URLs
 
Installation
# Install globally
npm install -g @3bbas/quizme
# Or use npx
npx @3bbas/quizmeUsage
Basic Usage
Run the command to start the quiz:
quizmeJSON Format
Your quiz JSON file should follow this format:
[
  {
    "id": 1,
    "question": "What is the capital of France?",
    "options": {
      "A": "London",
      "B": "Paris",
      "C": "Berlin",
      "D": "Madrid"
    },
    "answer": "B"
  },
  {
    "id": 2,
    "question": "The speed of light in a vacuum is about $30 \\, \\text{cm/ns}$.",
    "answer": true,
    "id": 2
  }
]The tool supports:
- Multiple-choice questions: With 
optionsobject and ananswerthat matches one of the option keys - True/False questions: With a boolean 
answerproperty - LaTeX formatting: For math formulas that are automatically converted to Unicode
 
Features in Detail
1. Quiz Sources
QuizMe supports loading quiz questions from:
- Local JSON files: Specify a path to a JSON file on your system
 - Remote URLs: Provide a URL to a JSON endpoint (e.g., 
https://example.com/quiz.json) 
2. LaTeX to Unicode Conversion
The tool automatically converts LaTeX math notation to Unicode characters:
- Fractions: 
\frac{1}{2}→1/2 - Square roots: 
\sqrt{2}→√2 - Greek letters: 
\alpha,\beta, etc. →α,β, etc. - Mathematical symbols: 
\infty,\pm, etc. →∞,±, etc. 
3. Question Processing
- Shuffling: Questions are randomly shuffled for each quiz attempt
 - Validation: Questions are validated for required fields
 - Format handling: Both multiple-choice and True/False questions are supported
 - Default options: Questions with missing options are provided with defaults
 
4. User Interface
- Interactive prompts: Easy selection of options using arrow keys
 - Color coding: Questions, answers, and results are displayed with intuitive colors
 - Loading spinners: Visual feedback during data loading and processing
 - Readable output: Clear presentation of questions and results
 
5. Quiz Flow
- Source selection: Choose between local file or remote URL
 - Question loading: Load and process questions
 - Quiz progression: Answer questions one by one
 - Feedback: Immediate feedback after each answer
 - Results: Detailed summary of performance at the end
 
6. Timing and Results
- Timer: Tracks the total time taken to complete the quiz
 - Score calculation: Tallies correct and incorrect answers
 - Incorrect answers review: Option to review all incorrect answers at the end
 
File Structure
- cli.ts: Main entry point and command-line interface
 - fileLoader.ts: Handles loading quiz data from files or URLs
 - quizRunner.ts: Manages the quiz flow and user interaction
 - timer.ts: Tracks quiz duration
 - types.ts: TypeScript interfaces for quiz data
 - utils.ts: Utility functions for LaTeX conversion and validation
 
Author
Created by 3bbas
Enjoy testing your knowledge with QuizMe! 🎓