From ca321ce2e49d32e4eb7738083e2ab55be8e7f700 Mon Sep 17 00:00:00 2001 From: RomanSteinberg <romanofficial@yandex.ru> Date: Tue, 13 Jan 2015 19:17:28 +0300 Subject: [PATCH] FIX: rates view in final form --- .../Controller/Handler/FileCreator.php | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/~dev_rating/application/classes/Controller/Handler/FileCreator.php b/~dev_rating/application/classes/Controller/Handler/FileCreator.php index 1db8ad75e..6e1ad25ae 100644 --- a/~dev_rating/application/classes/Controller/Handler/FileCreator.php +++ b/~dev_rating/application/classes/Controller/Handler/FileCreator.php @@ -479,27 +479,34 @@ class Controller_Handler_FileCreator extends Controller_Handler } // Определяет оценку по пятибальной системе - protected function formRateOfFive($rate, $examRateValue, $totalRateValue, $examHold) + protected function formRateOfFive($semesterRate, $examRateValue, $totalRateValue, $examHold) { $totalRate = ''; $rateOfFive = ''; $examRate = ''; if ($examHold != 0) + { $examRate = $examRateValue; - - if ($rate < 38) { - $totalRate = ' '; - $rateOfFive = 'неуд'; - if ($examHold == 0) + if (($semesterRate < 38) or ($examRateValue < 22)) { + $rateOfFive = 'неуд'; + } else { + $totalRate = $totalRateValue; + $rateOfFive = 'удовл'; + if (($totalRateValue >= 71) and ($totalRateValue < 85)) + $rateOfFive = 'хор'; + elseif ($totalRateValue >= 85) + $rateOfFive = 'отл'; + } + } + else + { + if ($semesterRate < 38) { // задолженник + $totalRate = ' '; + $rateOfFive = 'неуд'; $examRate = '0'; - } elseif (($rate >= 38) and ($examRateValue >= 22)) { - $totalRate = $totalRateValue; - $rateOfFive = 'удовл'; - if (($totalRateValue >= 71) and ($totalRateValue < 85)) - $rateOfFive = 'хор'; - elseif ($totalRateValue >= 85) - $rateOfFive = 'отл'; - } + } + } + return array($totalRate, $rateOfFive, $examRate); } -- GitLab