1 | <?php |
||
20 | final class Result |
||
21 | { |
||
22 | /** |
||
23 | * @var Score The score |
||
24 | */ |
||
25 | private $score; |
||
26 | |||
27 | /** |
||
28 | * @var bool Indicates whether or not the attempt was successful |
||
29 | */ |
||
30 | private $success; |
||
31 | |||
32 | /** |
||
33 | * @var bool Indicates whether or not the Activity was completed |
||
34 | */ |
||
35 | private $completion; |
||
36 | |||
37 | /** |
||
38 | * @var string A response for the given Activity |
||
39 | */ |
||
40 | private $response; |
||
41 | |||
42 | /** |
||
43 | * @var string Period of time over which the Activity was performed |
||
44 | */ |
||
45 | private $duration; |
||
46 | |||
47 | /** |
||
48 | * @param Score $score |
||
49 | * @param bool $success |
||
50 | * @param bool $completion |
||
51 | * @param string|null $response |
||
52 | * @param string|null $duration |
||
53 | */ |
||
54 | public function __construct(Score $score, $success, $completion, $response = null, $duration = null) |
||
62 | |||
63 | /** |
||
64 | * Returns the user's score. |
||
65 | * |
||
66 | * @return Score The score |
||
67 | */ |
||
68 | public function getScore() |
||
72 | |||
73 | /** |
||
74 | * Returns whether or not the user finished a task successfully. |
||
75 | * |
||
76 | * @return bool True if the user finished an exercise successfully, false |
||
77 | * otherwise |
||
78 | */ |
||
79 | public function getSuccess() |
||
83 | |||
84 | /** |
||
85 | * Returns the completion status. |
||
86 | * |
||
87 | * @return bool $completion True, if the Activity was completed, false |
||
88 | * otherwise |
||
89 | */ |
||
90 | public function getCompletion() |
||
94 | |||
95 | /** |
||
96 | * Returns the response. |
||
97 | * |
||
98 | * @return string The response |
||
99 | */ |
||
100 | public function getResponse() |
||
104 | |||
105 | /** |
||
106 | * Returns the period of time over which the Activity was performed. |
||
107 | * |
||
108 | * @return string The duration |
||
109 | */ |
||
110 | public function getDuration() |
||
114 | |||
115 | /** |
||
116 | * Checks if another result is equal. |
||
117 | * |
||
118 | * Two results are equal if and only if all of their properties are equal. |
||
119 | * |
||
120 | * @param Result $result The result to compare with |
||
121 | * |
||
122 | * @return bool True if the results are equal, false otherwise |
||
123 | */ |
||
124 | public function equals(Result $result) |
||
148 | } |
||
149 |