No Description

overview.blade.php 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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. // 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. @if(
  104. is_array($grouped_outcomes_attempted_results[$index])
  105. && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
  106. && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
  107. <?php
  108. $attempted = $grouped_outcomes_attempted_results[$index][$outcome->id];
  109. if( isset($grouped_outcomes_achieved_results[$index][$outcome->id]))
  110. $achieved =$grouped_outcomes_achieved_results[$index][$outcome->id];
  111. else $achieved = 0;
  112. ?>
  113. @else
  114. <?php
  115. $attempted =0;
  116. $achieved = 0;
  117. ?>
  118. @endif
  119. "{{{ $outcome->name }}} <br> (N = {{$attempted}} , {{$achieved}} ) ",
  120. @endif
  121. @endforeach
  122. ],
  123. labels: {
  124. style: {
  125. fontSize:'11px'
  126. },
  127. step:1,
  128. useHTML:true,
  129. formatter: function() {
  130. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  131. },
  132. }
  133. },
  134. yAxis: {
  135. min: 0,
  136. max: 100,
  137. title: {
  138. text: 'Percentage'
  139. },
  140. plotLines:[{
  141. value:66.67,
  142. color: '#000',
  143. width:3,
  144. zIndex:4,
  145. label:{
  146. text: 'Goal (66.67%)',
  147. style: {
  148. color: '#000',
  149. fontSize: '14px',
  150. }
  151. }
  152. }]
  153. },
  154. tooltip: {
  155. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  156. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  157. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  158. footerFormat: '</table>',
  159. shared: true,
  160. useHTML: true
  161. },
  162. plotOptions: {
  163. bar: {
  164. //grouping: false,
  165. shadow: false,
  166. borderWidth: 0,
  167. },
  168. series: {
  169. pointPadding: 0,
  170. groupPadding: 0.075
  171. },
  172. },
  173. series: [{
  174. name: 'Achieved',
  175. color: '#e70033',
  176. dataLabels: {
  177. enabled: true,
  178. fontSize: 8,
  179. color: '#fff',
  180. align: 'right',
  181. format: '{y:.1f}%',
  182. style: {
  183. //fontWeight: 'bold'
  184. },
  185. y:-1
  186. },
  187. data:[
  188. @foreach($outcomes as $outcome)
  189. <?php
  190. // Log::info($grouped_outcomes_attempted_results[$index]);
  191. // Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
  192. //
  193. // Log::info($grouped_course);
  194. // Log::info($outcome->level);
  195. // Log::info($grouped_course->is_graduate);
  196. // Log::info($grouped_course->is_graduate==0);
  197. // Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
  198. //
  199. ?>
  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. {{{ ($grouped_outcomes_achieved_results[$index][$outcome->id]/$grouped_outcomes_attempted_results[$index][$outcome->id])*100 }}},
  206. @else
  207. 0,
  208. @endif
  209. @endif
  210. @endforeach
  211. ],
  212. pointPadding: 0,
  213. } {{-- , {
  214. } {{--, {
  215. >>>>>>> Stashed changes
  216. name: 'Expected',
  217. color: '#555555',
  218. dataLabels: {
  219. enabled: true,
  220. fontSize: 8,
  221. color: '#fff',
  222. align: 'right',
  223. format: '{y:.1f}%',
  224. style: {
  225. //fontWeight: 'bold'
  226. },
  227. y:-1
  228. },
  229. data: [
  230. @foreach($outcomes as $outcome)
  231. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  232. @if(
  233. is_array($grouped_outcomes_attempted_results[$index])
  234. && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
  235. && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
  236. {{{ $outcome->expected_outcome }}},
  237. @else
  238. 0,
  239. @endif
  240. @endif
  241. @endforeach
  242. ],
  243. pointPadding: 0,
  244. } --}}]
  245. });
  246. @endforeach
  247. }
  248. // --------------------------------------------------------------------------
  249. // Events
  250. // --------------------------------------------------------------------------
  251. $('#levelTabs a').click(function (e) {
  252. e.preventDefault()
  253. $(this).tab('show');
  254. loadGraphs();
  255. });
  256. // Include dummy graph for outcomes
  257. @include('global.dummy-outcomes')
  258. @stop