|
1
|
|
|
<?php |
|
2
|
|
|
/* For licensing terms, see /license.txt */ |
|
3
|
|
|
|
|
4
|
|
|
namespace Chamilo\CourseBundle\Entity; |
|
5
|
|
|
|
|
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* CQuizQuestion. |
|
10
|
|
|
* |
|
11
|
|
|
* @ORM\Table( |
|
12
|
|
|
* name="c_quiz_question", |
|
13
|
|
|
* indexes={ |
|
14
|
|
|
* @ORM\Index(name="course", columns={"c_id"}), |
|
15
|
|
|
* @ORM\Index(name="position", columns={"position"}) |
|
16
|
|
|
* } |
|
17
|
|
|
* ) |
|
18
|
|
|
* @ORM\Entity() |
|
19
|
|
|
*/ |
|
20
|
|
|
class CQuizQuestion |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @var int |
|
24
|
|
|
* |
|
25
|
|
|
* @ORM\Column(name="iid", type="integer") |
|
26
|
|
|
* @ORM\Id |
|
27
|
|
|
* @ORM\GeneratedValue |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $iid; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var int |
|
33
|
|
|
* |
|
34
|
|
|
* @ORM\Column(name="c_id", type="integer") |
|
35
|
|
|
*/ |
|
36
|
|
|
protected $cId; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var int |
|
40
|
|
|
* @deprecated Now using iid |
|
41
|
|
|
* @ORM\Column(name="id", type="integer", nullable=true) |
|
42
|
|
|
*/ |
|
43
|
|
|
protected $id; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @var string |
|
47
|
|
|
* |
|
48
|
|
|
* @ORM\Column(name="question", type="text", nullable=false) |
|
49
|
|
|
*/ |
|
50
|
|
|
protected $question; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @var string |
|
54
|
|
|
* |
|
55
|
|
|
* @ORM\Column(name="description", type="text", nullable=true) |
|
56
|
|
|
*/ |
|
57
|
|
|
protected $description; |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @var float |
|
61
|
|
|
* |
|
62
|
|
|
* @ORM\Column(name="ponderation", type="float", precision=6, scale=2, nullable=false, options={"default": 0}) |
|
63
|
|
|
*/ |
|
64
|
|
|
protected $ponderation; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @var int |
|
68
|
|
|
* |
|
69
|
|
|
* @ORM\Column(name="position", type="integer", nullable=false) |
|
70
|
|
|
*/ |
|
71
|
|
|
protected $position; |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @var int |
|
75
|
|
|
* |
|
76
|
|
|
* @ORM\Column(name="type", type="integer", nullable=false) |
|
77
|
|
|
*/ |
|
78
|
|
|
protected $type; |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @var string |
|
82
|
|
|
* |
|
83
|
|
|
* @ORM\Column(name="picture", type="string", length=50, nullable=true) |
|
84
|
|
|
*/ |
|
85
|
|
|
protected $picture; |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @var int |
|
89
|
|
|
* |
|
90
|
|
|
* @ORM\Column(name="level", type="integer", nullable=false) |
|
91
|
|
|
*/ |
|
92
|
|
|
protected $level; |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @var string |
|
96
|
|
|
* |
|
97
|
|
|
* @ORM\Column(name="extra", type="string", length=255, nullable=true) |
|
98
|
|
|
*/ |
|
99
|
|
|
protected $extra; |
|
100
|
|
|
|
|
101
|
|
|
/** |
|
102
|
|
|
* @var string |
|
103
|
|
|
* |
|
104
|
|
|
* @ORM\Column(name="question_code", type="string", length=10, nullable=true) |
|
105
|
|
|
*/ |
|
106
|
|
|
protected $questionCode; |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* CQuizQuestion constructor. |
|
110
|
|
|
*/ |
|
111
|
|
|
public function __construct() |
|
112
|
|
|
{ |
|
113
|
|
|
$this->ponderation = 0.0; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* Set question. |
|
118
|
|
|
* |
|
119
|
|
|
* @param string $question |
|
120
|
|
|
* |
|
121
|
|
|
* @return CQuizQuestion |
|
122
|
|
|
*/ |
|
123
|
|
|
public function setQuestion($question) |
|
124
|
|
|
{ |
|
125
|
|
|
$this->question = $question; |
|
126
|
|
|
|
|
127
|
|
|
return $this; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* Get question. |
|
132
|
|
|
* |
|
133
|
|
|
* @return string |
|
134
|
|
|
*/ |
|
135
|
|
|
public function getQuestion() |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->question; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* Set description. |
|
142
|
|
|
* |
|
143
|
|
|
* @param string $description |
|
144
|
|
|
* |
|
145
|
|
|
* @return CQuizQuestion |
|
146
|
|
|
*/ |
|
147
|
|
|
public function setDescription($description) |
|
148
|
|
|
{ |
|
149
|
|
|
$this->description = $description; |
|
150
|
|
|
|
|
151
|
|
|
return $this; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* Get description. |
|
156
|
|
|
* |
|
157
|
|
|
* @return string |
|
158
|
|
|
*/ |
|
159
|
|
|
public function getDescription() |
|
160
|
|
|
{ |
|
161
|
|
|
return $this->description; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* Set ponderation. |
|
166
|
|
|
* |
|
167
|
|
|
* @param float $ponderation |
|
168
|
|
|
* |
|
169
|
|
|
* @return CQuizQuestion |
|
170
|
|
|
*/ |
|
171
|
|
|
public function setPonderation($ponderation) |
|
172
|
|
|
{ |
|
173
|
|
|
$this->ponderation = $ponderation; |
|
174
|
|
|
|
|
175
|
|
|
return $this; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* Get ponderation. |
|
180
|
|
|
* |
|
181
|
|
|
* @return float |
|
182
|
|
|
*/ |
|
183
|
|
|
public function getPonderation() |
|
184
|
|
|
{ |
|
185
|
|
|
return $this->ponderation; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* Set position. |
|
190
|
|
|
* |
|
191
|
|
|
* @param int $position |
|
192
|
|
|
* |
|
193
|
|
|
* @return CQuizQuestion |
|
194
|
|
|
*/ |
|
195
|
|
|
public function setPosition($position) |
|
196
|
|
|
{ |
|
197
|
|
|
$this->position = $position; |
|
198
|
|
|
|
|
199
|
|
|
return $this; |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
/** |
|
203
|
|
|
* Get position. |
|
204
|
|
|
* |
|
205
|
|
|
* @return int |
|
206
|
|
|
*/ |
|
207
|
|
|
public function getPosition() |
|
208
|
|
|
{ |
|
209
|
|
|
return $this->position; |
|
210
|
|
|
} |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* Set type. |
|
214
|
|
|
* |
|
215
|
|
|
* @param int $type |
|
216
|
|
|
* |
|
217
|
|
|
* @return CQuizQuestion |
|
218
|
|
|
*/ |
|
219
|
|
|
public function setType($type) |
|
220
|
|
|
{ |
|
221
|
|
|
$this->type = $type; |
|
222
|
|
|
|
|
223
|
|
|
return $this; |
|
224
|
|
|
} |
|
225
|
|
|
|
|
226
|
|
|
/** |
|
227
|
|
|
* Get type. |
|
228
|
|
|
* |
|
229
|
|
|
* @return int |
|
230
|
|
|
*/ |
|
231
|
|
|
public function getType() |
|
232
|
|
|
{ |
|
233
|
|
|
return $this->type; |
|
234
|
|
|
} |
|
235
|
|
|
|
|
236
|
|
|
/** |
|
237
|
|
|
* Set picture. |
|
238
|
|
|
* |
|
239
|
|
|
* @param string $picture |
|
240
|
|
|
* |
|
241
|
|
|
* @return CQuizQuestion |
|
242
|
|
|
*/ |
|
243
|
|
|
public function setPicture($picture) |
|
244
|
|
|
{ |
|
245
|
|
|
$this->picture = $picture; |
|
246
|
|
|
|
|
247
|
|
|
return $this; |
|
248
|
|
|
} |
|
249
|
|
|
|
|
250
|
|
|
/** |
|
251
|
|
|
* Get picture. |
|
252
|
|
|
* |
|
253
|
|
|
* @return string |
|
254
|
|
|
*/ |
|
255
|
|
|
public function getPicture() |
|
256
|
|
|
{ |
|
257
|
|
|
return $this->picture; |
|
258
|
|
|
} |
|
259
|
|
|
|
|
260
|
|
|
/** |
|
261
|
|
|
* Set level. |
|
262
|
|
|
* |
|
263
|
|
|
* @param int $level |
|
264
|
|
|
* |
|
265
|
|
|
* @return CQuizQuestion |
|
266
|
|
|
*/ |
|
267
|
|
|
public function setLevel($level) |
|
268
|
|
|
{ |
|
269
|
|
|
$this->level = $level; |
|
270
|
|
|
|
|
271
|
|
|
return $this; |
|
272
|
|
|
} |
|
273
|
|
|
|
|
274
|
|
|
/** |
|
275
|
|
|
* Get level. |
|
276
|
|
|
* |
|
277
|
|
|
* @return int |
|
278
|
|
|
*/ |
|
279
|
|
|
public function getLevel() |
|
280
|
|
|
{ |
|
281
|
|
|
return $this->level; |
|
282
|
|
|
} |
|
283
|
|
|
|
|
284
|
|
|
/** |
|
285
|
|
|
* Set extra. |
|
286
|
|
|
* |
|
287
|
|
|
* @param string $extra |
|
288
|
|
|
* |
|
289
|
|
|
* @return CQuizQuestion |
|
290
|
|
|
*/ |
|
291
|
|
|
public function setExtra($extra) |
|
292
|
|
|
{ |
|
293
|
|
|
$this->extra = $extra; |
|
294
|
|
|
|
|
295
|
|
|
return $this; |
|
296
|
|
|
} |
|
297
|
|
|
|
|
298
|
|
|
/** |
|
299
|
|
|
* Get extra. |
|
300
|
|
|
* |
|
301
|
|
|
* @return string |
|
302
|
|
|
*/ |
|
303
|
|
|
public function getExtra() |
|
304
|
|
|
{ |
|
305
|
|
|
return $this->extra; |
|
306
|
|
|
} |
|
307
|
|
|
|
|
308
|
|
|
/** |
|
309
|
|
|
* Set questionCode. |
|
310
|
|
|
* |
|
311
|
|
|
* @param string $questionCode |
|
312
|
|
|
* |
|
313
|
|
|
* @return CQuizQuestion |
|
314
|
|
|
*/ |
|
315
|
|
|
public function setQuestionCode($questionCode) |
|
316
|
|
|
{ |
|
317
|
|
|
$this->questionCode = $questionCode; |
|
318
|
|
|
|
|
319
|
|
|
return $this; |
|
320
|
|
|
} |
|
321
|
|
|
|
|
322
|
|
|
/** |
|
323
|
|
|
* Get questionCode. |
|
324
|
|
|
* |
|
325
|
|
|
* @return string |
|
326
|
|
|
*/ |
|
327
|
|
|
public function getQuestionCode() |
|
328
|
|
|
{ |
|
329
|
|
|
return $this->questionCode; |
|
330
|
|
|
} |
|
331
|
|
|
|
|
332
|
|
|
/** |
|
333
|
|
|
* Set id. |
|
334
|
|
|
* |
|
335
|
|
|
* @param int $iid |
|
336
|
|
|
* |
|
337
|
|
|
* @return CQuizQuestion |
|
338
|
|
|
*/ |
|
339
|
|
|
public function setId($iid) |
|
340
|
|
|
{ |
|
341
|
|
|
$this->iid = $iid; |
|
342
|
|
|
|
|
343
|
|
|
return $this; |
|
344
|
|
|
} |
|
345
|
|
|
|
|
346
|
|
|
/** |
|
347
|
|
|
* Get id. |
|
348
|
|
|
* |
|
349
|
|
|
* @return int |
|
350
|
|
|
*/ |
|
351
|
|
|
public function getId() |
|
352
|
|
|
{ |
|
353
|
|
|
return $this->iid; |
|
354
|
|
|
} |
|
355
|
|
|
|
|
356
|
|
|
/** |
|
357
|
|
|
* Set cId. |
|
358
|
|
|
* |
|
359
|
|
|
* @param int $cId |
|
360
|
|
|
* |
|
361
|
|
|
* @return CQuizQuestion |
|
362
|
|
|
*/ |
|
363
|
|
|
public function setCId($cId) |
|
364
|
|
|
{ |
|
365
|
|
|
$this->cId = $cId; |
|
366
|
|
|
|
|
367
|
|
|
return $this; |
|
368
|
|
|
} |
|
369
|
|
|
|
|
370
|
|
|
/** |
|
371
|
|
|
* Get cId. |
|
372
|
|
|
* |
|
373
|
|
|
* @return int |
|
374
|
|
|
*/ |
|
375
|
|
|
public function getCId() |
|
376
|
|
|
{ |
|
377
|
|
|
return $this->cId; |
|
378
|
|
|
} |
|
379
|
|
|
} |
|
380
|
|
|
|