Ingen beskrivning

overview.blade.php 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if($role==1)
  4. @include('local.managers.admins._navigation')
  5. @elseif($role==2)
  6. @include('local.managers.sCoords._navigation')
  7. @elseif($role==3)
  8. @include('local.managers.pCoords._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. // Load grad charts after clicking tab, so they are sized correctly.
  92. $('#graph-{{ $index }}').highcharts({
  93. chart: {
  94. type: 'bar'
  95. },
  96. title: {
  97. text: 'Achieved vs Expected Learning Outcomes'
  98. },
  99. xAxis: {
  100. categories: [
  101. @foreach($outcomes as $outcome)
  102. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  103. "{{{ $outcome->name }}}",
  104. @endif
  105. @endforeach
  106. ],
  107. labels: {
  108. style: {
  109. fontSize:'11px'
  110. },
  111. step:1,
  112. useHTML:true,
  113. formatter: function() {
  114. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  115. },
  116. }
  117. },
  118. yAxis: {
  119. min: 0,
  120. max: 100,
  121. title: {
  122. text: 'Percentage'
  123. }
  124. },
  125. tooltip: {
  126. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  127. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  128. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  129. footerFormat: '</table>',
  130. shared: true,
  131. useHTML: true
  132. },
  133. plotOptions: {
  134. bar: {
  135. //grouping: false,
  136. shadow: false,
  137. borderWidth: 0,
  138. },
  139. series: {
  140. pointPadding: 0,
  141. groupPadding: 0.075
  142. },
  143. },
  144. series: [{
  145. name: 'Achieved',
  146. color: '#e70033',
  147. dataLabels: {
  148. enabled: true,
  149. fontSize: 8,
  150. color: '#fff',
  151. align: 'right',
  152. format: '{y:.1f}%',
  153. style: {
  154. //fontWeight: 'bold'
  155. },
  156. y:-1
  157. },
  158. data:[
  159. @foreach($outcomes as $outcome)
  160. <?php
  161. // Log::info($grouped_outcomes_attempted_results[$index]);
  162. // Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
  163. //
  164. // Log::info($grouped_course);
  165. // Log::info($outcome->level);
  166. // Log::info($grouped_course->is_graduate);
  167. // Log::info($grouped_course->is_graduate==0);
  168. // Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
  169. //
  170. ?>
  171. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  172. @if(
  173. is_array($grouped_outcomes_attempted_results[$index])
  174. && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
  175. && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
  176. {{{ ($grouped_outcomes_achieved_results[$index][$outcome->id]/$grouped_outcomes_attempted_results[$index][$outcome->id])*100 }}},
  177. @else
  178. 0,
  179. @endif
  180. @endif
  181. @endforeach
  182. ],
  183. pointPadding: 0,
  184. }, {
  185. name: 'Expected',
  186. color: '#555555',
  187. dataLabels: {
  188. enabled: true,
  189. fontSize: 8,
  190. color: '#fff',
  191. align: 'right',
  192. format: '{y:.1f}%',
  193. style: {
  194. //fontWeight: 'bold'
  195. },
  196. y:-1
  197. },
  198. data: [
  199. @foreach($outcomes as $outcome)
  200. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  201. @if(
  202. is_array($grouped_outcomes_attempted_results[$index])
  203. && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
  204. && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
  205. {{{ $outcome->expected_outcome }}},
  206. @else
  207. 0,
  208. @endif
  209. @endif
  210. @endforeach
  211. ],
  212. pointPadding: 0,
  213. }]
  214. });
  215. @endforeach
  216. }
  217. // --------------------------------------------------------------------------
  218. // Events
  219. // --------------------------------------------------------------------------
  220. $('#levelTabs a').click(function (e) {
  221. e.preventDefault()
  222. $(this).tab('show');
  223. loadGraphs();
  224. });
  225. // Include dummy graph for outcomes
  226. @include('global.dummy-outcomes')
  227. @stop