Spaces:
Sleeping
Sleeping
Fix grader
Browse files- tasks/easy.py +6 -5
- tasks/hard.py +6 -6
- tasks/medium.py +6 -5
tasks/easy.py
CHANGED
|
@@ -167,11 +167,12 @@ class EasyTaskGrader:
|
|
| 167 |
return 0.5
|
| 168 |
|
| 169 |
raw = self.correct_actions / self.total_actions
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
| 175 |
|
| 176 |
|
| 177 |
def passed(self) -> bool:
|
|
|
|
| 167 |
return 0.5
|
| 168 |
|
| 169 |
raw = self.correct_actions / self.total_actions
|
| 170 |
+
rraw=round(raw,2)
|
| 171 |
+
if rraw == 0.00:
|
| 172 |
+
return 0.01
|
| 173 |
+
if rraw == 1.00:
|
| 174 |
+
return 0.99
|
| 175 |
+
return float(rraw)
|
| 176 |
|
| 177 |
|
| 178 |
def passed(self) -> bool:
|
tasks/hard.py
CHANGED
|
@@ -387,12 +387,12 @@ class HardTaskGrader:
|
|
| 387 |
|
| 388 |
stability = self._stability_score(self._system_failures)
|
| 389 |
final_base = max(0.0, min(raw * stability, 1.0))
|
| 390 |
-
|
| 391 |
-
if
|
| 392 |
-
return 0.
|
| 393 |
-
if
|
| 394 |
-
return 0.
|
| 395 |
-
return float(
|
| 396 |
|
| 397 |
|
| 398 |
def passed(self) -> bool:
|
|
|
|
| 387 |
|
| 388 |
stability = self._stability_score(self._system_failures)
|
| 389 |
final_base = max(0.0, min(raw * stability, 1.0))
|
| 390 |
+
rfinal=round(final_base,2)
|
| 391 |
+
if rfinal == 0.0:
|
| 392 |
+
return 0.01
|
| 393 |
+
if rfinal == 1.00:
|
| 394 |
+
return 0.99
|
| 395 |
+
return float(rfinal)
|
| 396 |
|
| 397 |
|
| 398 |
def passed(self) -> bool:
|
tasks/medium.py
CHANGED
|
@@ -212,11 +212,12 @@ class MediumTaskGrader:
|
|
| 212 |
miss_penalty = _CRITICAL_MISS_PENALTY_WEIGHT * miss_rate
|
| 213 |
|
| 214 |
base_score = max(0.0, raw - fp_penalty - miss_penalty)
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
|
|
|
| 220 |
|
| 221 |
|
| 222 |
def passed(self) -> bool:
|
|
|
|
| 212 |
miss_penalty = _CRITICAL_MISS_PENALTY_WEIGHT * miss_rate
|
| 213 |
|
| 214 |
base_score = max(0.0, raw - fp_penalty - miss_penalty)
|
| 215 |
+
rbase=round(base_score,2)
|
| 216 |
+
if rbase == 0.00:
|
| 217 |
+
return 0.01
|
| 218 |
+
if rbase == 1.00:
|
| 219 |
+
return 0.99
|
| 220 |
+
return float(rbase)
|
| 221 |
|
| 222 |
|
| 223 |
def passed(self) -> bool:
|