An open API service indexing awesome lists of open source software.

https://github.com/filiprokita/python-ai-quiz

A Flask-based quiz app that dynamically loads questions from a database, making it easy to customize. Users can take quizzes, track high scores, and manage sessions. By default, the quiz focuses on AI in Python, but can be easily adapted to any topic.
https://github.com/filiprokita/python-ai-quiz

ai backend bootstrap customizable database dynamic-content flask full-stack machine-learning python quiz-app session-management sqlite web-app web-development

Last synced: 2 months ago
JSON representation

A Flask-based quiz app that dynamically loads questions from a database, making it easy to customize. Users can take quizzes, track high scores, and manage sessions. By default, the quiz focuses on AI in Python, but can be easily adapted to any topic.

Awesome Lists containing this project

README

          

# 🧠 Python AI Quiz



---

This is a web-based **Python AI Quiz Application** built using **Flask, SQLAlchemy, and Bootstrap**. The quiz focuses on **Artificial Intelligence (AI) topics** such as **deep learning, computer vision, and natural language processing (NLP)**.

## 🎯 Main Advantage
The quiz questions are stored in a **database (SQLite)** instead of being hardcoded, making it **effortlessly customizable**. This allows users to **easily modify, expand, or update the quiz content** without changing the application’s code, ensuring **scalability and flexibility**. The included AI-related questions may serve as **placeholders**, meaning the quiz can be quickly adapted to any topic by simply updating the database.

## πŸš€ Features
βœ… AI-related quiz with multiple-choice questions
βœ… User session management (tracks the highest score)
βœ… Dynamic leaderboard displaying the best score
βœ… Responsive design using Bootstrap
βœ… Modular and structured Flask application
βœ… SQLite database integration

## πŸ’» Technologies Used
- **Python** (Flask, SQLAlchemy, Flask-Session)
- **HTML, CSS, Bootstrap** (Frontend)
- **SQLite** (Database)
- **Docker** (Environment)

## πŸ“œ Installation Guide (with Docker)

### **1️⃣ Clone the Repository**
```sh
git clone https://github.com/FilipRokita/python-ai-quiz
cd python-ai-quiz
```

### **2️⃣ Run Docker Compose**
```sh
docker compose up -d
```

βœ… **Visit:** `http://0.0.0.0:8082/`

## πŸ“œ Installation Guide (without Docker)

### **1️⃣ Clone the Repository**
```sh
git clone https://github.com/FilipRokita/python-ai-quiz
cd python-ai-quiz
```

### **2️⃣ Install Dependencies**
```sh
pip install -r requirements.txt
```

### **3️⃣ Initialize the Database**
```sh
python init_db.py
```

### **4️⃣ Add Python AI Quiz Questions**
```sh
python add_questions.py
```

### **5️⃣ Run the Flask App**
```sh
python app.py
```
βœ… **Visit:** `http://127.0.0.1:5000/`

---

## πŸ“Œ Author
**πŸ‘¨β€πŸ’» Filip Rokita**
πŸ”— [LinkedIn Profile](https://www.linkedin.com/in/filiprokita/)
πŸ”— [GitHub Profile](https://github.com/FilipRokita)

---

## πŸ“ License
This project is licensed under the **[MIT License](LICENSE)**.

---

### **🌟 If you like this project, please give it a ⭐ on GitHub!**
πŸš€ **Happy coding!** 😊