質問編集履歴

1

Questionクラスのコードを追加しました

2020/03/27 01:57

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,113 @@
1
+ ```php
2
+
3
+ <?php
4
+
5
+ class Question{
6
+
7
+ private $questionNo;
8
+
9
+ private $sentence;
10
+
11
+ private $answer1;
12
+
13
+ private $answer2;
14
+
15
+ private $answer3;
16
+
17
+ private $answer4;
18
+
19
+ private $answer5;
20
+
21
+ private $correctNo;
22
+
23
+
24
+
25
+ public function __construct($questionNo,$sentence,$answer1,$answer2,$answer3,$answer4,$answer5,$correctNo){
26
+
27
+ $this->questionNo = $questionNo;
28
+
29
+ $this->sentence = $sentence;
30
+
31
+ $this->answer1 = $answer1;
32
+
33
+ $this->answer2 = $answer2;
34
+
35
+ $this->answer3 = $answer3;
36
+
37
+ $this->answer4 = $answer4;
38
+
39
+ $this->answer5 = $answer5;
40
+
41
+ $this->correctNo = $correctNo;
42
+
43
+ }
44
+
45
+
46
+
47
+ public function getQuestionNo(){
48
+
49
+ return $this->questionNo;
50
+
51
+ }
52
+
53
+
54
+
55
+ public function getSentence(){
56
+
57
+ return $this->sentence;
58
+
59
+ }
60
+
61
+
62
+
63
+ public function getAnswer1(){
64
+
65
+ return $this->answer1;
66
+
67
+ }
68
+
69
+ public function getAnswer2(){
70
+
71
+ return $this->answer2;
72
+
73
+ }
74
+
75
+ public function getAnswer3(){
76
+
77
+ return $this->answer3;
78
+
79
+ }
80
+
81
+ public function getAnswer4(){
82
+
83
+ return $this->answer4;
84
+
85
+ }
86
+
87
+ public function getAnswer5(){
88
+
89
+ return $this->answer5;
90
+
91
+ }
92
+
93
+
94
+
95
+ public function getCorrectNo(){
96
+
97
+ return $this->correctNo;
98
+
99
+ }
100
+
101
+
102
+
103
+ }
104
+
105
+
106
+
107
+ ?>
108
+
109
+ ```
110
+
1
111
  ```php
2
112
 
3
113
  <?php