From 08b7bdcdf9c09db83d8d08b81f4d193aac1d0029 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A8=D0=B0=D0=BB=D0=B8?=
 =?UTF-8?q?=D0=BC=D0=BE=D0=B2?= <solidovic@gmail.com>
Date: Sun, 14 Dec 2014 18:49:09 +0300
Subject: [PATCH] fix fix fix fix fix fix fix fix fix fix fix fix fix fix fix
 fix

---
 .../classes/Controller/Teacher/Rating.php           | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/~dev_rating/application/classes/Controller/Teacher/Rating.php b/~dev_rating/application/classes/Controller/Teacher/Rating.php
index 4fe8b7982..cbb84b7d3 100644
--- a/~dev_rating/application/classes/Controller/Teacher/Rating.php
+++ b/~dev_rating/application/classes/Controller/Teacher/Rating.php
@@ -139,7 +139,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
 
         
         $structureHandled = array();
-        $maxRate = 0; $i = 1; $module = 0;
+        $maxRate = 0; $i = 1; $module = 0; $try_1 = 0; // try = 1 - экзамен, = 2, 3 - пересдачи
 
         foreach($structure as $row)
         {
@@ -163,7 +163,14 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
                 $twig->examSubmoduleID = $row['SubmoduleID'];
                     
             $structureHandled[$i][$j]['SubmoduleID'] = $row['SubmoduleID'];
-            $structureHandled[$i][$j]['Title'] = 'Попытка '.$j;
+            if ($row{'ModuleType'] == 'extra')
+                $structureHandled[$i][$j]['Title'] = 'Добор баллов';
+            else {
+                $try++;
+                if ($try > 1)
+                   $structureHandled[$i][$j]['Title'] = 'Пересдача '.($try - 1);
+                else  $structureHandled[$i][$j]['Title'] = 'Экзамен';
+            }
             //$structureHandled[$i][$j]['Description'] = $row['SubmoduleDescription']; // Описание
             $structureHandled[$i][$j]['MaxRate'] = (int) $row['MaxRate'];
             $maxRate += $row['MaxRate'];
@@ -222,7 +229,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
             }
         }
 
-        //echo debug::vars($structureHandled);
+        echo debug::vars($structure);
 
         $twig->rateTable = $rateHandled;
         $twig->groups = $groupsHandled;
-- 
GitLab