Completed
Push — master ( c6cfcb...a88956 )
by Julito
11:58
created

CQuizAnswer::getQuestionId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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