6
6
7
7
class Question implements ModelInterface
8
8
{
9
+ /** @var DOMNode[] * */
10
+ private array $ correctAnswer = [];
11
+ /** @var DOMNode[] * */
12
+ private array $ content = [];
13
+ /** @var DOMNode[] * */
14
+ private array $ possibleAnswers = [];
15
+
9
16
/**
10
17
* @param int $id
11
18
* @param int $quizID
12
19
* @param string $filePath
13
20
* @param string $title
14
- * @param DOMNode[] $content
15
- * @param DOMNode[] $possibleAnswers
16
- * @param DOMNode[] $correctAnswer
17
21
*/
18
22
public function __construct (
19
23
private readonly int $ id ,
20
24
private readonly int $ quizID ,
21
25
private readonly string $ filePath ,
22
- private readonly string $ title ,
23
- private readonly array $ content ,
24
- private readonly array $ possibleAnswers ,
25
- private readonly array $ correctAnswer ,
26
+ private readonly string $ title
26
27
) {
27
28
}
28
29
@@ -42,24 +43,54 @@ public function getFilePath(): string
42
43
return $ this ->filePath ;
43
44
}
44
45
45
- /** @return DOMNode[] **/
46
+ /** @return DOMNode[] * */
46
47
public function getContent (): array
47
48
{
48
49
return $ this ->content ;
49
50
}
50
51
51
- /** @return DOMNode[] **/
52
+ /**
53
+ * @param DOMNode[] $content
54
+ * @return Question
55
+ */
56
+ public function setContent (array $ content ): Question
57
+ {
58
+ $ this ->content = $ content ;
59
+ return $ this ;
60
+ }
61
+
62
+ /** @return DOMNode[] * */
52
63
public function getPossibleAnswers (): array
53
64
{
54
65
return $ this ->possibleAnswers ;
55
66
}
56
67
57
- /** @return DOMNode[] **/
68
+ /**
69
+ * @param DOMNode[] $possibleAnswers
70
+ * @return Question
71
+ */
72
+ public function setPossibleAnswers (array $ possibleAnswers ): Question
73
+ {
74
+ $ this ->possibleAnswers = $ possibleAnswers ;
75
+ return $ this ;
76
+ }
77
+
78
+ /** @return DOMNode[] * */
58
79
public function getCorrectAnswer (): array
59
80
{
60
81
return $ this ->correctAnswer ;
61
82
}
62
83
84
+ /**
85
+ * @param DOMNode[] $correctAnswer
86
+ * @return Question
87
+ */
88
+ public function setCorrectAnswer (array $ correctAnswer ): Question
89
+ {
90
+ $ this ->correctAnswer = $ correctAnswer ;
91
+ return $ this ;
92
+ }
93
+
63
94
/**
64
95
* @return string
65
96
*/
0 commit comments