Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ„ Mushroom Cultivation Quiz Application

A comprehensive, professional Python package that tests knowledge about mushroom cultivation techniques, varieties, substrates, terminology, and medicinal properties. This educational tool provides an interactive learning experience for mushroom cultivation enthusiasts at all skill levels.

๐Ÿš€ New in Version 2.0.1 (Modular Architecture)

๐Ÿ—๏ธ Professional Package Structure

  • ๐Ÿ“ฆ Installable Python Package: pip install -e . for system-wide access
  • ๐ŸŽฏ Modular Design: Clean separation of concerns (core, ui, data, utils)
  • ๐Ÿ“š Comprehensive Documentation: Professional headers and API docs in every file
  • ๐Ÿงช Full Test Coverage: Unit tests for all major components
  • ๐Ÿ”ง Multiple Entry Points:
    • python -m mushroom_quiz (recommended)
    • mushroom-quiz (after installation)
    • Legacy compatibility maintained

๐Ÿ› ๏ธ Developer Experience

  • Clear Module Structure: /core, /ui, /data, /utils organization
  • Professional Standards: Type hints, docstrings, version consistency
  • Easy Extension: Well-defined interfaces for adding features
  • IDE Support: Better code completion and navigation
  • Test Framework: pytest compatible test suite

๐Ÿ“‹ Installation & Usage

# Install as development package
pip install -e .

# Run the application (multiple ways)
python -m mushroom_quiz          # Recommended
mushroom-quiz                    # After installation
python mushroom_quiz_app_legacy.py  # Legacy compatibility

# Run tests
python -m pytest tests/

โœจ Previous Updates (v2.0.0)

  • Expanded Question Database: Now includes 111 questions (up from 45)
  • Enhanced Medicinal Mushroom Coverage: 19 dedicated questions on health benefits
  • Comprehensive Headers: Professional documentation in all code files
  • Improved Balance: Better distribution across all topics and difficulty levels
  • Advanced Cultivation Topics: Sterilization, cultivation processes, and growing methods

๐Ÿ“ Project Structure

New Modular Architecture (v2.0.1)

src/mushroom_quiz/           # Main package directory
โ”œโ”€โ”€ __init__.py              # Package initialization and exports
โ”œโ”€โ”€ __main__.py              # Entry point for `python -m mushroom_quiz`
โ”œโ”€โ”€ app.py                   # Main application coordination
โ”œโ”€โ”€ core/                    # Core functionality
โ”‚   โ”œโ”€โ”€ __init__.py          # Core module exports
โ”‚   โ”œโ”€โ”€ quiz_engine.py       # Quiz game logic and QuizGame class
โ”‚   โ””โ”€โ”€ timer.py             # Timed input with visual countdown
โ”œโ”€โ”€ ui/                      # User interface modules
โ”‚   โ”œโ”€โ”€ __init__.py          # UI module exports
โ”‚   โ””โ”€โ”€ terminal_ui.py       # Terminal interface and styling
โ”œโ”€โ”€ data/                    # Data management
โ”‚   โ”œโ”€โ”€ __init__.py          # Data module exports
โ”‚   โ”œโ”€โ”€ question_loader.py   # Question loading abstraction
โ”‚   โ””โ”€โ”€ quiz_questions.py    # Question database (111 questions)
โ””โ”€โ”€ utils/                   # Utility functions
    โ”œโ”€โ”€ __init__.py          # Utils module exports
    โ””โ”€โ”€ helpers.py           # Common helper functions

tests/                       # Test suite
โ”œโ”€โ”€ __init__.py              # Test package initialization
โ””โ”€โ”€ test_question_loader.py  # Unit tests for question loading

docs/                        # Documentation
โ”œโ”€โ”€ DEVELOPMENT_NOTES.md     # Development notes
โ”œโ”€โ”€ VERSIONING.md            # Version history
โ””โ”€โ”€ MODULAR_STRUCTURE.md     # Detailed architecture guide

web/                         # Web version
โ”œโ”€โ”€ index.html               # Main HTML file
โ”œโ”€โ”€ styles.css               # CSS styling
โ”œโ”€โ”€ questions.js             # Question database (JavaScript)
โ””โ”€โ”€ quiz.js                  # Main quiz logic (JavaScript)

retro/                       # Retro versions (New!)
โ”œโ”€โ”€ README.md                # Retro collection documentation
โ”œโ”€โ”€ mushroom_quiz_spectrum.bas # ZX Spectrum BASIC version
โ””โ”€โ”€ mushroom_quiz_c64.bas    # Commodore 64 BASIC version

# Package files
setup.py                     # Package installation script
requirements.txt             # Dependencies
README.md                    # This documentation
LICENSE                      # MIT License

# Legacy compatibility
mushroom_quiz_app.py         # Original entry point (preserved)
mushroom_quiz_app_legacy.py  # Backward compatibility wrapper
quiz_ui.py                   # Original UI module (preserved)
quiz_questions.py            # Original questions (preserved)
quiz_logic.py                # Original logic (preserved)
quiz_timer.py                # Original timer (preserved)

๐Ÿ”ง Module Descriptions

New Modular Architecture (v2.0.1)

Core Package (src/mushroom_quiz/)

  • __init__.py: Package initialization with version info and main export
  • __main__.py: Entry point for python -m mushroom_quiz execution
  • app.py: Main application coordination and menu flow

Core Functionality (src/mushroom_quiz/core/)

  • quiz_engine.py: Contains QuizGame class and create_quiz() function
  • timer.py: TimedInput class with visual countdown and threading

User Interface (src/mushroom_quiz/ui/)

  • terminal_ui.py: All UI functions, ANSI colors, menus, and displays

Data Management (src/mushroom_quiz/data/)

  • question_loader.py: Abstraction layer for question filtering and access
  • quiz_questions.py: Comprehensive database of 111 questions

Utilities (src/mushroom_quiz/utils/)

  • helpers.py: Common utility functions (validation, formatting, etc.)

Testing (tests/)

  • test_question_loader.py: Unit tests for question loading functionality

Legacy Files (Preserved for Compatibility)

  • mushroom_quiz_app.py: Original main application entry point
  • quiz_ui.py: Original user interface module
  • quiz_questions.py: Original question database
  • quiz_logic.py: Original core logic
  • quiz_timer.py: Original timer functionality
  • mushroom_quiz_app_legacy.py: Backward compatibility wrapper

๐ŸŽฎ Features

  • Multiple Difficulty Levels: Beginner, Intermediate, Advanced, Mixed
  • Flexible Quiz Length: 5, 10, or 20 questions
  • Timer Modes: Relaxed (no timer), Timed (30s), Speed (15s)
  • Colorful Interface: ANSI colors and emojis
  • Study Recommendations: Personalized based on wrong answers
  • Screen Management: Clean interface with screen clearing

๐Ÿš€ Running the Application

New Modular Methods (v2.0.1)

# Recommended: Run as Python module
python -m mushroom_quiz

# After installation: Use console command
pip install -e .  # Install package
mushroom-quiz     # Run command

# Development: Import in Python
from mushroom_quiz import main
main()

Legacy Methods (Preserved)

# Original entry point
python mushroom_quiz_app.py

# Legacy wrapper with compatibility note
python mushroom_quiz_app_legacy.py

Web Version

  1. Local Development:

    cd web
    python -m http.server 8000
    # Open http://localhost:8000 in your browser
  2. Production Deployment:

    • Deploy the web/ folder to any web server
    • No server-side processing required (static files only)
    • Compatible with GitHub Pages, Netlify, Vercel, etc.

๐ŸŒ Web Version Features

  • Responsive Design: Works on desktop, tablet, and mobile devices
  • Modern UI: Beautiful gradient backgrounds and smooth animations
  • Interactive Elements: Hover effects and visual feedback
  • Progress Tracking: Visual progress bar and real-time scoring
  • Timer Visualization: Circular countdown timer with color coding
  • Keyboard Support: Use number keys (1-4) to select answers
  • Social Sharing: Share results with friends
  • Accessibility: Semantic HTML and keyboard navigation
  • Cross-browser Compatible: Works in all modern browsers

๐Ÿ“Š Question Database Stats (v2.0.0)

๐ŸŽฏ Total Questions: 111

Difficulty Distribution:

  • Beginner: 38 questions (34.2%) - Perfect for newcomers
  • Intermediate: 46 questions (41.4%) - Core learning content
  • Advanced: 27 questions (24.3%) - Expert-level challenges

Topic Distribution:

  1. Cultivation Process: 22 questions (19.8%) - Step-by-step procedures
  2. Medicinal Mushrooms: 19 questions (17.1%) - Health benefits & compounds
  3. Mushroom Varieties: 14 questions (12.6%) - Species identification
  4. Sterilization: 13 questions (11.7%) - Contamination prevention
  5. Growing Conditions: 9 questions (8.1%) - Environmental factors
  6. Growing Methods: 8 questions (7.2%) - Techniques & systems
  7. Biology Basics: 7 questions (6.3%) - Fundamental knowledge
  8. Timing: 7 questions (6.3%) - Schedules & lifecycle stages
  9. Substrates: 6 questions (5.4%) - Growing media
  10. Beginner Varieties: 6 questions (5.4%) - Entry-level species

Topics Covered:

  • ๐Ÿงฌ Biology Basics: Hyphae, mycelium, spores, fungal lifecycle
  • ๐ŸŒฑ Beginner Varieties: Oyster mushrooms, coffee ground cultivation
  • โš—๏ธ Cultivation Process: Inoculation, colonization, pinning, flushing
  • ๐ŸŒก๏ธ Growing Conditions: Temperature, humidity, pH, CO2, lighting
  • ๐Ÿ”ง Growing Methods: Log cultivation, monotub, SGFC, vertical systems
  • ๐Ÿ’Š Medicinal Mushrooms: Reishi, Lion's Mane, Cordyceps, Turkey Tail, Chaga
  • ๐Ÿ„ Mushroom Varieties: Shiitake, King Oyster, Maitake, Enoki, Wine Cap
  • ๐Ÿงช Sterilization: Pressure cooking, autoclaves, sterile technique
  • ๐ŸŒพ Substrates: Sawdust, straw, coffee grounds, supplements
  • โฐ Timing: Harvest timing, spawn storage, flush intervals

๐Ÿงช Testing (New in v2.0.1)

Running Tests

# Run all tests
python -m pytest tests/

# Run with verbose output
python -m pytest tests/ -v

# Run specific test file
python -m pytest tests/test_question_loader.py

# Run with unittest
python -m unittest discover tests/

Test Coverage

  • โœ… Question loading and filtering by difficulty
  • โœ… Question counting functionality
  • โœ… Difficulty level management
  • โœ… Invalid input handling
  • โœ… Module import verification

Adding New Tests

Create test files in the tests/ directory following the naming pattern test_*.py:

import unittest
import sys
import os

# Add src directory to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))

from mushroom_quiz.module import function_to_test

class TestClassName(unittest.TestCase):
    def test_function_name(self):
        result = function_to_test()
        self.assertEqual(result, expected_value)

๐Ÿ”Œ API Reference (New in v2.0.1)

Core API

# Main application entry point
from mushroom_quiz import main
main()  # Start the interactive quiz

# Direct quiz execution
from mushroom_quiz.core import create_quiz
score, total = create_quiz(
    difficulty="intermediate",  # 'beginner', 'intermediate', 'advanced', 'mixed'
    num_questions=10,          # 5, 10, or 20
    timer_seconds=30           # None for no timer, 15 or 30 for timed
)
print(f"Score: {score}/{total}")

Data API

from mushroom_quiz.data import get_questions_by_difficulty, get_all_questions

# Get questions by difficulty
beginner_questions = get_questions_by_difficulty('beginner')
all_questions = get_all_questions()

# Count questions
from mushroom_quiz.data.question_loader import get_question_count_by_difficulty
count = get_question_count_by_difficulty('intermediate')

Utility API

from mushroom_quiz.utils import validate_input, format_percentage

# Validate user input
valid_choice = validate_input("3", 1, 4)  # Returns 3 if valid

# Format percentages
percentage = format_percentage(8, 10)  # Returns "80.0%"

# Get performance level
from mushroom_quiz.utils.helpers import get_performance_level
level, emoji, description = get_performance_level(9, 10)
# Returns ("Expert", "๐Ÿ†", "Outstanding knowledge!")

๐Ÿ”ง Extending the Application

Adding New Questions (v2.0.1)

Add questions to the QUESTIONS list in src/mushroom_quiz/data/quiz_questions.py:

{
    "question": "Your question here?",
    "options": ["Option 1", "Option 2", "Option 3", "Option 4"],
    "answer": "Correct option",
    "difficulty": "beginner|intermediate|advanced",
    "explanation": "Educational explanation",
    "topic": "topic_category"
}

Adding New Features

  • New UI elements: Add to quiz_ui.py
  • New timer modes: Extend quiz_timer.py
  • New game modes: Modify quiz_logic.py
  • Statistics tracking: Extend the main app

๐ŸŽฏ Benefits of Modular Design

  1. Maintainability: Each module has a single responsibility
  2. Scalability: Easy to add new features without breaking existing code
  3. Testability: Modules can be tested independently
  4. Reusability: Components can be reused in other projects
  5. Readability: Code is organized and well-documented
  6. Collaboration: Multiple developers can work on different modules

๐Ÿ† Version 2.0.0 Achievements

โœ… Database Expansion: Increased from 45 to 111 questions (147% growth) โœ… Topic Balance: Eliminated small categories, improved distribution โœ… Medicinal Focus: Comprehensive coverage of health benefits โœ… Professional Headers: Complete documentation in all code files โœ… Advanced Topics: Sterilization and cultivation process depth โœ… Beginner Support: Enhanced entry-level content โœ… Quality Assurance: All questions fact-checked and explained

๐ŸŒŸ Future Enhancements

Planned Features:

  • Question difficulty auto-adjustment based on performance
  • Statistics tracking across sessions
  • Question categories filtering
  • Import/export of custom question sets
  • Multi-language support
  • Enhanced web interface version
  • Progress tracking and achievement system
  • Advanced cultivation calculator tools

Potential Expansions:

  • Commercial cultivation business topics
  • Mushroom identification mini-games
  • Growing equipment recommendations
  • Seasonal cultivation planning
  • Troubleshooting problem solver

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

Ways to Contribute:

  1. Add Questions: Submit new mushroom cultivation questions
  2. Improve Documentation: Enhance code comments or README
  3. Bug Reports: Report issues or unexpected behavior
  4. Feature Requests: Suggest new functionality
  5. Code Improvements: Optimize existing code
  6. Translation: Help with multi-language support

Submission Guidelines:

  • Fork the repository
  • Create a feature branch
  • Follow existing code style and documentation standards
  • Test your changes thoroughly
  • Submit a pull request with clear description

Question Quality Standards:

  • Factually accurate and well-researched
  • Clear, unambiguous wording
  • Educational explanations
  • Appropriate difficulty level
  • Real-world applicability

๐Ÿ“‹ Requirements

Terminal Version:

  • Python 3.6 or higher
  • No external dependencies (uses only standard library)
  • Cross-platform compatible (Windows, macOS, Linux)

Web Version:

  • Modern web browser with JavaScript support
  • No server requirements (runs client-side)
  • Mobile and desktop compatible

๐Ÿ› ๏ธ Development Setup

New Modular Development (v2.0.1)

# Clone the repository
git clone https://github.com/aaronjacobs-chelt/mushroom-cultivation-quiz.git
cd mushroom-cultivation-quiz

# Install in development mode
pip install -e .

# Run the application
python -m mushroom_quiz

# Run tests
python -m pytest tests/

# Check package info
python -c "import mushroom_quiz; print(f'Version: {mushroom_quiz.__version__}')"

Legacy Development

# Run original terminal version
python mushroom_quiz_app.py

# Run legacy wrapper
python mushroom_quiz_app_legacy.py

Web Version Development

# Serve the web version locally
cd web
python -m http.server 8000
# Open http://localhost:8000

Retro Version Development (New!)

# ZX Spectrum BASIC version
cd retro
# Load mushroom_quiz_spectrum.bas in ZX Spectrum emulator

# Commodore 64 BASIC version  
# Load mushroom_quiz_c64.bas in C64 emulator

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License Summary:

  • โœ… Commercial use
  • โœ… Modification
  • โœ… Distribution
  • โœ… Private use
  • โŒ Liability
  • โŒ Warranty

๐Ÿ‘จโ€๐Ÿ’ป Author

Aaron J

๐Ÿ™ Acknowledgments

  • Mushroom cultivation community for knowledge sharing
  • Educational resources and research papers
  • Open source contributors and testers
  • Mycology experts who provided fact-checking

๐Ÿ“š Educational Resources

Recommended Reading:

  • "The Mushroom Cultivator" by Paul Stamets
  • "Growing Gourmet and Medicinal Mushrooms" by Paul Stamets
  • "Organic Mushroom Farming and Mycoremediation" by Tradd Cotter
  • "Radical Mycology" by Peter McCoy

Online Communities:

  • r/MushroomGrowers (Reddit)
  • Shroomery.org forums
  • Mushroom cultivation Facebook groups
  • Local mycology societies

Scientific Resources:

  • PubMed mushroom research papers
  • International Journal of Medicinal Mushrooms
  • Mycological societies and conferences

๐ŸŽฎ How to Play

Getting Started:

  1. Choose your difficulty level (Beginner/Intermediate/Advanced/Mixed)
  2. Select quiz length (5, 10, or 20 questions)
  3. Pick timer mode (Relaxed/Timed/Speed)
  4. Answer multiple-choice questions
  5. Learn from detailed explanations
  6. Review personalized study recommendations

Scoring System:

  • ๐ŸŒŸ 90%+: MUSHROOM MASTER
  • ๐Ÿ„ 70%+: FUNGI EXPERT
  • ๐ŸŒฑ 50%+: GROWING CULTIVATOR
  • ๐Ÿ”ฐ <50%: SPORE BEGINNER

Tips for Success:

  • Start with beginner difficulty to build confidence
  • Read all explanations, even for correct answers
  • Use study recommendations to focus learning
  • Retake quizzes to reinforce knowledge
  • Progress from easier to harder difficulties

Happy Mushroom Growing! ๐Ÿ„โœจ

Built with โค๏ธ for the mushroom cultivation community

About

๐Ÿ„ A comprehensive, modular quiz application testing knowledge about mushroom cultivation techniques, varieties, substrates, and terminology. Features multiple difficulty levels, timer modes, and personalized study recommendations.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages