Completed
Push — 1.10.x ( 484d85...fbe198 )
by Julito
35:25
created

CQuizAnswer::getIid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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
 * CQuizAnswer
10
 *
11
 * @ORM\Table(
12
 *  name="c_quiz_answer",
13
 *  indexes={
14
 *      @ORM\Index(name="c_id", columns={"c_id"}),
15
 *      @ORM\Index(name="idx_cqa_q", columns={"question_id"})
16
 *  }
17
 * )
18
 * @ORM\Entity
19
 */
20
class CQuizAnswer
21
{
22
    /**
23
     * @var integer
24
     *
25
     * @ORM\Column(name="iid", type="integer", options={"unsigned": true})
26
     * @ORM\Id
27
     * @ORM\GeneratedValue
28
     */
29
    private $iid;
30
31
    /**
32
     * @var integer
33
     *
34
     * @ORM\Column(name="id_auto", type="integer", options={"unsigned": true, "default": null})
35
     */
36
    private $idAuto;
37
38
    /**
39
     * @var integer
40
     *
41
     * @ORM\Column(name="c_id", type="integer", options={"unsigned": true, "default": null})
42
     */
43
    private $cId;
44
45
    /**
46
     * @var integer
47
     *
48
     * @ORM\Column(name="id", type="integer", nullable=true)
49
     */
50
    private $id;
51
52
    /**
53
     * @var integer
54
     *
55
     * @ORM\Column(name="question_id", type="integer", nullable=false)
56
     */
57
    private $questionId;
58
59
    /**
60
     * @var string
61
     *
62
     * @ORM\Column(name="answer", type="text", nullable=false)
63
     */
64
    private $answer;
65
66
    /**
67
     * @var integer
68
     *
69
     * @ORM\Column(name="correct", type="integer", nullable=true)
70
     */
71
    private $correct;
72
73
    /**
74
     * @var string
75
     *
76
     * @ORM\Column(name="comment", type="text", nullable=true)
77
     */
78
    private $comment;
79
80
    /**
81
     * @var float
82
     *
83
     * @ORM\Column(name="ponderation", type="float", precision=6, scale=2, nullable=false)
84
     */
85
    private $ponderation;
86
87
    /**
88
     * @var integer
89
     *
90
     * @ORM\Column(name="position", type="integer", nullable=false)
91
     */
92
    private $position;
93
94
    /**
95
     * @var string
96
     *
97
     * @ORM\Column(name="hotspot_coordinates", type="text", nullable=true)
98
     */
99
    private $hotspotCoordinates;
100
101
    /**
102
     * @var string
103
     *
104
     * @ORM\Column(name="hotspot_type", type="string", length=40, nullable=true)
105
     */
106
    private $hotspotType;
107
108
    /**
109
     * @var string
110
     *
111
     * @ORM\Column(name="destination", type="text", nullable=false)
112
     */
113
    private $destination;
114
115
    /**
116
     * @var string
117
     *
118
     * @ORM\Column(name="answer_code", type="string", length=10, nullable=true)
119
     */
120
    private $answerCode;
121
122
    public function __construct()
123
    {
124
        $this->id = null;
125
        $this->idAuto = 0;
126
        $this->correct = null;
127
        $this->comment = null;
128
        $this->ponderation = 0;
0 ignored issues
show
Documentation Bug introduced by
The property $ponderation was declared of type double, but 0 is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
129
        $this->hotspotCoordinates = null;
130
        $this->hotspotType = null;
131
        $this->destination = '';
132
        $this->answerCode = null;
133
    }
134
135
    /**
136
     * Set id
137
     *
138
     * @param integer $id
139
     * @return CQuizAnswer
140
     */
141
    public function setId($id)
142
    {
143
        $this->id = $id;
144
145
        return $this;
146
    }
147
148
    /**
149
     * Get id
150
     *
151
     * @return integer
152
     */
153
    public function getId()
154
    {
155
        return $this->id;
156
    }
157
158
    /**
159
     * Set questionId
160
     *
161
     * @param integer $questionId
162
     * @return CQuizAnswer
163
     */
164
    public function setQuestionId($questionId)
165
    {
166
        $this->questionId = $questionId;
167
168
        return $this;
169
    }
170
171
    /**
172
     * Get questionId
173
     *
174
     * @return integer
175
     */
176
    public function getQuestionId()
177
    {
178
        return $this->questionId;
179
    }
180
181
    /**
182
     * Set answer
183
     *
184
     * @param string $answer
185
     * @return CQuizAnswer
186
     */
187
    public function setAnswer($answer)
188
    {
189
        $this->answer = $answer;
190
191
        return $this;
192
    }
193
194
    /**
195
     * Get answer
196
     *
197
     * @return string
198
     */
199
    public function getAnswer()
200
    {
201
        return $this->answer;
202
    }
203
204
    /**
205
     * Set correct
206
     *
207
     * @param integer $correct
208
     * @return CQuizAnswer
209
     */
210
    public function setCorrect($correct)
211
    {
212
        $this->correct = $correct;
213
214
        return $this;
215
    }
216
217
    /**
218
     * Get correct
219
     *
220
     * @return integer
221
     */
222
    public function getCorrect()
223
    {
224
        return $this->correct;
225
    }
226
227
    /**
228
     * Set comment
229
     *
230
     * @param string $comment
231
     * @return CQuizAnswer
232
     */
233
    public function setComment($comment)
234
    {
235
        $this->comment = $comment;
236
237
        return $this;
238
    }
239
240
    /**
241
     * Get comment
242
     *
243
     * @return string
244
     */
245
    public function getComment()
246
    {
247
        return $this->comment;
248
    }
249
250
    /**
251
     * Set ponderation
252
     *
253
     * @param float $ponderation
254
     * @return CQuizAnswer
255
     */
256
    public function setPonderation($ponderation)
257
    {
258
        $this->ponderation = $ponderation;
259
260
        return $this;
261
    }
262
263
    /**
264
     * Get ponderation
265
     *
266
     * @return float
267
     */
268
    public function getPonderation()
269
    {
270
        return $this->ponderation;
271
    }
272
273
    /**
274
     * Set position
275
     *
276
     * @param integer $position
277
     * @return CQuizAnswer
278
     */
279
    public function setPosition($position)
280
    {
281
        $this->position = $position;
282
283
        return $this;
284
    }
285
286
    /**
287
     * Get position
288
     *
289
     * @return integer
290
     */
291
    public function getPosition()
292
    {
293
        return $this->position;
294
    }
295
296
    /**
297
     * Set hotspotCoordinates
298
     *
299
     * @param string $hotspotCoordinates
300
     * @return CQuizAnswer
301
     */
302
    public function setHotspotCoordinates($hotspotCoordinates)
303
    {
304
        $this->hotspotCoordinates = $hotspotCoordinates;
305
306
        return $this;
307
    }
308
309
    /**
310
     * Get hotspotCoordinates
311
     *
312
     * @return string
313
     */
314
    public function getHotspotCoordinates()
315
    {
316
        return $this->hotspotCoordinates;
317
    }
318
319
    /**
320
     * Set hotspotType
321
     *
322
     * @param string $hotspotType
323
     * @return CQuizAnswer
324
     */
325
    public function setHotspotType($hotspotType)
326
    {
327
        $this->hotspotType = $hotspotType;
328
329
        return $this;
330
    }
331
332
    /**
333
     * Get hotspotType
334
     *
335
     * @return string
336
     */
337
    public function getHotspotType()
338
    {
339
        return $this->hotspotType;
340
    }
341
342
    /**
343
     * Set destination
344
     *
345
     * @param string $destination
346
     * @return CQuizAnswer
347
     */
348
    public function setDestination($destination)
349
    {
350
        $this->destination = $destination;
351
352
        return $this;
353
    }
354
355
    /**
356
     * Get destination
357
     *
358
     * @return string
359
     */
360
    public function getDestination()
361
    {
362
        return $this->destination;
363
    }
364
365
    /**
366
     * Set answerCode
367
     *
368
     * @param string $answerCode
369
     * @return CQuizAnswer
370
     */
371
    public function setAnswerCode($answerCode)
372
    {
373
        $this->answerCode = $answerCode;
374
375
        return $this;
376
    }
377
378
    /**
379
     * Get answerCode
380
     *
381
     * @return string
382
     */
383
    public function getAnswerCode()
384
    {
385
        return $this->answerCode;
386
    }
387
388
    /**
389
     * Set idAuto
390
     *
391
     * @param integer $idAuto
392
     * @return CQuizAnswer
393
     */
394
    public function setIdAuto($idAuto)
395
    {
396
        $this->idAuto = $idAuto;
397
398
        return $this;
399
    }
400
401
    /**
402
     * Get idAuto
403
     *
404
     * @return integer
405
     */
406
    public function getIdAuto()
407
    {
408
        return $this->idAuto;
409
    }
410
411
    /**
412
     * Set cId
413
     *
414
     * @param integer $cId
415
     * @return CQuizAnswer
416
     */
417
    public function setCId($cId)
418
    {
419
        $this->cId = $cId;
420
421
        return $this;
422
    }
423
424
    /**
425
     * Get cId
426
     *
427
     * @return integer
428
     */
429
    public function getCId()
430
    {
431
        return $this->cId;
432
    }
433
434
    /**
435
     * Get iid
436
     * @return int
437
     */
438
    public function getIid()
439
    {
440
        return $this->iid;
441
    }
442
}
443