Skip to content
Snippets Groups Projects
Commit b3bc05bb authored by PavelBegunkov's avatar PavelBegunkov
Browse files

fix: sql change control type for discipline

parent 46c0a2e5
Branches
Tags
No related merge requests found
......@@ -964,8 +964,15 @@ BEGIN
IF vExtraID <= 0 THEN
RETURN -1;
END IF;
# check that exam type really changed
IF vOldExamType = 'exam' XOR pExamType != 'exam' THEN
# set new exam type
UPDATE `disciplines`
SET disciplines.ExamType = pExamType
WHERE disciplines.ID = pDisciplineID
LIMIT 1;
# this magic check that type change between exam <-> credit/grading_credit
IF vOldExamType = 1 XOR pExamType != 'exam' THEN # 1 - exam
RETURN 0;
END IF;
......@@ -993,11 +1000,6 @@ BEGIN
SET vChecker = AddSubmodule(pTeacherID, vExtraID, vExtraMax, '', NULL, 'LandmarkControl');
END IF;
# set new exam type
UPDATE `disciplines`
SET disciplines.ExamType = pExamType
WHERE disciplines.ID = pDisciplineID
LIMIT 1;
# set max rate for extra
UPDATE `submodules`
SET submodules.MaxRate = vExtraMax
......
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