Passed
Pull Request — 1.11.x (#3871)
by Angel Fernando Quiroz
10:43
created

CQuiz::setIid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
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 Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * CQuiz.
10
 *
11
 * @ORM\Table(
12
 *  name="c_quiz",
13
 *  indexes={
14
 *      @ORM\Index(name="course", columns={"c_id"}),
15
 *      @ORM\Index(name="session_id", columns={"session_id"})
16
 *  }
17
 * )
18
 * @ORM\Entity
19
 */
20
class CQuiz
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
     * @deprecated Now using iid
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="title", type="string", length=255, nullable=false)
49
     */
50
    protected $title;
51
52
    /**
53
     * @var string
54
     *
55
     * @ORM\Column(name="description", type="text", nullable=true)
56
     */
57
    protected $description;
58
59
    /**
60
     * @var string
61
     *
62
     * @ORM\Column(name="sound", type="string", length=255, nullable=true)
63
     */
64
    protected $sound;
65
66
    /**
67
     * @var bool
68
     *
69
     * @ORM\Column(name="type", type="boolean", nullable=false)
70
     */
71
    protected $type;
72
73
    /**
74
     * @var int
75
     *
76
     * @ORM\Column(name="random", type="integer", nullable=false)
77
     */
78
    protected $random;
79
80
    /**
81
     * @var bool
82
     *
83
     * @ORM\Column(name="random_answers", type="boolean", nullable=false)
84
     */
85
    protected $randomAnswers;
86
87
    /**
88
     * @var bool
89
     *
90
     * @ORM\Column(name="active", type="boolean", nullable=false)
91
     */
92
    protected $active;
93
94
    /**
95
     * @var int
96
     *
97
     * @ORM\Column(name="results_disabled", type="integer", nullable=false)
98
     */
99
    protected $resultsDisabled;
100
101
    /**
102
     * @var string
103
     *
104
     * @ORM\Column(name="access_condition", type="text", nullable=true)
105
     */
106
    protected $accessCondition;
107
108
    /**
109
     * @var int
110
     *
111
     * @ORM\Column(name="max_attempt", type="integer", nullable=false)
112
     */
113
    protected $maxAttempt;
114
115
    /**
116
     * @var \DateTime
117
     *
118
     * @ORM\Column(name="start_time", type="datetime", nullable=true)
119
     */
120
    protected $startTime;
121
122
    /**
123
     * @var \DateTime
124
     *
125
     * @ORM\Column(name="end_time", type="datetime", nullable=true)
126
     */
127
    protected $endTime;
128
129
    /**
130
     * @var int
131
     *
132
     * @ORM\Column(name="feedback_type", type="integer", nullable=false)
133
     */
134
    protected $feedbackType;
135
136
    /**
137
     * @var int
138
     *
139
     * @ORM\Column(name="expired_time", type="integer", nullable=false)
140
     */
141
    protected $expiredTime;
142
143
    /**
144
     * @var int
145
     *
146
     * @ORM\Column(name="session_id", type="integer", nullable=true)
147
     */
148
    protected $sessionId;
149
150
    /**
151
     * @var int
152
     *
153
     * @ORM\Column(name="propagate_neg", type="integer", nullable=false)
154
     */
155
    protected $propagateNeg;
156
157
    /**
158
     * @var bool
159
     * @ORm\Column(name="save_correct_answers", type="boolean", nullable=false)
160
     */
161
    protected $saveCorrectAnswers;
162
163
    /**
164
     * @var int
165
     *
166
     * @ORM\Column(name="review_answers", type="integer", nullable=false)
167
     */
168
    protected $reviewAnswers;
169
170
    /**
171
     * @var int
172
     *
173
     * @ORM\Column(name="random_by_category", type="integer", nullable=false)
174
     */
175
    protected $randomByCategory;
176
177
    /**
178
     * @var string
179
     *
180
     * @ORM\Column(name="text_when_finished", type="text", nullable=true)
181
     */
182
    protected $textWhenFinished;
183
184
    /**
185
     * @var int
186
     *
187
     * @ORM\Column(name="display_category_name", type="integer", nullable=false)
188
     */
189
    protected $displayCategoryName;
190
191
    /**
192
     * @var int
193
     *
194
     * @ORM\Column(name="pass_percentage", type="integer", nullable=true)
195
     */
196
    protected $passPercentage;
197
198
    /**
199
     * @var int
200
     *
201
     * @ORM\Column(name="question_selection_type", type="integer", nullable=true)
202
     */
203
    protected $questionSelectionType;
204
205
    /**
206
     * @var bool
207
     *
208
     * @ORM\Column(name="hide_question_title", type="boolean", nullable=true)
209
     */
210
    protected $hideQuestionTitle;
211
212
    /**
213
     * @var int
214
     *
215
     * ORM\Column(name="exercise_category_id", type="integer", nullable=true)
216
     */
217
    protected $exerciseCategoryId;
218
219
    /**
220
     * CQuiz constructor.
221
     */
222
    public function __construct()
223
    {
224
        $this->hideQuestionTitle = false;
225
    }
226
227
    /**
228
     * Set title.
229
     *
230
     * @param string $title
231
     *
232
     * @return CQuiz
233
     */
234
    public function setTitle($title)
235
    {
236
        $this->title = $title;
237
238
        return $this;
239
    }
240
241
    /**
242
     * Get title.
243
     *
244
     * @return string
245
     */
246
    public function getTitle()
247
    {
248
        return $this->title;
249
    }
250
251
    /**
252
     * Set description.
253
     *
254
     * @param string $description
255
     *
256
     * @return CQuiz
257
     */
258
    public function setDescription($description)
259
    {
260
        $this->description = $description;
261
262
        return $this;
263
    }
264
265
    /**
266
     * Get description.
267
     *
268
     * @return string
269
     */
270
    public function getDescription()
271
    {
272
        return $this->description;
273
    }
274
275
    /**
276
     * Set sound.
277
     *
278
     * @param string $sound
279
     *
280
     * @return CQuiz
281
     */
282
    public function setSound($sound)
283
    {
284
        $this->sound = $sound;
285
286
        return $this;
287
    }
288
289
    /**
290
     * Get sound.
291
     *
292
     * @return string
293
     */
294
    public function getSound()
295
    {
296
        return $this->sound;
297
    }
298
299
    /**
300
     * Set type.
301
     *
302
     * @param bool $type
303
     *
304
     * @return CQuiz
305
     */
306
    public function setType($type)
307
    {
308
        $this->type = $type;
309
310
        return $this;
311
    }
312
313
    /**
314
     * Get type.
315
     *
316
     * @return bool
317
     */
318
    public function getType()
319
    {
320
        return $this->type;
321
    }
322
323
    /**
324
     * Set random.
325
     *
326
     * @param int $random
327
     *
328
     * @return CQuiz
329
     */
330
    public function setRandom($random)
331
    {
332
        $this->random = $random;
333
334
        return $this;
335
    }
336
337
    /**
338
     * Get random.
339
     *
340
     * @return int
341
     */
342
    public function getRandom()
343
    {
344
        return $this->random;
345
    }
346
347
    /**
348
     * Set randomAnswers.
349
     *
350
     * @param bool $randomAnswers
351
     *
352
     * @return CQuiz
353
     */
354
    public function setRandomAnswers($randomAnswers)
355
    {
356
        $this->randomAnswers = $randomAnswers;
357
358
        return $this;
359
    }
360
361
    /**
362
     * Get randomAnswers.
363
     *
364
     * @return bool
365
     */
366
    public function getRandomAnswers()
367
    {
368
        return $this->randomAnswers;
369
    }
370
371
    /**
372
     * Set active.
373
     *
374
     * @param bool $active
375
     *
376
     * @return CQuiz
377
     */
378
    public function setActive($active)
379
    {
380
        $this->active = $active;
381
382
        return $this;
383
    }
384
385
    /**
386
     * Get active.
387
     *
388
     * @return bool
389
     */
390
    public function getActive()
391
    {
392
        return $this->active;
393
    }
394
395
    /**
396
     * Set resultsDisabled.
397
     *
398
     * @param int $resultsDisabled
399
     *
400
     * @return CQuiz
401
     */
402
    public function setResultsDisabled($resultsDisabled)
403
    {
404
        $this->resultsDisabled = $resultsDisabled;
405
406
        return $this;
407
    }
408
409
    /**
410
     * Get resultsDisabled.
411
     *
412
     * @return int
413
     */
414
    public function getResultsDisabled()
415
    {
416
        return $this->resultsDisabled;
417
    }
418
419
    /**
420
     * Set accessCondition.
421
     *
422
     * @param string $accessCondition
423
     *
424
     * @return CQuiz
425
     */
426
    public function setAccessCondition($accessCondition)
427
    {
428
        $this->accessCondition = $accessCondition;
429
430
        return $this;
431
    }
432
433
    /**
434
     * Get accessCondition.
435
     *
436
     * @return string
437
     */
438
    public function getAccessCondition()
439
    {
440
        return $this->accessCondition;
441
    }
442
443
    /**
444
     * Set maxAttempt.
445
     *
446
     * @param int $maxAttempt
447
     *
448
     * @return CQuiz
449
     */
450
    public function setMaxAttempt($maxAttempt)
451
    {
452
        $this->maxAttempt = $maxAttempt;
453
454
        return $this;
455
    }
456
457
    /**
458
     * Get maxAttempt.
459
     *
460
     * @return int
461
     */
462
    public function getMaxAttempt()
463
    {
464
        return $this->maxAttempt;
465
    }
466
467
    /**
468
     * Set startTime.
469
     *
470
     * @param \DateTime $startTime
471
     *
472
     * @return CQuiz
473
     */
474
    public function setStartTime($startTime)
475
    {
476
        $this->startTime = $startTime;
477
478
        return $this;
479
    }
480
481
    /**
482
     * Get startTime.
483
     *
484
     * @return \DateTime
485
     */
486
    public function getStartTime()
487
    {
488
        return $this->startTime;
489
    }
490
491
    /**
492
     * Set endTime.
493
     *
494
     * @param \DateTime $endTime
495
     *
496
     * @return CQuiz
497
     */
498
    public function setEndTime($endTime)
499
    {
500
        $this->endTime = $endTime;
501
502
        return $this;
503
    }
504
505
    /**
506
     * Get endTime.
507
     *
508
     * @return \DateTime
509
     */
510
    public function getEndTime()
511
    {
512
        return $this->endTime;
513
    }
514
515
    /**
516
     * Set feedbackType.
517
     *
518
     * @param int $feedbackType
519
     *
520
     * @return CQuiz
521
     */
522
    public function setFeedbackType($feedbackType)
523
    {
524
        $this->feedbackType = $feedbackType;
525
526
        return $this;
527
    }
528
529
    /**
530
     * Get feedbackType.
531
     *
532
     * @return int
533
     */
534
    public function getFeedbackType()
535
    {
536
        return $this->feedbackType;
537
    }
538
539
    /**
540
     * Set expiredTime.
541
     *
542
     * @param int $expiredTime
543
     *
544
     * @return CQuiz
545
     */
546
    public function setExpiredTime($expiredTime)
547
    {
548
        $this->expiredTime = $expiredTime;
549
550
        return $this;
551
    }
552
553
    /**
554
     * Get expiredTime.
555
     *
556
     * @return int
557
     */
558
    public function getExpiredTime()
559
    {
560
        return $this->expiredTime;
561
    }
562
563
    /**
564
     * Set sessionId.
565
     *
566
     * @param int $sessionId
567
     *
568
     * @return CQuiz
569
     */
570
    public function setSessionId($sessionId)
571
    {
572
        $this->sessionId = $sessionId;
573
574
        return $this;
575
    }
576
577
    /**
578
     * Get sessionId.
579
     *
580
     * @return int
581
     */
582
    public function getSessionId()
583
    {
584
        return $this->sessionId;
585
    }
586
587
    /**
588
     * Set propagateNeg.
589
     *
590
     * @param int $propagateNeg
591
     *
592
     * @return CQuiz
593
     */
594
    public function setPropagateNeg($propagateNeg)
595
    {
596
        $this->propagateNeg = $propagateNeg;
597
598
        return $this;
599
    }
600
601
    /**
602
     * Get propagateNeg.
603
     *
604
     * @return int
605
     */
606
    public function getPropagateNeg()
607
    {
608
        return $this->propagateNeg;
609
    }
610
611
    /**
612
     * @param $saveCorrectAnswers boolean
613
     *
614
     * @return CQuiz
615
     */
616
    public function setSaveCorrectAnswers($saveCorrectAnswers)
617
    {
618
        $this->saveCorrectAnswers = $saveCorrectAnswers;
619
620
        return $this;
621
    }
622
623
    /**
624
     * @return bool
625
     */
626
    public function getSaveCorrectAnswers()
627
    {
628
        return $this->saveCorrectAnswers;
629
    }
630
631
    /**
632
     * Set reviewAnswers.
633
     *
634
     * @param int $reviewAnswers
635
     *
636
     * @return CQuiz
637
     */
638
    public function setReviewAnswers($reviewAnswers)
639
    {
640
        $this->reviewAnswers = $reviewAnswers;
641
642
        return $this;
643
    }
644
645
    /**
646
     * Get reviewAnswers.
647
     *
648
     * @return int
649
     */
650
    public function getReviewAnswers()
651
    {
652
        return $this->reviewAnswers;
653
    }
654
655
    /**
656
     * Set randomByCategory.
657
     *
658
     * @param int $randomByCategory
659
     *
660
     * @return CQuiz
661
     */
662
    public function setRandomByCategory($randomByCategory)
663
    {
664
        $this->randomByCategory = $randomByCategory;
665
666
        return $this;
667
    }
668
669
    /**
670
     * Get randomByCategory.
671
     *
672
     * @return int
673
     */
674
    public function getRandomByCategory()
675
    {
676
        return $this->randomByCategory;
677
    }
678
679
    /**
680
     * Set textWhenFinished.
681
     *
682
     * @param string $textWhenFinished
683
     *
684
     * @return CQuiz
685
     */
686
    public function setTextWhenFinished($textWhenFinished)
687
    {
688
        $this->textWhenFinished = $textWhenFinished;
689
690
        return $this;
691
    }
692
693
    /**
694
     * Get textWhenFinished.
695
     *
696
     * @return string
697
     */
698
    public function getTextWhenFinished()
699
    {
700
        return $this->textWhenFinished;
701
    }
702
703
    /**
704
     * Set displayCategoryName.
705
     *
706
     * @param int $displayCategoryName
707
     *
708
     * @return CQuiz
709
     */
710
    public function setDisplayCategoryName($displayCategoryName)
711
    {
712
        $this->displayCategoryName = $displayCategoryName;
713
714
        return $this;
715
    }
716
717
    /**
718
     * Get displayCategoryName.
719
     *
720
     * @return int
721
     */
722
    public function getDisplayCategoryName()
723
    {
724
        return $this->displayCategoryName;
725
    }
726
727
    /**
728
     * Set passPercentage.
729
     *
730
     * @param int $passPercentage
731
     *
732
     * @return CQuiz
733
     */
734
    public function setPassPercentage($passPercentage)
735
    {
736
        $this->passPercentage = $passPercentage;
737
738
        return $this;
739
    }
740
741
    /**
742
     * Get passPercentage.
743
     *
744
     * @return int
745
     */
746
    public function getPassPercentage()
747
    {
748
        return $this->passPercentage;
749
    }
750
751
    /**
752
     * Set id.
753
     *
754
     * @param int $iid
755
     *
756
     * @return CQuiz
757
     */
758
    public function setId($iid)
759
    {
760
        $this->iid = $iid;
761
762
        return $this;
763
    }
764
765
    /**
766
     * Get id.
767
     *
768
     * @return int
769
     */
770
    public function getId()
771
    {
772
        return $this->iid;
773
    }
774
775
    /**
776
     * Set cId.
777
     *
778
     * @param int $cId
779
     *
780
     * @return CQuiz
781
     */
782
    public function setCId($cId)
783
    {
784
        $this->cId = $cId;
0 ignored issues
show
Deprecated Code introduced by
The property Chamilo\CourseBundle\Entity\CQuiz::$cId has been deprecated: Now using iid ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

784
        /** @scrutinizer ignore-deprecated */ $this->cId = $cId;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
785
786
        return $this;
787
    }
788
789
    /**
790
     * Get cId.
791
     *
792
     * @return int
793
     */
794
    public function getCId()
795
    {
796
        return $this->cId;
0 ignored issues
show
Deprecated Code introduced by
The property Chamilo\CourseBundle\Entity\CQuiz::$cId has been deprecated: Now using iid ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

796
        return /** @scrutinizer ignore-deprecated */ $this->cId;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
797
    }
798
799
    /**
800
     * @return int
801
     */
802
    public function getQuestionSelectionType()
803
    {
804
        return $this->questionSelectionType;
805
    }
806
807
    /**
808
     * @param int $questionSelectionType
809
     *
810
     * @return CQuiz
811
     */
812
    public function setQuestionSelectionType($questionSelectionType)
813
    {
814
        $this->questionSelectionType = $questionSelectionType;
815
816
        return $this;
817
    }
818
819
    /**
820
     * @return bool
821
     */
822
    public function isHideQuestionTitle()
823
    {
824
        return $this->hideQuestionTitle;
825
    }
826
827
    /**
828
     * @param bool $hideQuestionTitle
829
     *
830
     * @return CQuiz
831
     */
832
    public function setHideQuestionTitle($hideQuestionTitle)
833
    {
834
        $this->hideQuestionTitle = $hideQuestionTitle;
835
836
        return $this;
837
    }
838
}
839