-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion.py
36 lines (27 loc) · 833 Bytes
/
question.py
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
class Question:
class TimeFilter:
def __init__(self, year):
self.year = year
def __init__(self, id, text):
self.id = id
self.text = text
self.time_filter = None
self.syntax = None
self.multiple_answers = False
self.syntax_root = None
def __str__(self):
return self.text
def is_valid(self):
if self.text == "":
return False
return True
def set_time_filter(self, year):
self.time_filter = Question.TimeFilter(year)
def remove_time_filter(self):
self.time_filter = None
def set_syntax(self, syntax):
self.syntax = syntax
def set_multiple_answers(self):
self.multiple_answers = True
def set_syntax_root_index(self, index):
self.syntax_root = index