Skip to content
Snippets Groups Projects
Commit 849e724b authored by Антон Шалимов's avatar Антон Шалимов
Browse files

обработка 403 страницы при оценивании на jquery

время жизни сессии 60 секунд. после тестирования вернуть 900 секунд
parent c6c0625e
Branches
Tags
No related merge requests found
...@@ -115,34 +115,40 @@ $(function() { ...@@ -115,34 +115,40 @@ $(function() {
if (rateResult > 100) { if (rateResult > 100) {
jThis.children("input").val(oldRate); jThis.children("input").val(oldRate);
EventInspector_ShowMsg("Сумма баллов не может привышать 100", "error"); EventInspector_ShowMsg("Сумма баллов не может привышать 100", "error");
jThis.children("input").removeAttr("disabled");
} }
else else
{ {
if (newRate <= g_submoduleMaxRate) if (newRate <= g_submoduleMaxRate)
{ {
$.post( $.ajax({
URLdir + "handler/rating/setRate", type: "POST",
{ url: URLdir + "handler/rating/setRate",
"student": g_studentID, data: "student="+g_studentID+"&submodule="+g_submoduleID+"&rate="+newRate,
"submodule": g_submoduleID, statusCode: {
"rate": newRate 403: function() {
}, EventInspector_ShowMsg("Сессия истекла", "error");
function(data){ jThis.children("input").val(oldRate);
data = $.parseJSON(data); jThis.children("input").removeAttr("disabled");
if(data.success === true) { },
jThis.siblings(".RateResult").text(rateResult); 200: function(data) {
EventInspector_ShowMsg("Балл добавлен/изменен", "success"); data = $.parseJSON(data);
} if(data.success === true) {
else EventInspector_ShowMsg("Не удалось добавить/изменить балл", "error"); jThis.siblings(".RateResult").text(rateResult);
jThis.children("input").removeAttr("disabled"); EventInspector_ShowMsg("Балл добавлен/изменен", "success");
}
else EventInspector_ShowMsg("Не удалось добавить/изменить балл", "error");
jThis.children("input").removeAttr("disabled");
}
} }
); });
} }
else { else {
if (oldRate <= g_submoduleMaxRate) if (oldRate <= g_submoduleMaxRate)
jThis.children("input").val(oldRate); jThis.children("input").val(oldRate);
else else
jThis.children("input").val("0"); jThis.children("input").val("0");
EventInspector_ShowMsg("Текущий балл превышает максимальный для данного модуля", "error"); EventInspector_ShowMsg("Текущий балл превышает максимальный для данного модуля", "error");
jThis.children("input").removeAttr("disabled"); jThis.children("input").removeAttr("disabled");
} }
......
...@@ -8,7 +8,7 @@ class Kohana_User implements ArrayAccess { ...@@ -8,7 +8,7 @@ class Kohana_User implements ArrayAccess {
protected $_model; protected $_model;
protected $_userInfo; protected $_userInfo;
const SESSION_LIFETIME = 900; //seconds const SESSION_LIFETIME = 60; //seconds
/** /**
* Вовзращает экземпляр класса (singleton-паттерн) * Вовзращает экземпляр класса (singleton-паттерн)
......
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