How sunnysavita10/automated-mcq-generator-using-langchain-openai-api works
Project type and purpose
• This is a Python-based MCQ (Multiple Choice Question) Generator project that ships both as a library/package (mcqgenrator) and a lightweight web interface via Streamlit (StreamlitAPP.py).
• Purpose: ingest raw data, generate MCQs, log operations, and optionally serve results via a browser UI or save to JSON.
File structure
Top-level:
• setup.py, requirements.txt – packaging and dependencies
• StreamlitAPP.py – entry point for the web UI
• test.py – simple script or smoke test for CLI usage
• data.txt, Response.json – sample input/output artifacts
• logs/ – runtime logs
• experiment/ – exploratory notebooks and sample CSVs
src/mcqgenrator:
• MCQGenerator.py – core service class implementing MCQ generation
• utils.py – helper routines (parsing, data shaping)
• logger.py – centralized logging setup
README for additional insights
• README is empty; we infer architecture purely from structure and naming.
a. Main components
1. Presentation Layer
– Streamlit Web UI (StreamlitAPP.py)
– CLI/Test Script (test.py)
2. Core Service
– MCQGenerator class
3. Utilities
– utils.py (data parsing, formatting)
– logger.py (logging adapter)
4. Data Stores
– Raw data (data.txt, experiment/*.csv)
– Generated output (Response.json)
– Logs (logs/*.log)
5. Packaging/Deployment
– setup.py / requirements.txt
b. Relationships & data flows
– User triggers via Web UI or CLI → UI/CLI calls MCQGenerator
– MCQGenerator uses utils to parse raw data
– Core logic applies NLP or templating to produce MCQs
– Results written to Response.json and returned to UI/CLI
– logger captures events at each step and writes to logs/
c. Architectural patterns / design principles
– Layered architecture: Presentation → Service → Utilities → Data
– Separation of concerns: UI code is entirely separate from generation logic
– Single responsibility: MCQGenerator focuses solely on question generation
d. Key technologies
– Python 3.x
– Streamlit for UI
– Standard logging module (wrapped in logger.py)
– Packaging via setuptools (setup.py)
– Capture all essential pieces: input data sources, the core algorithm, utility modules, logging, and output sinks.