Нет описания

overview.blade.php 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if($role==1)
  4. @include('local.managers.admins._new_navigation')
  5. @elseif($role==2)
  6. @include('local.managers.sCoords._new_navigation')
  7. @elseif($role==3)
  8. @include('local.managers.pCoords._new_navigation')
  9. @else
  10. @include('local.professors._navigation')
  11. @endif
  12. @stop
  13. @section('main')
  14. <div>
  15. @if(!$grouped_courses->isEmpty())
  16. <!-- Nav tabs -->
  17. <ul id="levelTabs" class="nav nav-tabs" role="tablist">
  18. @foreach($grouped_courses as $index=>$grouped_course)
  19. <li role="presentation"><a href="#{{ $index }}" aria-controls="{{ $index }}" role="tab">{{ $grouped_course->code }}{{ $grouped_course->number }} <span class="small attention">({{ $grouped_course->semester->code }})</span></a></li>
  20. @endforeach
  21. </ul>
  22. <br>
  23. <!-- Tab panes -->
  24. <div class="tab-content">
  25. @foreach($grouped_courses as $index=>$grouped_course)
  26. <div role="tabpanel" class="tab-pane" id="{{ $index }}">
  27. <div class="row">
  28. <div class="col-md-8 graph" id="graph-{{ $index }}"></div>
  29. <div class="col-md-4">
  30. <div class="panel panel-default">
  31. <div class="panel-body">
  32. <h3>About this Course</h3>
  33. <p>{{ $grouped_course->name }}</p>
  34. <p>Term: {{ $grouped_course->semester->name }}</p>
  35. <p>School: {{ $grouped_course->program->school->name }}</p>
  36. <p>Program: {{ $grouped_course->program->name }}</p>
  37. <table class="table">
  38. <thead>
  39. <tr>
  40. <th class="text-center">Section</th>
  41. <th class="text-center">Activities</th>
  42. <th class="text-center">Students</th>
  43. <th class="text-center">Assessed</th>
  44. </tr>
  45. </thead>
  46. <tbody class="text-center">
  47. @foreach($grouped_sections[$index] as $section)
  48. <tr>
  49. <td>{{ HTML::linkAction('CoursesController@show', $section->section, array($section->id)) }}</td>
  50. <td>{{ count($section->activities) }}</td>
  51. <td>{{ count($section->students) }}</td>
  52. <td>
  53. @if($section->outcomes_attempted!=NULL)
  54. <span class="glyphicon glyphicon-ok"></span>
  55. @endif
  56. </td>
  57. </tr>
  58. @endforeach
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. @endforeach
  67. </div>
  68. @else
  69. <div class="alert alert-info">
  70. You have no classes assigned for the selected semester(s). Select other semesters or contact the administrators via the Feedback page if you think it is a mistake.
  71. </div>
  72. @endif
  73. </div>
  74. @stop
  75. @section('included-js')
  76. <!-- HighCharts -->
  77. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  78. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  79. @stop
  80. @section('javascript')
  81. // --------------------------------------------------------------------------
  82. // Page load
  83. // --------------------------------------------------------------------------
  84. $('#levelTabs a:first').tab('show');
  85. loadGraphs();
  86. // --------------------------------------------------------------------------
  87. // Functions
  88. // --------------------------------------------------------------------------
  89. function loadGraphs() {
  90. @foreach($grouped_courses as $index=>$grouped_course)
  91. <?php
  92. $student_in_course = $grouped_course->getStudentReportForOutcome($grouped_course, Auth::user()->id);
  93. //Log::info($student_in_course);
  94. ?>
  95. // Load grad charts after clicking tab, so they are sized correctly.
  96. $('#graph-{{ $index }}').highcharts({
  97. chart: {
  98. type: 'bar'
  99. },
  100. title: {
  101. text: 'Achieved vs Expected Learning Outcomes'
  102. },
  103. xAxis: {
  104. categories: [
  105. @foreach($outcomes as $outcome)
  106. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  107. @if(
  108. is_array($student_in_course)
  109. && array_key_exists($outcome->id, $student_in_course)
  110. && $student_in_course[$outcome->id]['calculations']['student_attempted']!=0)
  111. <?php
  112. $attempted = $student_in_course[$outcome->id]['calculations']['student_attempted'];
  113. if( isset($student_in_course[$outcome->id]['calculations']['student_achieved']))
  114. $achieved =$student_in_course[$outcome->id]['calculations']['student_achieved'];
  115. else $achieved = 0;
  116. ?>
  117. @else
  118. <?php
  119. $attempted =0;
  120. $achieved = 0;
  121. ?>
  122. @endif
  123. "{{{ $outcome->name }}} <br> (N = {{$attempted}} , {{$achieved}} ) ",
  124. @endif
  125. @endforeach
  126. ],
  127. labels: {
  128. style: {
  129. fontSize:'11px'
  130. },
  131. step:1,
  132. useHTML:true,
  133. formatter: function() {
  134. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  135. },
  136. }
  137. },
  138. yAxis: {
  139. min: 0,
  140. max: 100,
  141. title: {
  142. text: 'Percentage'
  143. },
  144. @if($grouped_course->program->expected_outcome_target == null)
  145. plotLines:[{
  146. value:70.00,
  147. color: '#000',
  148. width:3,
  149. zIndex:4,
  150. label:{
  151. text: 'Goal (70.00%)',
  152. style: {
  153. color: '#000',
  154. fontSize: '14px',
  155. }
  156. }
  157. }]
  158. @else plotLines:[{
  159. value:{{$grouped_course->program->expected_outcome_target->expected_target}},
  160. color: '#000',
  161. width:3,
  162. zIndex:4,
  163. label:{
  164. text: 'Goal ({{$grouped_course->program->expected_outcome_target->expected_target}})',
  165. style: {
  166. color: '#000',
  167. fontSize: '14px',
  168. }
  169. }
  170. }]
  171. @endif
  172. },
  173. tooltip: {
  174. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  175. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  176. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  177. footerFormat: '</table>',
  178. shared: true,
  179. useHTML: true
  180. },
  181. plotOptions: {
  182. bar: {
  183. //grouping: false,
  184. shadow: false,
  185. borderWidth: 0,
  186. },
  187. series: {
  188. pointPadding: 0,
  189. groupPadding: 0.075
  190. },
  191. },
  192. series: [{
  193. name: 'Achieved',
  194. color: '#e70033',
  195. dataLabels: {
  196. enabled: true,
  197. fontSize: 8,
  198. color: '#fff',
  199. align: 'right',
  200. format: '{y:.1f}%',
  201. style: {
  202. //fontWeight: 'bold'
  203. },
  204. y:-1
  205. },
  206. data:[
  207. @foreach($outcomes as $outcome)
  208. <?php
  209. // Log::info($grouped_outcomes_attempted_results[$index]);
  210. // Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
  211. //
  212. // Log::info($grouped_course);
  213. // Log::info($outcome->level);
  214. // Log::info($grouped_course->is_graduate);
  215. // Log::info($grouped_course->is_graduate==0);
  216. // Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
  217. //
  218. ?>
  219. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  220. @if(
  221. is_array($student_in_course)
  222. && array_key_exists($outcome->id, $student_in_course)
  223. && $student_in_course[$outcome->id]['calculations']['student_attempted']!=0)
  224. {{{ ($student_in_course[$outcome->id]['calculations']['student_achieved']/$student_in_course[$outcome->id]['calculations']['student_attempted'])*100 }}},
  225. @else
  226. 0,
  227. @endif
  228. @endif
  229. @endforeach
  230. ],
  231. pointPadding: 0,
  232. } {{-- , {
  233. } {{--, {
  234. >>>>>>> Stashed changes
  235. name: 'Expected',
  236. color: '#555555',
  237. dataLabels: {
  238. enabled: true,
  239. fontSize: 8,
  240. color: '#fff',
  241. align: 'right',
  242. format: '{y:.1f}%',
  243. style: {
  244. //fontWeight: 'bold'
  245. },
  246. y:-1
  247. },
  248. data: [
  249. @foreach($outcomes as $outcome)
  250. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  251. @if(
  252. is_array($grouped_outcomes_attempted_results[$index])
  253. && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
  254. && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
  255. {{{ $outcome->expected_outcome }}},
  256. @else
  257. 0,
  258. @endif
  259. @endif
  260. @endforeach
  261. ],
  262. pointPadding: 0,
  263. } --}}]
  264. });
  265. @endforeach
  266. }
  267. // --------------------------------------------------------------------------
  268. // Events
  269. // --------------------------------------------------------------------------
  270. $('#levelTabs a').click(function (e) {
  271. e.preventDefault()
  272. $(this).tab('show');
  273. loadGraphs();
  274. });
  275. // Include dummy graph for outcomes
  276. @include('global.dummy-outcomes')
  277. @stop