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

page exam (dev version)

parent 1fb49496
Branches issue374_selenium_gen
No related merge requests found
......@@ -243,10 +243,15 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
$i_r++;
$rateHandled[$i_g]['Students'][$i_s]['Rates'][$i_r]['SubmoduleID'] = $r['SubmoduleID'];
$rateHandled[$i_g]['Students'][$i_s]['Rates'][$i_r]['Rate'] = $r['Rate'];
$rateHandled[$i_g]['Students'][$i_s]['Rates'][$i_r]['Rate'] = $r['Rate'];
$rateHandled[$i_g]['Students'][$i_s]['Rates'][$i_r]['ModuleType'] = $r['ModuleType'];
if ($r['ModuleType'] == 'exam') {
if (!is_null($r['Rate']))
if (!is_null($r['Rate'])) {
for ($k = 1; $k < $i_r; $k++)
if ($rateHandled[$i_g]['Students'][$i_s]['Rates'][$k]['ModuleType'] == 'exam')
$rateHandled[$i_g]['Students'][$i_s]['Rates'][$k]['Block'] = 'True';
$examRate = $r['Rate'];
}
} else {
$extraNum = $i_r;
$rateHandled[$i_g]['Students'][$i_s]['RateResult'] += $r['Rate'];
......@@ -254,18 +259,20 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
}
$rateHandled[$i_g]['Students'][$i_s]['RateResult'] += $examRate;
$total = $db->GetStudentRate($row['ID'], $id);
$rateHandled[$i_g]['Students'][$i_s]['RateSemesterResult'] = $total[0]['Num'] - $rateHandled[$i_g]['Students'][$i_s]['RateResult'];
$rateHandled[$i_g]['Students'][$i_s]['RateResult'] = $total[0]['Num'];
$total = $total[0]['Num'];
if (is_null($total)) $total = 0;
$rateHandled[$i_g]['Students'][$i_s]['RateSemesterResult'] = $total - $rateHandled[$i_g]['Students'][$i_s]['RateResult'];
$rateHandled[$i_g]['Students'][$i_s]['RateResult'] = $total;
$rateHandled[$i_g]['Students'][$i_s]['Rates'][$extraNum+1]['SubmoduleID'] = -1;
$curRate = $total[0]['Num'] - $examRate - $rateHandled[$i_g]['Students'][$i_s]['Rates'][$extraNum+1]['Rate'];
$curRate = $total - $examRate - $rateHandled[$i_g]['Students'][$i_s]['Rates'][$extraNum+1]['Rate'];
if ($curRate < 32 OR $curRate > 38)
$rateHandled[$i_g]['Students'][$i_s]['Extra'] = 0;
else
$rateHandled[$i_g]['Students'][$i_s]['Extra'] = 38 - $curRate;
}
//echo Debug::vars($structureHandled,$rateHandled);
//echo debug::vars($rateHandled);
$twig->rateTable = $rateHandled;
$twig->groups = $groupsHandled;
......
{% extends 'base' %}
{% block title %}Экзамен{% endblock %} {# head -> title #}
{% block title %}Сессия{% endblock %} {# head -> title #}
{% block media %} {# head -> css, js #}
{{ HTML.script('media/js/functions.js')|raw }}
......@@ -8,7 +8,7 @@
{{ HTML.script('media/js/rating.js')|raw }}
{% endblock %}
{% block main_top_title %}Экзамен{% endblock %}
{% block main_top_title %}Сессия{% endblock %}
{% block main_content %}
<h2 style="margin-left: 2.5%; font-weight: normal; color: #3399CC;">Экзамен</h2>
......@@ -63,21 +63,27 @@
{% 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>
<td colspan="{{ CellCount + 3 }}">{% if group.isAttached == 1 %} {{ group.GradeTitle }} {% endif %}{{ group.GroupNum }} группа</td>
</tr>
{% for student in group.Students %}
{% set row = row + 1 %}
{% set j = 0 %}
<tr id="{{ row }}" class="{{ group.GroupID }}">
<td class="student" id="{{ student.ID }}">{{ student.Last }} {{ student.First }}</td>
<td class="row_{{ row }} col_{{ i + 1 }} RateSemesterResult">{{ student.RateSemesterResult }}</td>
<td class="student staticCell" id="{{ student.ID }}">{{ student.Last }} {{ student.First }}</td>
<td class="row_{{ row }} col_{{ i + 1 }} staticCell RateSemesterResult">{{ student.RateSemesterResult }}</td>
{% for i in 1..CellCount %}
{% set j = j + 1 %}
<td id="{{ j }}" class="rateCell">
<input type="text" value="{{ student.Rates[i].Rate }}">
</td>
{% if student.Rates[i].Block == 'True' %}
<td id="{{ j }}" class="notChange {% if student.ModuleType == 'exam' %}tryExamCell{% endif %}">
<p>{{ student.Rates[i].Rate }}</p>
</td>
{% else %}
<td id="{{ j }}" class="rateCell {% if student.ModuleType == 'exam' %}tryExamCell{% endif %}">
<input type="text" value="{{ student.Rates[i].Rate }}">
</td>
{% endif %}
{% endfor %}
<td class="row_{{ row }} col_{{ i + 1 }} RateResult">{{ student.RateResult }}</td>
<td class="row_{{ row }} col_{{ i + 1 }} staticCell RateResult">{{ student.RateResult }}</td>
</tr>
{% endfor %}
{% endfor %}
......
......@@ -79,7 +79,7 @@
{% set row = row + 1 %}
{% set j = 0 %}
<tr id="{{ row }}" class="{{ group.GroupID }}">
<td class="student" id="{{ student.ID }}">{{ student.Last }} {{ student.First }}</td>
<td class="student staticCell" id="{{ student.ID }}">{{ student.Last }} {{ student.First }}</td>
{% for i in 1..CellCount %}
{% set j = j + 1 %}
{% if student.Rates[i].SubmoduleID >= 0 %}
......@@ -88,12 +88,12 @@
</td>
{% else %}
{% set j = j - 1 %}
<td class="rateCell notChange">
<td class="rateCell staticCell notChange">
<p>{{ student.Rates[i].Rate }}</p>
</td>
{% endif %}
{% endfor %}
<td class="row_{{ row }} col_{{ i + 1 }} RateResult">{{ student.RateResult }}</td>
<td class="row_{{ row }} col_{{ i + 1 }} staticCell RateResult">{{ student.RateResult }}</td>
</tr>
{% endfor %}
{% endfor %}
......
......@@ -54,8 +54,9 @@ $(function() {
$("tr#" + g_row + " .rateCell").each(function(){
$(this).children('input').css("background-color", "#f1f1f1");
});
$("tr#" + g_row + " .student").css("background-color", "#f1f1f1");
$("tr#" + g_row + " .RateResult").css("background-color", "#f1f1f1");
$("tr#" + g_row + " .staticCell").each(function(){
$(this).css("background-color", "#f1f1f1");
});
jThis.children('input').css("background-color", "#fff");
}
......@@ -68,8 +69,9 @@ $(function() {
$("tr#" + g_row + " .rateCell").each(function(){
$(this).children('input').css("background-color", "#fff");
});
$("tr#" + g_row + " .student").css("background-color", "#fff");
$("tr#" + g_row + " .RateResult").css("background-color", "#fff");
$("tr#" + g_row + " .staticCell").each(function(){
$(this).css("background-color", "#fff");
});
}
function TdInfo(jThis) {
......@@ -130,7 +132,7 @@ $(function() {
EventInspector_ShowMsg("Сессия истекла", "error");
jThis.children("input").val(oldRate);
jThis.children("input").removeAttr("disabled");
window.location.replace(URLdir);
window.location.replace(URLdir);
},
200: function(data) {
data = $.parseJSON(data);
......
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