Skip to content
Snippets Groups Projects
Commit e4222208 authored by xamgore's avatar xamgore
Browse files

Fix downloading exam reports

Client js tried to get (incorrectly) discipline id from URL and got error at the server side.
parent a533f4e5
Branches
Tags
No related merge requests found
...@@ -41,7 +41,7 @@ $(function () { ...@@ -41,7 +41,7 @@ $(function () {
var jTdInfo_wrap = $("#tdInfo_wrap"); var jTdInfo_wrap = $("#tdInfo_wrap");
var jTdInfo = jTdInfo_wrap.children('#tdInfo'); var jTdInfo = jTdInfo_wrap.children('#tdInfo');
var g_URL = (window.location.href).split("/"); var g_URL = (window.location.href).split("/");
var g_disciplineID = g_URL[g_URL.length - 1]; var g_disciplineID = $('#disciplineID').val();
// on page loaded // on page loaded
// Настройки дисциплины: // Настройки дисциплины:
......
...@@ -40,7 +40,7 @@ $(function () { ...@@ -40,7 +40,7 @@ $(function () {
var jTdInfo_wrap = $("#tdInfo_wrap"); var jTdInfo_wrap = $("#tdInfo_wrap");
var jTdInfo = jTdInfo_wrap.children('#tdInfo'); var jTdInfo = jTdInfo_wrap.children('#tdInfo');
var g_URL = (window.location.href).split("/"); var g_URL = (window.location.href).split("/");
var g_disciplineID = g_URL[g_URL.length - 1]; var g_disciplineID = $('#disciplineID').val();
var onCursorChange = function (cursor) { var onCursorChange = function (cursor) {
console.log('(' + cursor.row + ', ' + cursor.col + ')\n'); console.log('(' + cursor.row + ', ' + cursor.col + ')\n');
......
...@@ -193,7 +193,7 @@ class Controller_Handler_FileCreator extends Controller_Handler ...@@ -193,7 +193,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
->rule('stage', 'digit', [0, 1, 2, 3]); ->rule('stage', 'digit', [0, 1, 2, 3]);
if (!$this->post->check()) if (!$this->post->check())
throw new HTTP_Exception(417, "Некорректные параметры запроса!"); throw HTTP_Exception::factory(417, "Некорректные параметры запроса!");
// parameters // parameters
$disciplineID = $this->post['disciplineID']; $disciplineID = $this->post['disciplineID'];
......
...@@ -217,4 +217,5 @@ ...@@ -217,4 +217,5 @@
{{ Discipline_JSON|raw }} {{ Discipline_JSON|raw }}
</div> </div>
<input type="hidden" id="pageType" value="exam"/> <input type="hidden" id="pageType" value="exam"/>
<input type="hidden" id="disciplineID" value="{{ Discipline.ID }}"/>
{% endblock %} {% endblock %}
...@@ -208,4 +208,5 @@ ...@@ -208,4 +208,5 @@
{{ Discipline|json_encode|raw }} {{ Discipline|json_encode|raw }}
</div> </div>
<input type="hidden" id="pageType" value="rating"/> <input type="hidden" id="pageType" value="rating"/>
<input type="hidden" id="disciplineID" value="{{ Discipline.ID }}"/>
{% endblock %} {% endblock %}
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