Passed
Push — master ( 1cf373...d04f46 )
by Julito
09:24
created

GradebookEvaluation   A

Complexity

Total Complexity 31

Size/Duplication

Total Lines 459
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 64
c 0
b 0
f 0
dl 0
loc 459
rs 9.92
wmc 31

30 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 5 1
A getDescription() 0 3 1
A getScoreWeight() 0 3 1
A getId() 0 3 1
A getMax() 0 3 1
A getName() 0 3 1
A setType() 0 5 1
A setAverageScore() 0 5 1
A __construct() 0 3 1
A getLocked() 0 3 1
A setUserScoreList() 0 5 1
A setScoreWeight() 0 5 1
A setMax() 0 5 1
A getCategoryId() 0 3 1
A setCreatedAt() 0 5 1
A getType() 0 3 1
A getVisible() 0 3 1
A setVisible() 0 5 1
A getUserId() 0 3 1
A getUserScoreList() 0 7 2
A setDescription() 0 5 1
A getBestScore() 0 3 1
A getAverageScore() 0 3 1
A setUserId() 0 5 1
A setCategoryId() 0 5 1
A setWeight() 0 5 1
A getWeight() 0 3 1
A setBestScore() 0 5 1
A setLocked() 0 5 1
A getCreatedAt() 0 3 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CoreBundle\Entity;
6
7
use Chamilo\CoreBundle\Traits\CourseTrait;
8
use Doctrine\ORM\Mapping as ORM;
9
use Gedmo\Mapping\Annotation as Gedmo;
10
11
/**
12
 * GradebookEvaluation.
13
 *
14
 * @ORM\Table(name="gradebook_evaluation",
15
 *  indexes={
16
 *     @ORM\Index(name="idx_ge_cat", columns={"category_id"}),
17
 *  })
18
 * @ORM\Entity
19
 */
20
class GradebookEvaluation
21
{
22
    use CourseTrait;
23
24
    /**
25
     * @var int
26
     *
27
     * @ORM\Column(name="id", type="integer")
28
     * @ORM\Id
29
     * @ORM\GeneratedValue
30
     */
31
    protected $id;
32
33
    /**
34
     * @var string
35
     *
36
     * @ORM\Column(name="name", type="text", nullable=false)
37
     */
38
    protected $name;
39
40
    /**
41
     * @var string
42
     *
43
     * @ORM\Column(name="description", type="text", nullable=true)
44
     */
45
    protected $description;
46
47
    /**
48
     * @var int
49
     *
50
     * @ORM\Column(name="user_id", type="integer", nullable=false)
51
     */
52
    protected $userId;
53
54
    /**
55
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookEvaluations")
56
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id")
57
     */
58
    protected $course;
59
60
    /**
61
     * @var int
62
     *
63
     * @ORM\Column(name="category_id", type="integer", nullable=true)
64
     */
65
    protected $categoryId;
66
67
    /**
68
     * @var \DateTime
69
     *
70
     * @Gedmo\Timestampable(on="create")
71
     *
72
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
73
     */
74
    protected $createdAt;
75
76
    /**
77
     * @var float
78
     *
79
     * @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false)
80
     */
81
    protected $weight;
82
83
    /**
84
     * @var float
85
     *
86
     * @ORM\Column(name="max", type="float", precision=10, scale=0, nullable=false)
87
     */
88
    protected $max;
89
90
    /**
91
     * @var int
92
     *
93
     * @ORM\Column(name="visible", type="integer", nullable=false)
94
     */
95
    protected $visible;
96
97
    /**
98
     * @var string
99
     *
100
     * @ORM\Column(name="type", type="string", length=40, nullable=false)
101
     */
102
    protected $type;
103
104
    /**
105
     * @var int
106
     *
107
     * @ORM\Column(name="locked", type="integer", nullable=false)
108
     */
109
    protected $locked;
110
111
    /**
112
     * @var float
113
     *
114
     * @ORM\Column(name="best_score", type="float", precision=6, scale=2, nullable=true)
115
     */
116
    protected $bestScore;
117
118
    /**
119
     * @var float
120
     *
121
     * @ORM\Column(name="average_score", type="float", precision=6, scale=2, nullable=true)
122
     */
123
    protected $averageScore;
124
125
    /**
126
     * @var float
127
     *
128
     * @ORM\Column(name="score_weight", type="float", precision=6, scale=2, nullable=true)
129
     */
130
    protected $scoreWeight;
131
132
    /**
133
     * @var array
134
     *
135
     * @ORM\Column(name="user_score_list", type="array", nullable=true)
136
     */
137
    protected $userScoreList;
138
139
    /**
140
     * GradebookEvaluation constructor.
141
     */
142
    public function __construct()
143
    {
144
        $this->locked = 0;
145
    }
146
147
    /**
148
     * Set name.
149
     *
150
     * @param string $name
151
     *
152
     * @return GradebookEvaluation
153
     */
154
    public function setName($name)
155
    {
156
        $this->name = $name;
157
158
        return $this;
159
    }
160
161
    /**
162
     * Get name.
163
     *
164
     * @return string
165
     */
166
    public function getName()
167
    {
168
        return $this->name;
169
    }
170
171
    /**
172
     * Set description.
173
     *
174
     * @param string $description
175
     *
176
     * @return GradebookEvaluation
177
     */
178
    public function setDescription($description)
179
    {
180
        $this->description = $description;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get description.
187
     *
188
     * @return string
189
     */
190
    public function getDescription()
191
    {
192
        return $this->description;
193
    }
194
195
    /**
196
     * Set userId.
197
     *
198
     * @param int $userId
199
     *
200
     * @return GradebookEvaluation
201
     */
202
    public function setUserId($userId)
203
    {
204
        $this->userId = $userId;
205
206
        return $this;
207
    }
208
209
    /**
210
     * Get userId.
211
     *
212
     * @return int
213
     */
214
    public function getUserId()
215
    {
216
        return $this->userId;
217
    }
218
219
    /**
220
     * Set categoryId.
221
     *
222
     * @param int $categoryId
223
     *
224
     * @return GradebookEvaluation
225
     */
226
    public function setCategoryId($categoryId)
227
    {
228
        $this->categoryId = $categoryId;
229
230
        return $this;
231
    }
232
233
    /**
234
     * Get categoryId.
235
     *
236
     * @return int
237
     */
238
    public function getCategoryId()
239
    {
240
        return $this->categoryId;
241
    }
242
243
    /**
244
     * Set createdAt.
245
     *
246
     * @param \DateTime $createdAt
247
     *
248
     * @return GradebookEvaluation
249
     */
250
    public function setCreatedAt($createdAt)
251
    {
252
        $this->createdAt = $createdAt;
253
254
        return $this;
255
    }
256
257
    /**
258
     * Get createdAt.
259
     *
260
     * @return \DateTime
261
     */
262
    public function getCreatedAt()
263
    {
264
        return $this->createdAt;
265
    }
266
267
    /**
268
     * Set weight.
269
     *
270
     * @param float $weight
271
     *
272
     * @return GradebookEvaluation
273
     */
274
    public function setWeight($weight)
275
    {
276
        $this->weight = $weight;
277
278
        return $this;
279
    }
280
281
    /**
282
     * Get weight.
283
     *
284
     * @return float
285
     */
286
    public function getWeight()
287
    {
288
        return $this->weight;
289
    }
290
291
    /**
292
     * Set max.
293
     *
294
     * @param float $max
295
     *
296
     * @return GradebookEvaluation
297
     */
298
    public function setMax($max)
299
    {
300
        $this->max = $max;
301
302
        return $this;
303
    }
304
305
    /**
306
     * Get max.
307
     *
308
     * @return float
309
     */
310
    public function getMax()
311
    {
312
        return $this->max;
313
    }
314
315
    /**
316
     * Set visible.
317
     *
318
     * @param int $visible
319
     *
320
     * @return GradebookEvaluation
321
     */
322
    public function setVisible($visible)
323
    {
324
        $this->visible = $visible;
325
326
        return $this;
327
    }
328
329
    /**
330
     * Get visible.
331
     *
332
     * @return int
333
     */
334
    public function getVisible()
335
    {
336
        return $this->visible;
337
    }
338
339
    /**
340
     * Set type.
341
     *
342
     * @param string $type
343
     *
344
     * @return GradebookEvaluation
345
     */
346
    public function setType($type)
347
    {
348
        $this->type = $type;
349
350
        return $this;
351
    }
352
353
    /**
354
     * Get type.
355
     *
356
     * @return string
357
     */
358
    public function getType()
359
    {
360
        return $this->type;
361
    }
362
363
    /**
364
     * Set locked.
365
     *
366
     * @param int $locked
367
     *
368
     * @return GradebookEvaluation
369
     */
370
    public function setLocked($locked)
371
    {
372
        $this->locked = $locked;
373
374
        return $this;
375
    }
376
377
    /**
378
     * Get locked.
379
     *
380
     * @return int
381
     */
382
    public function getLocked()
383
    {
384
        return $this->locked;
385
    }
386
387
    /**
388
     * Get id.
389
     *
390
     * @return int
391
     */
392
    public function getId()
393
    {
394
        return $this->id;
395
    }
396
397
    /**
398
     * @return float
399
     */
400
    public function getBestScore()
401
    {
402
        return $this->bestScore;
403
    }
404
405
    /**
406
     * @param float $bestScore
407
     *
408
     * @return GradebookEvaluation
409
     */
410
    public function setBestScore($bestScore)
411
    {
412
        $this->bestScore = $bestScore;
413
414
        return $this;
415
    }
416
417
    /**
418
     * @return float
419
     */
420
    public function getAverageScore()
421
    {
422
        return $this->averageScore;
423
    }
424
425
    /**
426
     * @param float $averageScore
427
     *
428
     * @return GradebookEvaluation
429
     */
430
    public function setAverageScore($averageScore)
431
    {
432
        $this->averageScore = $averageScore;
433
434
        return $this;
435
    }
436
437
    /**
438
     * @return array
439
     */
440
    public function getUserScoreList()
441
    {
442
        if (empty($this->userScoreList)) {
443
            return [];
444
        }
445
446
        return $this->userScoreList;
447
    }
448
449
    /**
450
     * @param array $userScoreList
451
     *
452
     * @return GradebookEvaluation
453
     */
454
    public function setUserScoreList($userScoreList)
455
    {
456
        $this->userScoreList = $userScoreList;
457
458
        return $this;
459
    }
460
461
    /**
462
     * @return float
463
     */
464
    public function getScoreWeight()
465
    {
466
        return $this->scoreWeight;
467
    }
468
469
    /**
470
     * @param float $scoreWeight
471
     *
472
     * @return GradebookEvaluation
473
     */
474
    public function setScoreWeight($scoreWeight)
475
    {
476
        $this->scoreWeight = $scoreWeight;
477
478
        return $this;
479
    }
480
}
481