Skip to content
Snippets Groups Projects
rating.twig 4.33 KiB
Newer Older
{% extends 'base' %}

{% block title %}Выставление баллов{% endblock %} {# head -> title #}
{% block media %} {# head -> css, js #}
	{{ HTML.script('media/js/functions.js')|raw }}
Anton's avatar
Anton committed
	
	{{ 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 %}
{% block main_content %}
	<h2 style="margin-left: 2.5%; font-weight: normal; color: #3399CC;">{{ SubjectName }}</h2>
pimka's avatar
pimka committed

	<button class="downloadExcel">Скачать в excel формате</button>
Антон Шалимов's avatar
Антон Шалимов committed
    {{ HTML.anchor('exam/'~DisciplineID, 
            "Перейти к сессии", 
            {'title': 'Сессия', 'class': 'exam_a'})|raw }}
pimka's avatar
pimka committed
	<div class="groupSelectorWrap">
pimka's avatar
pimka committed
		<div class="groupSelectorText">Фильтр:</div>
pimka's avatar
pimka committed
		<select class="groupSelector">
			<option value="0">Все группы</option>
			{% for key, group in groups %}
				<option value="{{ key }}">{{ group }}</option>
			{% endfor %}
		</select>
	</div>
PavelBegunkov's avatar
PavelBegunkov committed

pimka's avatar
pimka committed
	<p class="notification notif_rating">Обратите внимание, что пустая клетка эквивалентна нулю</p>
	<table class="studentsRate" border="0" cellspacing="0" cellpadding="0">
Anton's avatar
Anton committed
			<td class="title" width="150px">Модуль</td>
PavelBegunkov's avatar
PavelBegunkov committed
				<td class="subject {% if headerRate[i].ModuleType == 'bonus' %} bonus{% endif %}" colspan="{{headerRate[i].SubmodulesCount}}" {% if headerRate[i].ModuleType != 'regular' %} rowspan="2" {% endif %}>
			{% endfor %}
			<td class="subject" rowspan="3">Итог</td>
Антон Шалимов's avatar
Антон Шалимов committed
			{% set CellCount = 0 %}
			{% set col = 0 %}
			<td class="title">Мероприятие</td>
			{% for i in 1..headerRate.ModulesCount %}
				{% set CellCount = CellCount + headerRate[i].SubmodulesCount %}
				{% if headerRate[i]['ModuleType'] == 'regular' %}
					{% for j in 1..headerRate[i].SubmodulesCount %}
						{% set col = col + 1 %}
						<td class="subject col_{{ col }}">{{ headerRate[i][j].Title }}</td>
					{% endfor %}
				{% endif %}
			{% endfor %}
		</tr>
Антон Шалимов's avatar
Антон Шалимов committed
			{% set CellCount = 0 %}
			{% set col = 0 %}
Антон Шалимов's avatar
Антон Шалимов committed
			<td class="title">Макс. балл</td>
			{% for i in 1..headerRate.ModulesCount %}
				{% set CellCount = CellCount + headerRate[i].SubmodulesCount %}
				{% for j in 1..headerRate[i].SubmodulesCount %}
PavelBegunkov's avatar
PavelBegunkov committed
					{% if headerRate[i].ModuleType == "exam" %}
Антон Шалимов's avatar
Антон Шалимов committed
						<td class="subject" id="{{ headerRate[i][j].SubmoduleID }}">{{ headerRate[i][j].MaxRate }}</td>
					{% else %}
						{% set col = col + 1 %}
						<td class="subject col_{{ col }}" id="{{ headerRate[i][j].SubmoduleID }}">{{ headerRate[i][j].MaxRate }}
							<input type="hidden" class="MaxRate" value="{{ headerRate[i][j].MaxRate }}">
						</td>
					{% endif %}
		{% set row = 0 %}
		{% for group in rateTable %}
			<tr class="group {{ group.GroupID }}">
				<td colspan="{{ CellCount + 2 }}">{% if group.isAttached == 1 %} {{ group.GradeTitle }} {% endif %}{{ group.GroupNum }} группа</td>
			{% for student in group.Students %}
				{% set row = row + 1 %}
				{% set j = 0 %}
				<tr id="{{ row }}" class="{{ group.GroupID }}">
					<td class="student staticCell" id="{{ student.ID }}">{{ student.Last }} {{ student.First }}</td>
					{% for i in 1..CellCount %}
						{% set j = j + 1 %}
PavelBegunkov's avatar
PavelBegunkov committed
						{% if student.Rates[i].SubmoduleID >= 0 %}
							<td id="{{ j }}" class="rateCell">
								<input type="text" value="{{ student.Rates[i].Rate }}">
							</td>
						{% else %}
							{% set j = j - 1 %}
							<td class="rateCell staticCell notChange">
								<p>{{ student.Rates[i].Rate }}</p>
							</td>
						{% endif %}
					{% endfor %}
					<td class="row_{{ row }} col_{{ i + 1 }} staticCell RateResult">{{ student.RateResult }}</td>
	</table>
	<div id="tdInfo_wrap">
		<div id="tdInfo">
			<span id="student">Студент: <b></b></span>
			<span id="submodule">Мероприятие: <b></b></span>
			<span id="maxRate">Максимальный балл: <b></b></span>
		</div>
	</div>
	<div id="hidden_div">
		{ "studyGroupID": "{{ studyGroupID }}" }
{% endblock %}