An Streamlit application designed for exam preparation through customizable quizzes.
- Multiple-choice questions with immediate feedback
- Detailed explanations for each answer
- Progress tracking and score calculation
- Option to shuffle questions for varied practice
- Quiz statistics sidebar to track performance
- Personalized feedback based on quiz performance
- Default set of Azure Data Fundamentals questions
- Questions loaded from an external JSON file for easy customization
- Python 3.7+
- uv package manager
- Clone the repository:
git clone https://github.com/yourusername/quiz-app.git
cd quiz-app- Create a virtual environment and install dependencies using uv:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install streamlit- Run the application:
streamlit run app.pyQuestion sets are stored as separate .json files in the questions/ directory. Each file is automatically loaded and displayed as a selectable button in the app's sidebar, so there's no need to manually update the code when adding new sets.
To create your own set of questions, create a new .json file in the questions/ folder (e.g., azure_questions.json). Use the following format for each question:
{
"question": "What is Azure Synapse Analytics?",
"options": [
"A NoSQL database service",
"An integrated analytics service",
"A blockchain service",
"A machine learning framework"
],
"correct_answer": "An integrated analytics service",
"explanation": "Azure Synapse Analytics is an integrated analytics service that brings together data integration, enterprise data warehousing, and big data analytics."
}Save the file. The new question set will appear in the sidebar automatically, with the filename (excluding .json) converted into a readable button label (e.g., azure_questions.json becomes "Azure Questions").
quiz-app/
├── app.py # Main Streamlit application
├── questions/ # Folder containing all question set JSON files
│ ├── default_questions.json
│ ├── hard_questions.json
│ ├── azure_tools_questions.json
│ └── ... # Add more .json files here as needed
├── .gitignore # Git ignore file
├── justfile # Task runner commands for development
├── pyproject.toml # Project metadata and dependencies (managed with uv)
└── README.md # This file
- Start the application using the instructions above
- Answer questions by clicking on one of the four options
- Receive immediate feedback on your answer with an explanation
- Click "Next Question" to proceed to the next question
- View your final score and performance feedback at the end of the quiz
- Use the sidebar options to:
- Shuffle questions
- Reset the quiz
- View your current score
To create a quiz for a different topic:
- Create a new JSON file (e.g.,
security_questions.json) - Modify the file path in
app.pywhereload_questions_from_file()is called - Run the app with the new question set