|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
|
6
|
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Entity; |
|
8
|
|
|
|
|
9
|
|
|
use Chamilo\CourseBundle\Entity\CQuizQuestion; |
|
10
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* UsergroupRelQuestion. |
|
14
|
|
|
* |
|
15
|
|
|
* @ORM\Table(name="usergroup_rel_question") |
|
16
|
|
|
* @ORM\Entity |
|
17
|
|
|
*/ |
|
18
|
|
|
class UsergroupRelQuestion |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* @ORM\Column(name="id", type="integer") |
|
22
|
|
|
* @ORM\Id |
|
23
|
|
|
* @ORM\GeneratedValue |
|
24
|
|
|
*/ |
|
25
|
|
|
protected int $id; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CQuizQuestion") |
|
29
|
|
|
* @ORM\JoinColumn(name="question_id", referencedColumnName="iid", onDelete="CASCADE") |
|
30
|
|
|
*/ |
|
31
|
|
|
protected CQuizQuestion $question; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Usergroup", inversedBy="questions") |
|
35
|
|
|
* @ORM\JoinColumn(name="usergroup_id", referencedColumnName="id", onDelete="CASCADE") |
|
36
|
|
|
*/ |
|
37
|
|
|
protected Usergroup $usergroup; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @ORM\Column(name="coefficient", type="float", precision=6, scale=2, nullable=true) |
|
41
|
|
|
*/ |
|
42
|
|
|
protected ?float $coefficient = null; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Get id. |
|
46
|
|
|
* |
|
47
|
|
|
* @return int |
|
48
|
|
|
*/ |
|
49
|
|
|
public function getId() |
|
50
|
|
|
{ |
|
51
|
|
|
return $this->id; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public function setCoefficient(float $coefficient): self |
|
55
|
|
|
{ |
|
56
|
|
|
$this->coefficient = $coefficient; |
|
57
|
|
|
|
|
58
|
|
|
return $this; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Get coefficient. |
|
63
|
|
|
* |
|
64
|
|
|
* @return float |
|
65
|
|
|
*/ |
|
66
|
|
|
public function getCoefficient() |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->coefficient; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
public function getQuestion(): CQuizQuestion |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->question; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function setQuestion(CQuizQuestion $question): self |
|
77
|
|
|
{ |
|
78
|
|
|
$this->question = $question; |
|
79
|
|
|
|
|
80
|
|
|
return $this; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function getUsergroup(): Usergroup |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->usergroup; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function setUsergroup(Usergroup $usergroup): self |
|
89
|
|
|
{ |
|
90
|
|
|
$this->usergroup = $usergroup; |
|
91
|
|
|
|
|
92
|
|
|
return $this; |
|
93
|
|
|
} |
|
94
|
|
|
} |
|
95
|
|
|
|