Skip to content
Snippets Groups Projects
Commit 6fb1a750 authored by RomanSteinberg's avatar RomanSteinberg
Browse files

FIX: extra maxrate calculation

parent 03268a53
Branches
Tags
No related merge requests found
...@@ -2007,24 +2007,33 @@ CREATE FUNCTION `CalculateMaxRateForExtra` ...@@ -2007,24 +2007,33 @@ CREATE FUNCTION `CalculateMaxRateForExtra`
( `pSubmoduleID` INT, `pStudentID` INT) RETURNS int(11) ( `pSubmoduleID` INT, `pStudentID` INT) RETURNS int(11)
NO SQL NO SQL
BEGIN BEGIN
DECLARE vExamType INT; # enum('exam', 'credit');# utf8; DECLARE vExamType INT DEFAULT -1; # enum('exam', 'credit');# utf8;
DECLARE vLim INT; DECLARE vLim INT;
DECLARE vResult INT DEFAULT -1; DECLARE vResult INT DEFAULT 0;
IF vExamType = 'exam' THEN SELECT disciplines.ExamType INTO vExamType
FROM `submodules`
INNER JOIN `modules` ON modules.ID = submodules.ModuleID
INNER JOIN `disciplines` ON disciplines.ID = modules.DisciplineID
WHERE submodules.ID = pSubmoduleID
LIMIT 1;
IF vExamType = -1 THEN
RETURN -1;
ELSEIF vExamType = 1 THEN # exam
SET vLim = 38; SET vLim = 38;
ELSE ELSE # credit or grading_credit
SET vLim = 60; SET vLim = 60;
END IF; END IF;
SELECT vLim - view_rating_result.RateRegular INTO vResult SELECT view_rating_result.RateRegular INTO vResult
FROM `submodules` FROM `submodules`
INNER JOIN `modules` ON modules.ID = submodules.ModuleID INNER JOIN `modules` ON modules.ID = submodules.ModuleID
INNER JOIN view_rating_result ON view_rating_result.DisciplineID = modules.DisciplineID AND INNER JOIN view_rating_result ON view_rating_result.DisciplineID = modules.DisciplineID AND
view_rating_result.StudentID = pStudentID view_rating_result.StudentID = pStudentID
WHERE submodules.ID = pSubmoduleID WHERE submodules.ID = pSubmoduleID
LIMIT 1; LIMIT 1;
RETURN vResult; RETURN vLim - vResult;
END // END //
...@@ -2062,6 +2071,7 @@ BEGIN ...@@ -2062,6 +2071,7 @@ BEGIN
# 1) check rights # 1) check rights
# 2) check, you can't rate regular and bonus after milestone # 2) check, you can't rate regular and bonus after milestone
# 3) check, max rate exceeding
IF NOT InternalIsStudentAttached(pStudentID, vDisciplineID) OR IF NOT InternalIsStudentAttached(pStudentID, vDisciplineID) OR
NOT InternalIsTeacherBounded(pTeacherID, vDisciplineID) OR NOT InternalIsTeacherBounded(pTeacherID, vDisciplineID) OR
pRate > vMaxRate OR pRate > vMaxRate OR
......
...@@ -227,7 +227,7 @@ class Controller_Handler_FileCreator extends Controller_Handler ...@@ -227,7 +227,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
$controlDate = ""; $controlDate = "";
$range = $objPHPExcel->getNamedRange("Date")->getRange(); $range = $objPHPExcel->getNamedRange("Date")->getRange();
if ($disciplineType == 'credit') { if ($disciplineType == 'credit') {
$controlDate = "Дата зачета\n".$this->figureOutCreditDate($data['SemesterNum'], $data['Year']); $controlDate = "Дата зачета\n".$this->figureOutCreditDate($data['SemesterNum'], $startYear);
} elseif ($disciplineType == 'exam') { } elseif ($disciplineType == 'exam') {
$controlDate = "Дата экзамена\n__________"; $controlDate = "Дата экзамена\n__________";
} }
......
...@@ -29,8 +29,8 @@ class Controller_Teacher_Rating extends Controller_UserEnvironment { ...@@ -29,8 +29,8 @@ class Controller_Teacher_Rating extends Controller_UserEnvironment {
private function getDisciplineInformation($id) { private function getDisciplineInformation($id) {
$temp = Model_Discipline::getInfo($id); $temp = Model_Discipline::getInfo($id);
$disciplineInfo = $temp[0]; $disciplineInfo = $temp;
$disciplineInfo['ID'] = $id; // $disciplineInfo['ID'] = $id;
$disciplineInfo['GroupID_Filter'] = $this->getGroupID_ForFilter($id); $disciplineInfo['GroupID_Filter'] = $this->getGroupID_ForFilter($id);
return $disciplineInfo; return $disciplineInfo;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
{% endif %} {% endif %}
</h2> </h2>
{{ HTML.anchor('rate/'~disciplineInfo.ID, {{ HTML.anchor('rate/'~disciplineInfo.DisciplineID,
"← Перейти к оцениванию", "← Перейти к оцениванию",
{'title': 'Оценивание', 'class': 'rate_a'})|raw }} {'title': 'Оценивание', 'class': 'rate_a'})|raw }}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment