From e47265badd7a9097ca5aacb017a59bd3f8d7845e Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 11 Jun 2025 15:41:37 -0500 Subject: [PATCH] EnterScore action working to add a total score when a score is saved by a judge. --- app/Actions/Tabulation/EnterScore.php | 3 ++- app/Models/ScoreSheet.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Actions/Tabulation/EnterScore.php b/app/Actions/Tabulation/EnterScore.php index ab7be4b..84d7a24 100644 --- a/app/Actions/Tabulation/EnterScore.php +++ b/app/Actions/Tabulation/EnterScore.php @@ -106,11 +106,12 @@ class EnterScore 'sheet_total' => ($scoreSheetTotal / $maxPossible) * 100, ]); } else { + $finalTotal = ($scoreSheetTotal / $maxPossible) * 100; $scoreSheet = ScoreSheet::create([ 'user_id' => $user->id, 'entry_id' => $entry->id, 'subscores' => $subscoresStorageArray, - 'sheet_total' => ($scoreSheetTotal / $maxPossible) * 100, + 'sheet_total' => $finalTotal, ]); } diff --git a/app/Models/ScoreSheet.php b/app/Models/ScoreSheet.php index b8b4698..7b9076e 100644 --- a/app/Models/ScoreSheet.php +++ b/app/Models/ScoreSheet.php @@ -13,6 +13,7 @@ class ScoreSheet extends Model 'user_id', 'entry_id', 'subscores', + 'sheet_total', ]; protected $casts = ['subscores' => 'json'];