Skip to content
Snippets Groups Projects
Commit 421c1706 authored by Чердынцева Марина's avatar Чердынцева Марина
Browse files

FIX: отображение добора баллов

parent afd23d33
Branches
Tags
No related merge requests found
var $ = jQuery; var $ = jQuery;
$(function() { $(function() {
function controlRowVisualization(jRow) {
var jAutoPassCheckBox = jRow.children(".autoPass").children(".autoPassCheck");
var semesterRate = parseInt(jRow.children(".semesterRateResultCell").text());
var absence = jRow.children(".absenceCell").children(".absenceCheck").is(":checked");
if ((semesterRate < 60) || (absence))
jAutoPassCheckBox.attr("disabled", true);
else
jAutoPassCheckBox.removeAttr("disabled");
}
function controlVisualization() {
$(".autoPassCheck")
.each( function() {
controlRowVisualization($(this).parent().parent());
});
}
// on page loaded
controlVisualization();
var g_col; var g_col;
var g_row; var g_row;
var g_isFocusCell = false; // Стоит фокус на ячейки или нет var g_isFocusCell = false; // Стоит фокус на ячейки или нет
...@@ -159,10 +180,13 @@ $(function() { ...@@ -159,10 +180,13 @@ $(function() {
{ {
// страница оценивания // страница оценивания
jThis.siblings(".commonCell").each(function(){ // добавим сумму баллов в соседних ячейках jThis.siblings(".commonCell").each(function(){ // добавим сумму баллов в соседних ячейках
if ($(this).children("input").val() !== "") var rate = $(this).children("input").val();
rateResult += parseInt($(this).children("input").val()); if (rate)
rateResult += parseInt(rate);
}); });
rateResult += parseInt(jThis.siblings(".examCell").text()); var examRateStr = jThis.siblings(".examCell").children("p").text();
if (examRateStr)
rateResult += parseInt(examRateStr);
} }
if (newRate <= g_submoduleMaxRate) if (newRate <= g_submoduleMaxRate)
...@@ -185,11 +209,7 @@ $(function() { ...@@ -185,11 +209,7 @@ $(function() {
jThis.siblings(".rateResultCell").text(correctRate); jThis.siblings(".rateResultCell").text(correctRate);
EventInspector_ShowMsg("Балл добавлен/изменен", "success"); EventInspector_ShowMsg("Балл добавлен/изменен", "success");
} }
else else EventInspector_ShowMsg("Не удалось добавить/изменить балл", "error");
{
jThis.children("input").val(oldRate);
EventInspector_ShowMsg("Не удалось добавить/изменить балл", "error");
}
jThis.children("input").removeAttr("disabled"); jThis.children("input").removeAttr("disabled");
} }
} }
...@@ -200,7 +220,9 @@ $(function() { ...@@ -200,7 +220,9 @@ $(function() {
jThis.children("input").val(oldRate); jThis.children("input").val(oldRate);
else else
jThis.children("input").val("0"); jThis.children("input").val("0");
if(jThis.children("input").val()=="0")
jThis.children("input").val("");
EventInspector_ShowMsg("Текущий балл превышает максимальный для данного модуля", "error"); EventInspector_ShowMsg("Текущий балл превышает максимальный для данного модуля", "error");
jThis.children("input").removeAttr("disabled"); jThis.children("input").removeAttr("disabled");
} }
...@@ -235,6 +257,7 @@ $(function() { ...@@ -235,6 +257,7 @@ $(function() {
Rating($(this), oldRate); Rating($(this), oldRate);
TdUnFocus(); TdUnFocus();
UnsetTdInfo($(this)); UnsetTdInfo($(this));
controlRowVisualization($(this).parent());
}); });
$(".commonCell").keyup(function(e){ $(".commonCell").keyup(function(e){
...@@ -287,8 +310,11 @@ $(function() { ...@@ -287,8 +310,11 @@ $(function() {
$(".commonCell").children("input").keydown(function(event) { $(".commonCell").children("input").keydown(function(event) {
KeyDownOnlyNumber(event); KeyDownOnlyNumber(event);
}); });
// Нажатие на чекбокс "Автомат"
$(".absenceCheck").click(function(event) {
controlRowVisualization($(this).parent().parent());
});
// Фильтр по группе // Фильтр по группе
$(".groupSelector").change(function() { $(".groupSelector").change(function() {
......
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