diff --git a/~dev_rating/application/classes/Controller/Teacher/Rating.php b/~dev_rating/application/classes/Controller/Teacher/Rating.php index 6e0a33deb69fcabe53ad35b4367a7792478427fb..ff57ac8dacd3696df5d5d3d3e6d1a211ed7840bb 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Rating.php +++ b/~dev_rating/application/classes/Controller/Teacher/Rating.php @@ -11,7 +11,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { // Шапка: модули Рё подмодули $discipline = $db->GetMapForDiscipline($this->UserInfo['TeacherID'], $id); - + if($discipline->count() == 0) throw HTTP_Exception::factory (404, "Для дисциплины СЃ ID $id РЅРµ создана РЈРљР” или такой дисциплины РЅРµ существует!"); @@ -35,6 +35,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { $j = $disciplineHandled[$i]['SubmodulesCount'] += 1; $disciplineHandled[$i]['MaxRate'] += (int) $row['MaxRate']; $disciplineHandled[$i]['ModuleTitle'] = $row['ModuleName']; + $disciplineHandled[$i]['ModuleType'] = $row['ModuleType']; $disciplineHandled[$i][$j]['SubmoduleID'] = $row['SubmoduleID']; $disciplineHandled[$i][$j]['Title'] = $row['SubModuleName']; $disciplineHandled[$i][$j]['Description'] = $row['SubmoduleDescription']; @@ -44,6 +45,8 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { $disciplineHandled['ModulesCount'] = $i; $disciplineHandled['MaxRate'] = (int) $maxRate; + //echo debug::vars($disciplineHandled); + $twig->headerRate = $disciplineHandled; // Студенты Рё баллы diff --git a/~dev_rating/application/views/teacher/rating.twig b/~dev_rating/application/views/teacher/rating.twig index ead8a394a62a77ffb51b00cef74b4e8680c4b93a..beaeb57d32bb712defba7df546073ed2b979ce7c 100644 --- a/~dev_rating/application/views/teacher/rating.twig +++ b/~dev_rating/application/views/teacher/rating.twig @@ -13,46 +13,11 @@ <h2 style="margin-left: 2.5%; font-weight: normal; color: #3399CC;">{{ headerRate.SubjectName }}</h2> <p class="notification">Обратить внимание, что пустая клетка эквивалентна нулю</p> - <div class="HideStudentsRateHeadTableWrapper"> - <table class="HideStudentsRateHeadTable" border="0" cellspacing="0" cellpadding="0"> - <tr class="RatingTableModulesHead"> - <td class="title" width="150px">Модуль</td> - {% for i in 1..headerRate.ModulesCount %} - <td class="subject" colspan="{{headerRate[i].SubmodulesCount}}">{{ headerRate[i].ModuleTitle }}</td> - {% endfor %} - <td></td> - </tr> - <tr class="RatingTableSubmodulesHead"> - {% set CellCount = 0 %} - <td class="title">Мероприятие</td> - {% for i in 1..headerRate.ModulesCount %} - {% set CellCount = CellCount + headerRate[i].SubmodulesCount %} - {% for j in 1..headerRate[i].SubmodulesCount %} - <td class="subject">{{ headerRate[i][j].Title }}</td> - {% endfor %} - {% endfor %} - <td class="subject">Ртог</td> - </tr> - <tr class="RatingTableSubmodulesHeadMaxRate"> - {% 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 }}">{{ headerRate[i][j].MaxRate }}</td> - {% endfor %} - {% endfor %} - <td class="subject col_{{ col + 1}}"></td> - </tr> - </table> - </div> - <table class="studentsRate" border="0" cellspacing="0" cellpadding="0"> <tr class="RatingTableModulesHead"> <td class="title" width="150px">Модуль</td> {% for i in 1..headerRate.ModulesCount %} - <td class="subject" colspan="{{headerRate[i].SubmodulesCount}}">{{ headerRate[i].ModuleTitle }}</td> + <td class="subject" colspan="{{headerRate[i].SubmodulesCount}}" {% if headerRate[i].ModuleType == 'exam' or headerRate[i].ModuleType == 'bonus' %} rowspan="2" {% endif %}>{{ headerRate[i].ModuleTitle }}</td> {% endfor %} <td></td> </tr> @@ -61,10 +26,12 @@ <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 %} + {% 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 %} <td class="subject col_{{ col + 1}}">Ртог</td> </tr> @@ -75,7 +42,7 @@ {% set CellCount = CellCount + headerRate[i].SubmodulesCount %} {% for j in 1..headerRate[i].SubmodulesCount %} {% set col = col + 1 %} - <td class="subject col_{{ col }}">{{ headerRate[i][j].MaxRate }}</td> + <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> {% endfor %} {% endfor %} <td class="subject col_{{ col + 1}}"></td> diff --git a/~dev_rating/media/css/discipline.css b/~dev_rating/media/css/discipline.css index 4f021dcd850ae84d1380c1f6fe244457ed708c3f..fe6dabc795c880c06c66b818a1b77bf93adc6c86 100644 --- a/~dev_rating/media/css/discipline.css +++ b/~dev_rating/media/css/discipline.css @@ -305,7 +305,9 @@ padding: 8px 20px 8px 40px; margin: 0 8px; cursor: pointer; - font-size: 14px; + color: #009933; + font-weight: bold; + font-size: 13px; } /* Прикрипление РіСЂСѓРїРї */ diff --git a/~dev_rating/media/js/discipline/EditStructure.js b/~dev_rating/media/js/discipline/EditStructure.js index f89de8627e7b66c71eca49e336e3611d9e164191..a11ff2bebd4e34eac8b2178ce900a9169d029747 100644 --- a/~dev_rating/media/js/discipline/EditStructure.js +++ b/~dev_rating/media/js/discipline/EditStructure.js @@ -87,42 +87,6 @@ var jConfirmPrototype = $($.parseHTML( } ); } - - - // Рзменение типа подмодуля - // function ChangeSubmoduleControlType(ID, ControlType){ //deprecated - // $.post( - // URLdir + 'handler/map/ChangeSubmoduleControlType', - // { - // 'SubmoduleID': ID, - // 'ControlType': ControlType - // }, - // function(data){ - // data = $.parseJSON(data); - // //if(data.success === true) - // // EventInspector_ShowMsg('Форма контроля изменена', 'success'); - // //else EventInspector_ShowMsg('Ошибка РїСЂРё изменение формы контроля', 'error'); - // } - // ); - // } - - // Рзменение макс. балла подмодуля - // function ChangeSubmoduleMaxRate(thisObj, ID, NewMaxRate) { //deprecated - // $.post( - // URLdir + 'handler/map/ChangeSubmoduleMaxRate', - // { - // 'SubmoduleID': ID, - // 'MaxRate': NewMaxRate - // }, - // function(data){ - // data = $.parseJSON(data); - // if(data.success === true) - // EventInspector_ShowMsg('Max балл мероприятия изменен', 'success'); - // else EventInspector_ShowMsg('Ошибка РїСЂРё изменении max балла', 'error'); - // thisObj.removeAttr('disabled'); - // } - // ); - // } // Установить новый max балл function SetNewRateAndControl(thisObj, OldMaxRate) { @@ -301,8 +265,7 @@ var jConfirmPrototype = $($.parseHTML( } ); - if ($('.empty').css('display') == 'block') - $('.empty').css('display', 'none'); + $('.empty').remove(); }); @@ -337,15 +300,13 @@ var jConfirmPrototype = $($.parseHTML( $('.moduleList').on('click', '.deleteModule', function(){ $(this).parent().css('display', 'none'); $(this).parent().parent().append(jConfirmPrototype.clone()); + }); // Подтверждение РїСЂРё удаление модуля $('.moduleList').on('click', '.confirmDeleteModule', function(){ var thisObj = $(this); - - - // $.post( URLdir + 'handler/map/DeleteModule', { @@ -376,12 +337,16 @@ var jConfirmPrototype = $($.parseHTML( if ($('div.ExamModule').length > 0) e = 40; $('span.RateIndicator').html(c + l + e); + + if ($('div.moduleGroup').length == 0) + $('.moduleList').prepend('<div class="empty"><p class="notification">Модули отсутствуют</p></div>'); // Показываем 'Модули отсутствуют' EventInspector_ShowMsg('Модуль удален', 'success'); } else EventInspector_ShowMsg('Ошибка РїСЂРё удаление модуля', 'error'); } ); + }); // Удалить мероприятие diff --git a/~dev_rating/media/js/rating.js b/~dev_rating/media/js/rating.js index d4eee2562dddbda104de77a2535bdbddd01c6003..34efcf84539b0ee2ba11740676a2f0678ccda9f8 100644 --- a/~dev_rating/media/js/rating.js +++ b/~dev_rating/media/js/rating.js @@ -33,8 +33,9 @@ $(function() { // Получаем подмодуль var reg = /col_\d+/; var col = ''+reg.exec(thisObj.attr('class')); - SubmoduleID = $('.RatingTableSubmodulesHead .'+col+':first').attr('id'); - + //SubmoduleID = $('.RatingTableSubmodulesHead .'+col+':first').attr('id'); + SubmoduleID = $('.RatingTableSubmodulesHeadMaxRate .'+col+':first').attr('id'); + // Получаем студента var reg = /row_\d+/; var row = ''+reg.exec(thisObj.attr('class')); @@ -43,7 +44,7 @@ $(function() { if (thisObj.children('input').val() != '') var NewRate = thisObj.children('input').val(); else var NewRate = 0; - var MaxRate = $('.RatingTableSubmodulesHead .'+col+':first').children('input').val(); + var MaxRate = $('.RatingTableSubmodulesHeadMaxRate .'+col+':first').children('input').val(); if (parseInt(NewRate) <= parseInt(MaxRate)) {