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'];