diff --git a/app/Actions/Tabulation/AllJudgesCount.php b/app/Actions/Tabulation/AllJudgesCount.php index e154359..f9bcb5e 100644 --- a/app/Actions/Tabulation/AllJudgesCount.php +++ b/app/Actions/Tabulation/AllJudgesCount.php @@ -31,6 +31,7 @@ class AllJudgesCount implements CalculateEntryScore $cacheKey = 'entryScore-'.$entry->id.'-'.$mode; return Cache::remember($cacheKey, 10, function () use ($mode, $entry) { + $this->isEntryANoShow($entry); $this->basicValidation($mode, $entry); $this->areAllJudgesIn($entry); $this->areAllJudgesValid($entry); @@ -88,4 +89,11 @@ class AllJudgesCount implements CalculateEntryScore throw new TabulationException('Score exists from a judge not assigned to this audition'); } } + + protected function isEntryANoShow(Entry $entry): void + { + if ($entry->hasFlag('no_show')) { + throw new TabulationException('No Show'); + } + } } diff --git a/app/Actions/Tabulation/AllowForOlympicScoring.php b/app/Actions/Tabulation/AllowForOlympicScoring.php index 16f2451..258b8bb 100644 --- a/app/Actions/Tabulation/AllowForOlympicScoring.php +++ b/app/Actions/Tabulation/AllowForOlympicScoring.php @@ -39,6 +39,7 @@ class AllowForOlympicScoring implements CalculateEntryScore return Cache::remember($cacheKey, 10, function () use ($mode, $entry) { $this->basicValidation($mode, $entry); + $this->isEntryANoShow($entry); $this->areAllJudgesIn($entry); $this->areAllJudgesValid($entry); @@ -134,4 +135,11 @@ class AllowForOlympicScoring implements CalculateEntryScore throw new TabulationException('Score exists from a judge not assigned to this audition'); } } + + protected function isEntryANoShow(Entry $entry): void + { + if ($entry->hasFlag('no_show')) { + throw new TabulationException('No Show'); + } + } } diff --git a/app/Actions/Tabulation/RankAuditionEntries.php b/app/Actions/Tabulation/RankAuditionEntries.php index aef64e3..f5619dd 100644 --- a/app/Actions/Tabulation/RankAuditionEntries.php +++ b/app/Actions/Tabulation/RankAuditionEntries.php @@ -8,6 +8,7 @@ use App\Exceptions\TabulationException; use App\Models\Audition; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Cache; + use function is_numeric; class RankAuditionEntries @@ -29,6 +30,12 @@ class RankAuditionEntries } + /** + * For a given audition, return a collection of entries ranked by total score. Each entry will have a + * property rank that either is their rank or a flag reflecting no-show, declined, or failed-prelim status + * + * @throws TabulationException + */ public function calculateRank(string $mode, Audition $audition): Collection { $this->basicValidation($mode, $audition); @@ -80,7 +87,6 @@ class RankAuditionEntries return $entries; } - protected function basicValidation($mode, Audition $audition): void { if ($mode !== 'seating' && $mode !== 'advancement') { diff --git a/app/Http/Controllers/Tabulation/SeatAuditionFormController.php b/app/Http/Controllers/Tabulation/SeatAuditionFormController.php index eb97dff..30355b6 100644 --- a/app/Http/Controllers/Tabulation/SeatAuditionFormController.php +++ b/app/Http/Controllers/Tabulation/SeatAuditionFormController.php @@ -62,6 +62,10 @@ class SeatAuditionFormController extends Controller $totalScoreColumn = $entry->score_totals[0] >= 0 ? $entry->score_totals[0] : $entry->score_message; $fullyScored = $entry->score_totals[0] >= 0; } + // No Shows are fully scored + if ($entry->hasFlag('no_show')) { + $fullyScored = true; + } $doublerData = $this->doublerService->entryDoublerData($entry); $entryData[] = [ 'rank' => $entry->rank,