Created by Réka Gábosi
- Description
- Features
- Project Files Overview
- Database Design
- Installation
- Design Choices
- Testing
- Acknowledgments
Quest for Python is made in Python, it's a graphical user interface program, designed to help users learn Python better by using a Quiz. The program allows users to add new questions or delete them within an SQLite database, and test themselves on various Python topics.
The interface is built using the Tkinter library, making it more user-friendly.
Graphical User Interface: built with Tkinter, using buttons and entry fields.
- Main Window: Here we can find the description about the game, the
Quizbutton that lead us to the game and theAdd & Deletebutton where we can add or delete a question.
- Add & Delete: Here we can add and delete a question.
- Quiz Window: Here is the main game, where we can select a type and answer all the questions a type has, when we finish the game it will show our score.
The quiz will also show if the user answered a question correctly or not. If there is only one answer marked with a green color, then the user selected the correct answer. If there are two answers marked one with red and one with green, then the user didn't select the correct answer.
main.py- The main program, which runs the Quest for Python.test_main.py- The code tester program.images/- Contains both the images for the GUI and README.database/quiz.db- SQLite database which stores questions and answers.requirements.txt- A file listing the dependencies required to run the application.README.md- Project documentation.LICENSE- The license file for the project (CC BY-ND 4.0).
The database is designed to efficiently store and manage all the questions.
- Stores all the questions, answers and decoys.
- Allows easy modification and retrieval for any question.
The SQLite database has a single table named quiz with the following schema:
- id: which specifies the unique ID for each question as an
INTEGER. This will be thePRIMARY KEY. - type: which specifies the type of question as
TEXT. Its required so it's put withNOT NULL. - question: which specifies the question as
TEXT. Its required so it's put withNOT NULL. - answer: which specifies the correct answer as
TEXT. Its required so it's put withNOT NULL. - decoy_1, decoy_2, decoy_3 which specifies the incorrect answers as
TEXT.
While this structure supports multiple-choice questions (with 1 correct answer and 3 incorrect answers), the decoy fields are optional. This allows the database to be used in numerous ways, such as:
- Quizzing: Standard miltiple-choice format
- Learing: Flashcard style reptiton, where only the correct answer is provided This allow users to study with this applications but also test themselfs.
- Ensure you have Python installed (version 3.x recommended).
- Library installed with:
Install all dependencies from requirements.txt
pip install -r requirements.txt- Clone this repository or download the files.
- Run the application by entering in the terminal the following:
python main.pyThe project is structured with classes to clearly separate each part:
-
The Database class manages all SQLite operations (add, delete, query).
-
The Quiz class handles the quiz logic (scoring, question flow, answer checking).
-
The GUI classes (Start_GUI, Add_Delete_GUI, Quiz_GUI) each of them representing distinct parts of the interface, making it easier to update or extend one part without affecting the rest.
This modular design makes the application easier to maintain, test, and expand.
SQLite is simple, easy to access and use. It stores all questions in a local file (quiz.db), which:
-
Ensures fast and efficient querying of quiz data.
-
Supports dynamic question management.
Tkinter is a simple built-in solution for creating graphical applications in Python. Making the project more user-friendly.
The core database functionality test is provvided in test_main.py using pytest. The tests are made in-memory SQLite database, to avoid modifying the real data. In addition, the full application was manually tested by interacting with the GUI to verify all features, like navigating through the interface, shuffling the questions order, shuffling the answers order, ensuring that the final result is valid.
- This project was created as a final project for Harvard University's CS50’s Introduction to Programming with Python online course.
- Additional skills and knowledge were gained through completing:
- CS50’s Introduction to Computer Science
- CS50’s Introduction to Databases with SQL
- Special thanks to Codemy.com YouTube Channel for providing excellent tutorials on
TkinterGUI development.




