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

Merge branch 'hotfix/rating_summation' into develop

parents a0059afe c614c2d5
Branches
Tags
No related merge requests found
......@@ -702,7 +702,9 @@ class Controller_Handler_FileCreator extends Controller_Handler
if ($examHold != 0)
{
$examRateStr = $examRateValue;
if (($examAdmission < 38) or ($examRateValue < 22)) {
if ($examAdmission < 38) {
$rateOfFive = 'н/д';
} elseif ($examRateValue < 22) {
$rateOfFive = 'неуд';
} else {
$totalRateStr = $totalRateValue;
......
......@@ -145,7 +145,7 @@
{% endif %}
{% if r.Block == 'True' or (r.ModuleType != 'extra' and student.RateResult < 38) %}
<td class="staticCell {{ td_class }}" id="col_{{ col }}_row_{{ row }}">
<td class="{{ td_class }}" id="col_{{ col }}_row_{{ row }}">
<input type="text" value="{{ r.Rate }}" disabled="disabled">
</td>
{% else %}
......
......@@ -42,22 +42,24 @@ $(function() {
}
function controlRowVisualization(jRow) {
var jAutoPassCheckBox = jRow.children(".autoPass").children(".autoPassCheck");
var jAbsenceCheckBoxes = jRow.children(".absenceCell").children(".absenceCheck");
var semesterRate = parseInt(jRow.children(".semesterRateResultCell").text());
var autopass = jAutoPassCheckBox[0].checked;
var absence = jAbsenceCheckBoxes[0].checked;
if ((semesterRate < 60) || (absence))
jAutoPassCheckBox.attr("disabled", true);
else
jAutoPassCheckBox.removeAttr("disabled");
if ((semesterRate < 38) || (autopass))
jAbsenceCheckBoxes.attr("disabled", true);
else
jAbsenceCheckBoxes.removeAttr("disabled");
// TODO: disable CommonCell connected with this exam if absence or autopass checked
if ($("#pageType").val() === "exam") {
var jAutoPassCheckBox = jRow.children(".autoPass").children(".autoPassCheck");
var jAbsenceCheckBoxes = jRow.children(".absenceCell").children(".absenceCheck");
var semesterRate = parseInt(jRow.children(".semesterRateResultCell").text());
var autopass = jAutoPassCheckBox[0].checked;
var absence = jAbsenceCheckBoxes[0].checked;
if ((semesterRate < 60) || (absence))
jAutoPassCheckBox.attr("disabled", true);
else
jAutoPassCheckBox.removeAttr("disabled");
if ((semesterRate < 38) || (autopass))
jAbsenceCheckBoxes.attr("disabled", true);
else
jAbsenceCheckBoxes.removeAttr("disabled");
// TODO: disable CommonCell connected with this exam if absence or autopass checked
}
}
function controlVisualization() {
......@@ -222,10 +224,9 @@ $(function() {
return;
}
var newRate = 0;
var newRate = -1; // если пустая строка в ячейке, значит ничего не поставлено
if (jThis.children("input").val() !== "")
newRate = parseInt(jThis.children("input").val());
if (newRate == oldRate)
return;
......@@ -239,8 +240,9 @@ $(function() {
{
// страница сессии
rateResult += parseInt(jThis.siblings(".semesterRateResultCell").text());
rateResult += parseInt(jThis.siblings(".bonus").text());
jThis.siblings(".additionalCell").each(function () {
jThis.siblings(".additionalCell").each(function () {
if ($(this).children("input").val() !== "")
rateResult += parseInt($(this).children("input").val());
});
......@@ -252,16 +254,15 @@ $(function() {
if (rate)
rateResult += parseInt(rate);
});
var examRateStr = jThis.siblings(".examCell").children("p").text();
if (examRateStr)
rateResult += parseInt(examRateStr);
var additionalRateStr = jThis.siblings(".staticCell").children("p").text();
if (additionalRateStr)
rateResult += parseInt(additionalRateStr);
}
if (newRate <= g_submoduleMaxRate) {
if (newRate == -1)
newRate = null; // TODO: начить setRate принимать null на вход
$.ajax({
type: "POST",
url: URLdir + "handler/rating/setRate",
......
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