| Línea 63... |
Línea 63... |
| 63 |
$this->workshop = null;
|
63 |
$this->workshop = null;
|
| 64 |
$this->strategy = null;
|
64 |
$this->strategy = null;
|
| 65 |
parent::tearDown();
|
65 |
parent::tearDown();
|
| 66 |
}
|
66 |
}
|
| Línea 67... |
Línea 67... |
| 67 |
|
67 |
|
| 68 |
public function test_calculate_peer_grade_null_grade() {
|
68 |
public function test_calculate_peer_grade_null_grade(): void {
|
| 69 |
// fixture set-up
|
69 |
// fixture set-up
|
| 70 |
$this->strategy->dimensions = array();
|
70 |
$this->strategy->dimensions = array();
|
| 71 |
$this->strategy->mappings = array();
|
71 |
$this->strategy->mappings = array();
|
| 72 |
$grades = array();
|
72 |
$grades = array();
|
| 73 |
// exercise SUT
|
73 |
// exercise SUT
|
| 74 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
74 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 75 |
// validate
|
75 |
// validate
|
| 76 |
$this->assertNull($suggested);
|
76 |
$this->assertNull($suggested);
|
| Línea 77... |
Línea 77... |
| 77 |
}
|
77 |
}
|
| 78 |
|
78 |
|
| 79 |
public function test_calculate_peer_grade_no_error() {
|
79 |
public function test_calculate_peer_grade_no_error(): void {
|
| 80 |
// fixture set-up
|
80 |
// fixture set-up
|
| 81 |
$this->strategy->dimensions = array();
|
81 |
$this->strategy->dimensions = array();
|
| 82 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
82 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
| Línea 91... |
Línea 91... |
| 91 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
91 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 92 |
// validate
|
92 |
// validate
|
| 93 |
$this->assertEquals($suggested, 100.00000);
|
93 |
$this->assertEquals($suggested, 100.00000);
|
| 94 |
}
|
94 |
}
|
| Línea 95... |
Línea 95... |
| 95 |
|
95 |
|
| 96 |
public function test_calculate_peer_grade_one_error() {
|
96 |
public function test_calculate_peer_grade_one_error(): void {
|
| 97 |
// fixture set-up
|
97 |
// fixture set-up
|
| 98 |
$this->strategy->dimensions = array();
|
98 |
$this->strategy->dimensions = array();
|
| 99 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
99 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
| 100 |
$this->strategy->dimensions[109] = (object)array('weight' => '1');
|
100 |
$this->strategy->dimensions[109] = (object)array('weight' => '1');
|
| Línea 114... |
Línea 114... |
| 114 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
114 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 115 |
// validate
|
115 |
// validate
|
| 116 |
$this->assertEquals($suggested, 80.00000);
|
116 |
$this->assertEquals($suggested, 80.00000);
|
| 117 |
}
|
117 |
}
|
| Línea 118... |
Línea 118... |
| 118 |
|
118 |
|
| 119 |
public function test_calculate_peer_grade_three_errors_same_weight_a() {
|
119 |
public function test_calculate_peer_grade_three_errors_same_weight_a(): void {
|
| 120 |
// fixture set-up
|
120 |
// fixture set-up
|
| 121 |
$this->strategy->dimensions = array();
|
121 |
$this->strategy->dimensions = array();
|
| 122 |
$this->strategy->dimensions[108] = (object)array('weight' => '1.00000');
|
122 |
$this->strategy->dimensions[108] = (object)array('weight' => '1.00000');
|
| 123 |
$this->strategy->dimensions[109] = (object)array('weight' => '1.00000');
|
123 |
$this->strategy->dimensions[109] = (object)array('weight' => '1.00000');
|
| Línea 138... |
Línea 138... |
| 138 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
138 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 139 |
// validate
|
139 |
// validate
|
| 140 |
$this->assertEquals($suggested, 10.00000);
|
140 |
$this->assertEquals($suggested, 10.00000);
|
| 141 |
}
|
141 |
}
|
| Línea 142... |
Línea 142... |
| 142 |
|
142 |
|
| 143 |
public function test_calculate_peer_grade_three_errors_same_weight_b() {
|
143 |
public function test_calculate_peer_grade_three_errors_same_weight_b(): void {
|
| 144 |
// fixture set-up
|
144 |
// fixture set-up
|
| 145 |
$this->strategy->dimensions = array();
|
145 |
$this->strategy->dimensions = array();
|
| 146 |
$this->strategy->dimensions[108] = (object)array('weight' => '1.00000');
|
146 |
$this->strategy->dimensions[108] = (object)array('weight' => '1.00000');
|
| 147 |
$this->strategy->dimensions[109] = (object)array('weight' => '1.00000');
|
147 |
$this->strategy->dimensions[109] = (object)array('weight' => '1.00000');
|
| Línea 162... |
Línea 162... |
| 162 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
162 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 163 |
// validate
|
163 |
// validate
|
| 164 |
$this->assertEquals($suggested, 0.00000);
|
164 |
$this->assertEquals($suggested, 0.00000);
|
| 165 |
}
|
165 |
}
|
| Línea 166... |
Línea 166... |
| 166 |
|
166 |
|
| 167 |
public function test_calculate_peer_grade_one_error_weighted() {
|
167 |
public function test_calculate_peer_grade_one_error_weighted(): void {
|
| 168 |
// fixture set-up
|
168 |
// fixture set-up
|
| 169 |
$this->strategy->dimensions = array();
|
169 |
$this->strategy->dimensions = array();
|
| 170 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
170 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
| 171 |
$this->strategy->dimensions[109] = (object)array('weight' => '2');
|
171 |
$this->strategy->dimensions[109] = (object)array('weight' => '2');
|
| Línea 186... |
Línea 186... |
| 186 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
186 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 187 |
// validate
|
187 |
// validate
|
| 188 |
$this->assertEquals($suggested, 33.00000);
|
188 |
$this->assertEquals($suggested, 33.00000);
|
| 189 |
}
|
189 |
}
|
| Línea 190... |
Línea 190... |
| 190 |
|
190 |
|
| 191 |
public function test_calculate_peer_grade_zero_weight() {
|
191 |
public function test_calculate_peer_grade_zero_weight(): void {
|
| 192 |
// fixture set-up
|
192 |
// fixture set-up
|
| 193 |
$this->strategy->dimensions = array();
|
193 |
$this->strategy->dimensions = array();
|
| 194 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
194 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
| 195 |
$this->strategy->dimensions[109] = (object)array('weight' => '2');
|
195 |
$this->strategy->dimensions[109] = (object)array('weight' => '2');
|
| Línea 210... |
Línea 210... |
| 210 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
210 |
$suggested = $this->strategy->calculate_peer_grade($grades);
|
| 211 |
// validate
|
211 |
// validate
|
| 212 |
$this->assertEquals($suggested, 100.00000);
|
212 |
$this->assertEquals($suggested, 100.00000);
|
| 213 |
}
|
213 |
}
|
| Línea 214... |
Línea 214... |
| 214 |
|
214 |
|
| 215 |
public function test_calculate_peer_grade_sum_weight() {
|
215 |
public function test_calculate_peer_grade_sum_weight(): void {
|
| 216 |
// fixture set-up
|
216 |
// fixture set-up
|
| 217 |
$this->strategy->dimensions = array();
|
217 |
$this->strategy->dimensions = array();
|
| 218 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
218 |
$this->strategy->dimensions[108] = (object)array('weight' => '1');
|
| 219 |
$this->strategy->dimensions[109] = (object)array('weight' => '2');
|
219 |
$this->strategy->dimensions[109] = (object)array('weight' => '2');
|