diff --git a/~dev_rating/application/views/teacher/exam.twig b/~dev_rating/application/views/teacher/exam.twig index 8a7136278a597b6dd746fe67273c68dc968bab0c..cad575521ed1eef7b3993b6a54bda48698499fdc 100644 --- a/~dev_rating/application/views/teacher/exam.twig +++ b/~dev_rating/application/views/teacher/exam.twig @@ -2,12 +2,12 @@ {% block title %}Сессия{% endblock %} {# head -> title #} {% block media %} {# head -> css, js #} + {{ HTML.script('media/js/rating.js')|raw }} {{ HTML.script('media/js/functions.js')|raw }} {{ HTML.script('media/js/jquery.fileDownload.js')|raw }} {{ HTML.style('media/css/rating.css')|raw }} - {{ HTML.script('media/js/rating.js')|raw }} {% endblock %} {% block main_top_title %}Сессия{% endblock %} @@ -38,8 +38,13 @@ <tr class="RatingTableModulesHead"> <td class="title" width="150px">Модуль</td> <td class="subject" rowspan="3">Ртог Р·Р° семестр</td> + {% for i in 1..headerRate.ModulesCount %} - <td class="subject" colspan="{{headerRate[i].SubmodulesCount}}"> + {% set colSpan = headerRate[i].SubmodulesCount %} + {% set rowSpan = 1 %} + {% if headerRate[i].ModuleType == 'exam' %}{% set colSpan = 2*colSpan+1 %}{% endif %} + {% if headerRate[i].ModuleType == 'extra' %}{% set rowSpan = 3 %}{% endif %} + <td class="subject" colspan="{{colSpan}}" rowspan="{{rowSpan}}"> {{ headerRate[i].ModuleTitle }} </td> {% endfor %} @@ -47,37 +52,53 @@ <td class="subject" rowspan="3">Ртог</td> </tr> <tr class="RatingTableSubmodulesHead"> - {% set CellCount = 0 %} {% set col = 0 %} <td class="title">Мероприятие</td> {% for i in 1..headerRate.ModulesCount %} - {% set CellCount = CellCount + headerRate[i].SubmodulesCount %} - {% for j in 1..headerRate[i].SubmodulesCount %} + {% set colSpanGeneral = 1 %} + {% if headerRate[i].ModuleType == 'exam' %}{% set colSpanGeneral = 2*colSpanGeneral%}{% endif %} + {% for j in 1..headerRate[i].SubmodulesCount if headerRate[i].ModuleType != 'extra' %} {% set col = col + 1 %} - <td class="subject col_{{ col }}"> {{ headerRate[i][j].Title }} </td> + {% set colSpan = colSpanGeneral %} + {% if j == 1 %}{% set colSpan = colSpan+1 %}{% endif %} + <td class="subject col_{{ col }}" colspan="{{colSpan}}"> {{ headerRate[i][j].Title }} </td> {% endfor %} - {# {% set col = col + 1 %} #} {% endfor %} </tr> <tr class="RatingTableSubmodulesHeadMaxRate"> - {% set CellCount = 0 %} + {% set columnsCount = 4 %} {# студенты, итог Р·Р° семестр, Р±РѕРЅСѓСЃС‹, итог #} {% set col = 0 %} <td class="title">Макс. балл</td> {% for i in 1..headerRate.ModulesCount %} - {% set CellCount = CellCount + headerRate[i].SubmodulesCount %} - {% for j in 1..headerRate[i].SubmodulesCount %} + {% set columnsCount = columnsCount + headerRate[i].SubmodulesCount %} + {% set examModule = false %} + {% if headerRate[i].ModuleType == 'exam' %}{% set examModule = true %}{% endif %} + {% for j in 1..headerRate[i].SubmodulesCount if headerRate[i].ModuleType != 'extra' %} {% set col = col + 1 %} <td class="subject col_{{ col }}" id="{{ headerRate[i][j].SubmoduleID }}"> {% if headerRate[i].ModuleType != 'extra' %}{{ headerRate[i][j].MaxRate }}{% endif %} <input type="hidden" class="MaxRate" value="{{ headerRate[i][j].MaxRate }}"> </td> + {% if examModule %} + {% set columnsCount = columnsCount + 1 %} + <td class="subject col_absence_{{ col }}" id="absence_{{ headerRate[i][j].SubmoduleID }}"> + Неявка + </td> + + {% if j == 1 %} + {% set columnsCount = columnsCount + 1 %} + <td class="subject col_autopass_{{ col }}" id="autopass_{{ headerRate[i][j].SubmoduleID }}"> + Автомат + </td> + {% endif %} + {% endif %} {% endfor %} {% endfor %} </tr> {% set row = 0 %} {% for group in rateTable %} <tr id="group_{{ group.GroupID }}" class="group_{{ group.GroupID }}"> - <td class="group" colspan="{{ CellCount + 3 }}"> + <td class="group" colspan="{{ columnsCount }}"> {% if group.isAttached == 1 %} {{ group.GradeTitle }} {% endif %}{{ group.GroupNum }} РіСЂСѓРїРїР°. <span class="downloadExcelStatement" id="group_{{ group.GroupID }}">Скачать ведомость</span> </td> @@ -90,6 +111,7 @@ <td id="student_{{ student.ID }}" class="studentCell staticCell">{{ student.Last }} {{ student.First }}</td> <td class="semesterRateResultCell staticCell">{{ student.RateSemesterResult }}</td> + {% set autoPassNotAdded = true %} {% for r in student.Rates %} {% set col = col + 1 %} @@ -101,15 +123,29 @@ {% endif %} {% if r.Block == 'True' %} - <td class="staticCell {{ td_class }}" id="col_{{ col }}"> + <td class="staticCell {{ td_class }}" id="col_{{ col }}"> {# todo _row_{{row}} #} <input type="text" value="{{ r.Rate }}" disabled="disabled"> </td> {% else %} - <td class="commonCell {{ td_class }}" id="col_{{ col }}"> + <td class="commonCell {{ td_class }}" id="col_{{ col }}"> {# todo _row_{{row}} #} <input type="text" value="{{ r.Rate }}" {% if r.ModuleType == 'extra' %} placeholder="{% if r.MaxRate > 0 %} макс. {{r.MaxRate}} {% else %} --- {% endif %}"{% endif %}> </td> {% endif %} + + {% if r.ModuleType == 'exam' %} + <td class="absenceCell {{ td_class }}" id="absence_{{col}}_{{row}}"> + <input type="checkbox" class="absenceCheck"> + </td> + + {% if autoPassNotAdded %} + <td class="autoPass {{ td_class }}" id="autopass_{{col}}_{{row}}"> + <input type="checkbox" class="autoPassCheck"> + </td> + {% set autoPassNotAdded = false %} + {% endif %} + {% endif %} + {% endfor %} <td class="bonus staticCell">{{ student.Bonus }}</td> diff --git a/~dev_rating/docs/template credit.xls b/~dev_rating/docs/template credit.xls index 1dc48e50980d69b0748515fb5a81aeecf4f1a638..bf2ba2e5b09e45fcb0357232a4bd67716f982d5e 100644 Binary files a/~dev_rating/docs/template credit.xls and b/~dev_rating/docs/template credit.xls differ diff --git a/~dev_rating/media/js/rating.js b/~dev_rating/media/js/rating.js index e1de3678e70f1b7e2fb66e40c2a334f0acafbc75..736cd2007600be245f48ee99c4a34460fce72c5a 100644 --- a/~dev_rating/media/js/rating.js +++ b/~dev_rating/media/js/rating.js @@ -180,13 +180,23 @@ $(function() { { // страница оценивания jThis.siblings(".commonCell").each(function(){ // добавим СЃСѓРјРјСѓ баллов РІ соседних ячейках +<<<<<<< HEAD var rate = $(this).children("input").val(); if (rate) rateResult += parseInt(rate); +======= + var rateStr = $(this).children("input").val(); + if (rateStr) + rateResult += parseInt(rateStr); +>>>>>>> 69428e3c86e45c103f595f121529a831a6d6c742 }); var examRateStr = jThis.siblings(".examCell").children("p").text(); if (examRateStr) rateResult += parseInt(examRateStr); +<<<<<<< HEAD +======= + +>>>>>>> 69428e3c86e45c103f595f121529a831a6d6c742 } if (newRate <= g_submoduleMaxRate)