Geen omschrijving

overview.blade.php 9.0KB

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