It is a simple Python-based quiz game with TUI(Terminal User Interface). Supports quizzes with one of three answer correct.
- Python 3.8+
- Everything included in
requirements.txt
- Clone the repository:
git clone https://github.com/xxNauty/QuizApp.git
cd QuizApp- Run the app: (replace {name_of_quiz} with actual name of quiz)
python main.py {name_of_quiz}App for now accepts questions in CSV and JSON formats.
- Sample of the
CSVfile
id,question,answer_a,answer_b,answer_c,correct,source
1,"Content of the question","answer A","answer B","answer C","correct answer (A/B/C)","Optional field, where you can put additional information that can prove the correct answer"- Sample of the
JSONfile
[
{
"id":1,
"question":"Content of the question",
"answer_a":"answer A",
"answer_b":"answer B",
"answer_c":"answer C",
"correct":"correct answer (A/B/C)",
"source":"Optional field, where you can put additional information that can prove the correct answer"}
]If you want to create new quiz, you can use script located inside the scripts\quiz_template_generator.py
file which can do it for you. Just answer its questions and the templates for new quiz will be generated.
You can run it with:
python -m scripts.quiz_template_generatorYou will be asked four questions, you need to write:
- The name of quiz
- In which format you want to store your questions (for now only CSV and JSON are supported)
- How many questions should single quiz contain
- How many answers must be correct to pass
All the configuration of the quiz will be stored inside the config.yaml file.
Sample config file:
quiz_name: name_of_the_quiz
number_of_questions: 20
minimum_to_pass: 18
integrity_verified: falseNow you can fill the database file with questions. But it's not the end of work. When the file is ready,
you have to run script located inside the scripts\data_integrity_checker.py to check if everything is ok with your database.
If there are any errors inside, it will tell you where the problems are. If everything is correct, it will mark this database
as checked, and it will make it available for use (If you try to use unverified database it will tell you that you cannot).
You can run this script with: (replace {name_of_quiz} with actual name of quiz you want to check)
python -m scripts.data_integrity_checker {name_of_quiz}