Bladeren bron

Fix pass/fail counts on project page

Alan Lam 2 jaren geleden
bovenliggende
commit
e242f4297a
2 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 3 3
      controllers/project.php
  2. 3 3
      engine/test.php

+ 3 - 3
controllers/project.php

@@ -33,8 +33,8 @@ $pending_verification_test_count = count($pending_verification_tests);
 $completed_tests = array_filter($tests, function($test) { return $test->status == Test::STATUS_COMPLETED; });
 $completed_test_count = count($completed_tests);
 
-$pass_count = count(array_filter($tests, function($test) { return $test->pass === "1"; }));
-$fail_count = count(array_filter($tests, function($test) { return $test->pass === "0"; }));
+$pass_count = count(array_filter($tests, function($test) { return $test->pass === 1; }));
+$fail_count = count(array_filter($tests, function($test) { return $test->pass === 0; }));
 $pass_fail_count = $pass_count + $fail_count;
 
 $pass_percentage = 0;
@@ -67,4 +67,4 @@ View::include("project", compact("project", "tests", "latitude", "longitude", "c
 View::include("modal_assign_tester");
 View::includeOnce("footer");
 
-?>
+?>

+ 3 - 3
engine/test.php

@@ -33,9 +33,9 @@ use Mpdf\Mpdf;
  * @property string $dts_tester_invoice_paid
  * @property int $verifier_id
  * @property string $verifier_notes
- * @property bool $pass
- * @property bool $retest
- * @property bool $void
+ * @property int $pass
+ * @property int $retest
+ * @property int $void
  * @property string $void_notes
  * @property string $dts_created
  * @property string $dts_updated