forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (22 loc) · 870 Bytes
/
main.py
File metadata and controls
27 lines (22 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""This file processes the fetched questions and prepares them for use in the quiz."""
from question_model import Question
from data_dynamic import question_data
from quiz_brain import QuizBrain
from ui import QuizInterface
# question_bank = []
# question_text = question["question"]
# question_answer = question["correct_answer"]
# question_options = question["incorrect_answers"] + [question["correct_answer"]]
# new_question = Question(question_text, question_answer, question_options)
# question_bank.append(new_question)
# list comprehension
question_bank = [
Question(
question["question"],
question["correct_answer"],
question["incorrect_answers"] + [question["correct_answer"]]
)
for question in question_data
]
quiz = QuizBrain(question_bank)
quiz_ui = QuizInterface(quiz)