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

page exam (dev version)

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