-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquiz.py
More file actions
37 lines (27 loc) · 929 Bytes
/
quiz.py
File metadata and controls
37 lines (27 loc) · 929 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
28
29
30
31
32
33
34
35
36
37
from typing import List
class Discipline:
def __init__(self, name: str):
self.name = name
class Topic:
def __init__(self, name: str, discipline: Discipline):
self.name = name
self.discipline = discipline
class Question:
def __init__(
self, topic: Topic, text: str, answer_options: List[str], correct_answer: str
):
self.topic = topic
self.text = text
self.answer_options = answer_options
self.correct_answer = correct_answer
class QuestionSet:
def __init__(
self, questions: List[Question], max_tries_question: int, max_tries_set: int
):
self.questions = questions
self.max_tries_question = max_tries_question
self.max_tries_set = max_tries_set
class TestRunner:
def __init__(self, question_set: QuestionSet):
self.question_set = question_set
self.correct_answers_count: int = 0