Skip to content
Snippets Groups Projects
Forked from it-lab / grade
Source project has a limited visibility.
setRate.twig 2.90 KiB
{% extends 'base' %}

{% block title %}Выставление баллов{% endblock %} {# head -> title #}
{% block media %} {# head -> css, js #}
	{{ HTML.script('media/js/functions.js')|raw }}

	{{ HTML.style('media/css/setRate.css')|raw }}
	{{ HTML.script('media/js/setRate.js')|raw }}
{% endblock %}

{% block main_top_title %}Выставление баллов{% endblock %}
{% block main_content %}
	<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>
			<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>
			{% 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 col = col + 1 %}
					<td class="subject col_{{ col }}" id="{{ headerRate[i][j].SubmoduleID }}">{{ headerRate[i][j].Title }}<input type="hidden" class="MaxRate" value="{{ headerRate[i][j].MaxRate }}"></td>
				{% endfor %}
			{% endfor %}
		</tr>
		{% set row = 0 %} {% set GroupNum = 0 %}
		{% for student in tableRate %}
			{% set row = row + 1 %}
			{% if student.GroupNum != GroupNum %}	
				{% set GroupNum = student.GroupNum %}
				<tr>
					<td class="group" colspan="{{ CellCount + 1 }}">{{ student.GroupNum }} группа</td>
				</tr>
			{% endif %}
			<tr>
				<td class="row_{{ row }} student" id="{{ student.StudentID }}">{{ student.LastName }} {{ student.FirstName }}</td>
				{% for i in 1..CellCount %}
					<td class="row_{{ row }} col_{{ i }} rateCell {% if student[i].Rate != null %}edit{% endif %}"><input value="{{ student[i].Rate }}"></td>
				{% endfor %}
			</tr>
		{% endfor %}
		{% set GroupNum = 0 %}
		{% for student in migrantsRate %}
			{% if  loop.first  == 1 %}
				<tr>
					<td class="group" colspan="{{ CellCount + 1 }}">Мигранты</td>
				</tr>
			{% endif %}
			{% set row = row + 1 %}
			{% if student.GroupNum != GroupNum %}	
				{% set GroupNum = student.GroupNum %}
				<tr>
					<td class="group" colspan="{{ CellCount + 1 }}">{{ student.GroupNum }} группа</td>
				</tr>
			{% endif %}
			<tr>
				<td class="row_{{ row }} student" id="{{ student.StudentID }}">{{ student.LastName }} {{ student.FirstName }}</td>
				{% for i in 1..CellCount %}
					<td class="row_{{ row }} col_{{ i }} rateCell {% if student[i].Rate > 0 %}edit{% endif %}"><input value="{{ student[i].Rate }}"></td>
				{% endfor %}
			</tr>
		{% endfor %}
	</table>
{% endblock %}