Skip to content
Snippets Groups Projects
Commit 62858dbc authored by PavelBegunkov's avatar PavelBegunkov
Browse files
parents d355ced3 35d7e254
Branches
Tags
No related merge requests found
Showing
with 149 additions and 90 deletions
......@@ -69,7 +69,7 @@ class Controller_Teacher_Map extends Controller_UserEnvi {
$twig->User = $this->UserInfo;
$twig->Discipline = $this->getDisciplineInfo($db, $id);
$twig->Map = $this->getMapInfo($db->getMapForDiscipline($this->UserInfo['TeacherID'], $id));
$this->response->body($twig);
}
......@@ -137,6 +137,7 @@ class Controller_Teacher_Map extends Controller_UserEnvi {
$mapHandled[$i]['SubmodulesCount'] = 0;
$mapHandled[$i]['MaxRate'] = 0;
}
$mapHandled[$i]['isExam'] = $row['isExam'];
$j = $mapHandled[$i]['SubmodulesCount'] += 1;
$mapHandled[$i]['MaxRate'] += (int) $row['MaxRate'];
$mapHandled[$i]['ModuleTitle'] = $row['ModuleName'];
......@@ -245,7 +246,7 @@ class Controller_Teacher_Map extends Controller_UserEnvi {
$students = $db->GetStudentsForDiscipline($this->UserInfo['TeacherID'], $DisciplineID);
$studentsHandled = array();
$i = 0;
foreach($students as $row) {
$i++;
$studentsHandled[$i]['StudentID'] = $row['StudentID'];
......
......@@ -2,6 +2,8 @@
{% block title %}Конструктор УКД{% endblock %} {# head -> title #}
{% block step_1 %}active{% endblock %}
{% block map_content %}
<div class="LayerSection">
......@@ -51,6 +53,7 @@
</select>
</div>
</div>
<p class="help">При изменение курса произойдет автоматическое отсоединение групп.</p>
</div>
<div class="LayerSection">
<div class="itemBlock">
......
......@@ -2,6 +2,8 @@
{% block title %}Конструктор УКД{% endblock %} {# head -> title #}
{% block step_4 %}active{% endblock %}
{% block map_content %}
<p class="notification">Обратите внимание, если вам нужно прикрепить 1-ого или максимум 4-х студентов из группы, то удобней это сделать на странице 'Прикрепление студентов'</p>
<div class="ChangeStudyGroupDIV">
......
......@@ -2,6 +2,8 @@
{% block title %}Конструктор УКД{% endblock %} {# head -> title #}
{% block step_2 %}active{% endblock %}
{% block map_content %}
<p class="top_center_info" style="display: none">Учебная карта дисциплины на 1 семестр 2014 года</p>
<div class="studyMap">
......@@ -15,36 +17,44 @@
<div class="moduleGroup" id="{{ Map[i].ModuleID }}">
<div class="moduleHead">
<div class="name">
<input type="text" class="inputName ModuleName" value="{{ Map[i].ModuleTitle }}" >
{% if Map[i].isExam == '1' %}
{{ Map[i].ModuleTitle }}
{% else %}
<input type="text" class="inputName ModuleName" value="{{ Map[i].ModuleTitle }}" >
{% endif %}
</div>
<div class="currentControl">{{ Map[i].CurrentControl }}</div>
<div class="landmarkControl">{{ Map[i].LandmarkControl }}</div>
<div class="actions">
<div class="deleteModule icon delete"></div>
<div class="downModule icon down"></div>
<div class="upModule icon up"></div>
<div class="addSubModule icon add"></div>
</div>
</div>
<div class="subModules">
{% for j in range(1, Map[i].SubmodulesCount) if Map[i].SubmodulesCount > 0 %}
<div class="subModule" id="{{ Map[i][j].SubmoduleID }}">
<div class="name">
<input type="text" class="inputName SubmoduleName" value="{{ Map[i][j].Title }}">
</div>
<div class="currentControl"><input type="text" class="inputCredit inputCurrentControl" value="{% if Map[i][j].SubmoduleControl == 'CurrentControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div>
<div class="landmarkControl"><input type="text" class="inputCredit inputLandmarkControl" value="{% if Map[i][j].SubmoduleControl == 'LandmarkControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div>
{% if Map[i].isExam != '1' %}
<div class="actions">
<div class="deleteSubModule icon delete"></div>
<div class="downSubModule icon down"></div>
<div class="upSubModule icon up"></div>
<div class="deleteModule icon delete"></div>
<div class="downModule icon down"></div>
<div class="upModule icon up"></div>
<div class="addSubModule icon add"></div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
{% if Map[i].isExam != '1' %}
<div class="subModules">
{% for j in range(1, Map[i].SubmodulesCount) if Map[i].SubmodulesCount > 0 %}
<div class="subModule" id="{{ Map[i][j].SubmoduleID }}">
<div class="name">
<input type="text" class="inputName SubmoduleName" value="{{ Map[i][j].Title }}">
</div>
<div class="currentControl"><input type="text" class="inputCredit inputCurrentControl" value="{% if Map[i][j].SubmoduleControl == 'CurrentControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div>
<div class="landmarkControl"><input type="text" class="inputCredit inputLandmarkControl" value="{% if Map[i][j].SubmoduleControl == 'LandmarkControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div>
<div class="actions">
<div class="deleteSubModule icon delete"></div>
<div class="downSubModule icon down"></div>
<div class="upSubModule icon up"></div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% else %}
<div class="empty">Пусто</div>
<div class="empty" style="width: 100%;"><p class="notification">Структура отсутствует</p></div>
{% endfor %}
</div>
<div class="addModule">Добавить модуль</div>
......
......@@ -2,15 +2,17 @@
{% block title %}Конструктор УКД{% endblock %} {# head -> title #}
{% block step_5 %}active{% endblock %}
{% block map_content %}
<div class="StudentsList">
<input type="hidden" class="HiddenInputFacultyID" value="{{ Discipline.FacultyID }}">
<div class="AttachedStudentsList">
<h2 class="BlueTitle">Прикрепленные студенты</h2>
{% set NowGroupNum = 0 %}
{% set NowGroupNum = -1 %}
{% for Student in Students %}
{% if NowGroupNum != Student.GroupNum %}
<div>Курс {{ Student.Grade }}, Группа {{ Student.GroupNum }}</div>
<div class="GradeAndGroupTitle" id="{{ Student.Grade }}_{{ Student.GroupNum }}">Курс {{ Student.Grade }}, Группа {{ Student.GroupNum }}</div>
{% set NowGroupNum = Student.GroupNum %}
{% endif %}
<div id="{{ Student.StudentID }}" class="Student {% if Student.Type == 'detach' %}StatusUnbind{% else %}StatusBind{% endif %}">
......
......@@ -2,6 +2,8 @@
{% block title %}Конструктор УКД{% endblock %} {# head -> title #}
{% block step_3 %}active{% endblock %}
{% block map_content %}
<div class="TeachersList">
<div class="BindTeachersList">
......
......@@ -14,11 +14,11 @@
{% block main_top_title %}Редактирование УКД{% endblock %}
{% block main_content %}
<div class="tabs">
<div class="tab">{{ HTML.anchor('map/discipline/'~Discipline.DisciplineID, 'Базовые настройки УКД', {'title': 'Базовые настройки УКД'})|raw }}</div>
<div class="tab">{{ HTML.anchor('map/structure/'~Discipline.DisciplineID, 'Структура УКД', {'title': 'Структура УКД'})|raw }}</div>
<div class="tab">{{ HTML.anchor('map/groups/'~Discipline.DisciplineID, 'Прикрепление групп', {'title': 'Прикрепление групп'})|raw }}</div>
<div class="tab">{{ HTML.anchor('map/teachers/'~Discipline.DisciplineID, 'Прикрепление преподавателей', {'title': 'Прикрепление преподавателей'})|raw }}</div>
<div class="tab">{{ HTML.anchor('map/students/'~Discipline.DisciplineID, 'Прикрепление студентов', {'title': 'Прикрепление студентов'})|raw }}</div>
<div class="tab {% block step_1 %}{% endblock %}">{{ HTML.anchor('map/discipline/'~Discipline.DisciplineID, 'Базовые настройки УКД', {'title': 'Базовые настройки УКД'})|raw }}</div>
<div class="tab {% block step_2 %}{% endblock %}">{{ HTML.anchor('map/structure/'~Discipline.DisciplineID, 'Структура УКД', {'title': 'Структура УКД'})|raw }}</div>
<div class="tab {% block step_3 %}{% endblock %}">{{ HTML.anchor('map/teachers/'~Discipline.DisciplineID, 'Прикрепление преподавателей', {'title': 'Прикрепление преподавателей'})|raw }}</div>
<div class="tab {% block step_4 %}{% endblock %}">{{ HTML.anchor('map/groups/'~Discipline.DisciplineID, 'Прикрепление групп', {'title': 'Прикрепление групп'})|raw }}</div>
<div class="tab {% block step_5 %}{% endblock %}">{{ HTML.anchor('map/students/'~Discipline.DisciplineID, 'Прикрепление студентов', {'title': 'Прикрепление студентов'})|raw }}</div>
</div>
<div class="map_content">
{% block map_content %}
......
......@@ -16,13 +16,13 @@
<h2 style="margin-left: 2.5%; font-weight: normal; color: #3399CC;">{{ headerRate.SubjectName }}</h2>
<p style="font-size: 15px; margin-left: 2.5%">Обратить внимание, что пустая клетка эквивалентна нулю</p>
<table class="studentsRate" border="0" cellspacing="0" cellpadding="0">
<tr>
<tr class="RatingTableModulesHead">
<td class="title" width="150px">Модуль</td>
{% for i in 1..headerRate.ModulesCount %}
<td class="subject" colspan="{{headerRate[i].SubmodulesCount}}">{{ headerRate[i].ModuleTitle }}</td>
{% endfor %}
</tr>
<tr>
<tr class="RatingTableSubmodulesHead">
{% set CellCount = 0 %} {% set col = 0 %}
<td class="title">Мероприятие</td>
{% for i in 1..headerRate.ModulesCount %}
......
......@@ -25,23 +25,27 @@
display: inline;
float: left;
margin: 2px 3px 2px 0px;
background: #EEEEEE;
font-size: 13px;
color: #0183ce;
}
.tabs .tab a {
display: block;
background: #EEEEEE;
color: inherit;
padding: 5px 12px;
font-size: 13px;
color: #0183ce;
}
.tabs .tab a:hover {
background-color: #3399CC;
text-decoration: none;
color: #f6f7f7;
}
.tabs .tab a.active {
background-color: #3399CC;
color: #f6f7f7;
text-decoration: none;
}
.tabs .tab:hover {
background-color: #3399CC;
color: #f6f7f7;
}
.tabs .active {
background-color: #3399CC;
color: #f6f7f7;
}
.map_content {
margin: 0px 25px;
}
......@@ -225,6 +229,12 @@
/* Прикрипление студентов */
.StudentsList {}
.StudentsList .GradeAndGroupTitle {
margin-top: 20px;
font-weight: bold;
font-size: 15px;
color: #333;
}
.StudentsList .Student {
margin: 10px 0;
padding: 10px;
......
......@@ -74,8 +74,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, ChangeSubmodule ControlType', 'success');
else EventInspector_ShowMsg('Error, ChangeSubmodule ControlType', 'error');
EventInspector_ShowMsg('Форма контроля изменена', 'success');
else EventInspector_ShowMsg('Ошибка при изменение формы контроля', 'error');
}
);
}
......@@ -91,8 +91,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, ChangeSubmodule MaxRate', 'success');
else EventInspector_ShowMsg('Error, ChangeSubmodule MaxRate', 'error');
EventInspector_ShowMsg('Max балл мероприятия изменен', 'success');
else EventInspector_ShowMsg('Ошибка при изменение max балла', 'error');
}
);
}
......@@ -105,24 +105,45 @@ $(function() {
var ID = thisObj.parent('div').parent('div').attr('id');
var NewMaxRate = 0;
if (thisObj.val() != '')
NewMaxRate = thisObj.val();
NewMaxRate = parseInt(thisObj.val());
// Ограничение 100 баллов
var currentControl = 0;
$('.moduleHead .currentControl').each(function(){
currentControl += parseInt($(this).text());
});
var landmarkControl = 0;
$('.moduleHead .landmarkControl').each(function(){
landmarkControl += parseInt($(this).text());
});
var subtract = 0;
if (thisObj.parent().attr('class').indexOf('landmarkControl') + 1 > 0)
subtract = parseInt(thisObj.parent().siblings('.currentControl').children().val());
if (thisObj.parent().attr('class').indexOf('currentControl') + 1 > 0)
subtract = parseInt(thisObj.parent().siblings('.landmarkControl').children().val());
if (currentControl + landmarkControl + NewMaxRate - subtract - OldMaxRate > 100) {
EventInspector_ShowMsg('Сумма баллов превышает 100', 'error');
thisObj.val(OldMaxRate);
return 0;
}
// Меняем max балл
if (NewMaxRate != OldMaxRate)
if (NewMaxRate != OldMaxRate) {
ChangeSubmoduleMaxRate(ID, NewMaxRate);
// Меняем тип
ControlType = 'CurrentControl'; // По-умолчанию
if ((thisObj.parent().attr('class')).indexOf('landmarkControl') + 1 > 0)
ControlType = 'LandmarkControl';
if (NewMaxRate > 0)
ChangeSubmoduleControlType(ID, ControlType);
if (ControlType == 'CurrentControl')
thisObj.parent().parent().find('.landmarkControl').children('.inputLandmarkControl').val('0');
if (ControlType == 'LandmarkControl')
thisObj.parent().parent().find('.currentControl').children('.inputCurrentControl').val('0');
// Меняем тип
ControlType = 'CurrentControl'; // По-умолчанию
if ((thisObj.parent().attr('class')).indexOf('landmarkControl') + 1 > 0)
ControlType = 'LandmarkControl';
if (NewMaxRate > 0)
ChangeSubmoduleControlType(ID, ControlType);
if (ControlType == 'CurrentControl')
thisObj.parent().parent().find('.landmarkControl').children('.inputLandmarkControl').val('0');
if (ControlType == 'LandmarkControl')
thisObj.parent().parent().find('.currentControl').children('.inputCurrentControl').val('0');
}
// Подсчет текущего и рубежного контроля после изменений
CountCurrentControl(subModulesDiv);
......@@ -140,8 +161,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, SwapModuleOrder', 'success');
else EventInspector_ShowMsg('Error, SwapModuleOrder', 'error');
EventInspector_ShowMsg('Модули поменяли порядок', 'success');
else EventInspector_ShowMsg('Ошибка при изменение порядка модулей', 'error');
}
);
}
......@@ -157,8 +178,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, SwapSubmoduleOrder', 'success');
else EventInspector_ShowMsg('Error, SwapSubmoduleOrder', 'error');
EventInspector_ShowMsg('Мероприятия поменяли порядок', 'success');
else EventInspector_ShowMsg('Ошибка при изменение порядка мероприятий', 'error');
}
);
}
......@@ -181,8 +202,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, ChangeDiscipline', 'success');
else EventInspector_ShowMsg('Error, ChangeDiscipline', 'error');
EventInspector_ShowMsg('Базовые настройки УКД изменены', 'success');
else EventInspector_ShowMsg('Ошибка: Базовые настройки УКД', 'error');
}
);
return false
......@@ -256,8 +277,8 @@ $(function() {
thisModuleDIV.attr('id', data.ModuleID);
// К добавленному в модуль мероприятию добавляем ID
thisModuleDIV.children('.subModules').children('.subModule').eq(0).attr('id', data.SubmoduleID);
EventInspector_ShowMsg('Ок, AddModule', 'success');
} else EventInspector_ShowMsg('Error, AddModule', 'error');
EventInspector_ShowMsg('Модуль добавлен', 'success');
} else EventInspector_ShowMsg('Ошибка при добавление модуля', 'error');
}
);
......@@ -283,8 +304,8 @@ $(function() {
if(data.success === true) {
// К добавленному мероприятию добавляем ID
SubmodulesDIV.children('.subModule').eq(OrderNum - 1).attr('id', data.SubmoduleID);
EventInspector_ShowMsg('Ок, AddSubmodule', 'success');
} else EventInspector_ShowMsg('Error, AddSubmodule', 'error');
EventInspector_ShowMsg('Мероприятие добавлено', 'success');
} else EventInspector_ShowMsg('Ошибка при добавление мероприятия', 'error');
}
);
});
......@@ -324,8 +345,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, DeleteModule', 'success');
else EventInspector_ShowMsg('Error, DeleteModule', 'error');
EventInspector_ShowMsg('Модуль удален', 'success');
else EventInspector_ShowMsg('Ошибка при удаление модуля', 'error');
}
);
$(this).parent('div').parent('div').parent('div').remove();
......@@ -359,8 +380,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, DeleteSubmodule', 'success');
else EventInspector_ShowMsg('Error, DeleteSubmodule', 'error');
EventInspector_ShowMsg('Мероприятие удалено', 'success');
else EventInspector_ShowMsg('Ошибка при удаление мероприятия', 'error');
}
);
$(this).parent('div').parent('div').remove();
......@@ -390,8 +411,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, Change Module Name', 'success');
else EventInspector_ShowMsg('Error, Change Module Name', 'error');
EventInspector_ShowMsg('Имя модуля изменено', 'success');
else EventInspector_ShowMsg('Ошибка при изменение имени модуля', 'error');
}
);
}
......@@ -415,8 +436,8 @@ $(function() {
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, Change Submodule Name', 'success');
else EventInspector_ShowMsg('Error, Change Submodule Name', 'error');
EventInspector_ShowMsg('Имя мероприятия изменено', 'success');
else EventInspector_ShowMsg('Ошибка при изменение имени мероприятия', 'error');
}
);
}
......@@ -475,8 +496,8 @@ $('.AttachGroupButton').click(function(){
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, BindGroup', 'success');
else EventInspector_ShowMsg('Error, BindGroup', 'error');
EventInspector_ShowMsg('Группа добавлена', 'success');
else EventInspector_ShowMsg('Ошибка при добавление группы', 'error');
}
);
$('.AttachedGroupsList').append(BindGroup(StudyGroupID, StudyGroupName));
......@@ -496,9 +517,9 @@ $('.AttachedGroupsList').on('click', '.UnbindGroup', function(){
data = $.parseJSON(data);
if(data.success === true) {
GroupDIV.remove();
EventInspector_ShowMsg('Ок, BindGroup', 'success');
EventInspector_ShowMsg('Группа отсоединена', 'success');
}
else EventInspector_ShowMsg('Error, BindGroup', 'error');
else EventInspector_ShowMsg('Ошибка при отсоединение группы', 'error');
}
);
});
......@@ -606,8 +627,8 @@ $('.StudentsList').on('click', '.Action_BindStudent', function(){
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, BindStudent', 'success');
else EventInspector_ShowMsg('Error, BindStudent', 'error');
EventInspector_ShowMsg('Студент добавлен', 'success');
else EventInspector_ShowMsg('Ошибка при добавление студента', 'error');
}
);
});
......@@ -632,8 +653,8 @@ $('.StudentsList').on('click', '.Action_UnbindStudent', function(){
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, UnbindStudent', 'success');
else EventInspector_ShowMsg('Error, UnbindStudent', 'error');
EventInspector_ShowMsg('Студент отсоединен', 'success');
else EventInspector_ShowMsg('Ошибка при отсоединение студента', 'error');
}
);
});
......@@ -743,8 +764,8 @@ $('.TeachersList').on('click', '.Action_UnbindTeacher', function(){
function(data){
data = $.parseJSON(data);
if(data.success === true)
EventInspector_ShowMsg('Ок, UnbindTeacher', 'success');
else EventInspector_ShowMsg('Error, UnbindTeacher', 'error');
EventInspector_ShowMsg('Преподаватель отсоединен', 'success');
else EventInspector_ShowMsg('Ошибка при отсоединение преподавателя', 'error');
}
);
});
......@@ -765,10 +786,10 @@ $('.TeachersList').on('click', '.Action_BindTeacher', function(){
function(data){
data = $.parseJSON(data);
if(data.success === true) {
EventInspector_ShowMsg('Ок, BindTeacher', 'success');
EventInspector_ShowMsg('Преподаватель прикреплен', 'success');
$('.BindTeachersList').append(AddTeacher(ID, Name, 'Unbind'));
}
else EventInspector_ShowMsg('Error, BindTeacher', 'error');
else EventInspector_ShowMsg('Ошибка при прикрепление преподавателя', 'error');
}
);
});
......
......@@ -135,4 +135,12 @@ $(function() {
KeyDownOnlyNumber(event);
});
$(window).scroll(function () {
if ($(this).scrollTop() > 160) {
} else {
}
});
});
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