Rewrite tabulation #14

Merged
okorpheus merged 43 commits from rewrite-tabulation into master 2024-07-14 05:36:29 +00:00
3 changed files with 14 additions and 11 deletions
Showing only changes of commit 3c9a890be3 - Show all commits

View File

@ -46,7 +46,6 @@ class CalculateScoreSheetTotal
$finalScore = $scoreTotal / $weightsTotal;
// put $final score at the beginning of the $ScoreArray
array_unshift($scoreArray, $finalScore);
return $scoreArray;
}

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Tabulation;
use App\Actions\Tabulation\RankAuditionEntries;
use App\Http\Controllers\Controller;
use App\Models\Audition;
use App\Models\Entry;
@ -9,9 +10,10 @@ use Illuminate\Http\Request;
class AdvancementController extends Controller
{
public function __construct()
protected RankAuditionEntries $ranker;
public function __construct(RankAuditionEntries $ranker)
{
$this->ranker = $ranker;
}
public function status()
@ -51,7 +53,7 @@ class AdvancementController extends Controller
public function ranking(Request $request, Audition $audition)
{
$entries = $this->tabulationService->auditionEntries($audition->id, 'advancement');
$entries = $this->ranker->rank('advancement', $audition);
$entries->load('advancementVotes');
$scoringComplete = $entries->every(function ($entry) {

View File

@ -7,7 +7,6 @@
<x-table.th>Draw #</x-table.th>
<x-table.th>Student Name</x-table.th>
<x-table.th>Total Score</x-table.th>
<x-table.th>All Scores?</x-table.th>
<x-table.th>Votes</x-table.th>
@if($scoringComplete)
<x-table.th>Pass?</x-table.th>
@ -17,6 +16,13 @@
<x-table.body>
@foreach($entries as $entry)
@php
if ($entry->score_totals[0] < 0) {
$score = $entry->score_message;
} else {
$score = number_format($entry->score_totals[0] ?? 0,4);
}
@endphp
<tr>
<x-table.td>{{ $entry->rank }}</x-table.td>
<x-table.td>{{ $entry->id }}</x-table.td>
@ -25,12 +31,8 @@
<span>{{ $entry->student->full_name() }}</span>
<span class="text-xs text-gray-400">{{ $entry->student->school->name }}</span>
</x-table.td>
<x-table.td>{{ number_format($entry->final_score_array[0] ?? 0,4) }}</x-table.td>
<x-table.td>
@if($entry->scoring_complete)
<x-icons.checkmark color="green"/>
@endif
</x-table.td>
<x-table.td>{{ $score }}</x-table.td>
<x-table.td class="flex space-x-1">
@foreach($entry->advancementVotes as $vote)
<div x-data="{ showJudgeName: false, timeout: null }"