Completed
Push — master ( 5627cd...c7e907 )
by Julito
15:36
created

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