No Description

overview.blade.php 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. plotLines:[{
  145. value:66.67,
  146. color: '#000',
  147. width:3,
  148. zIndex:4,
  149. label:{
  150. text: 'Goal (66.67%)',
  151. style: {
  152. color: '#000',
  153. fontSize: '14px',
  154. }
  155. }
  156. }]
  157. },
  158. tooltip: {
  159. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  160. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  161. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  162. footerFormat: '</table>',
  163. shared: true,
  164. useHTML: true
  165. },
  166. plotOptions: {
  167. bar: {
  168. //grouping: false,
  169. shadow: false,
  170. borderWidth: 0,
  171. },
  172. series: {
  173. pointPadding: 0,
  174. groupPadding: 0.075
  175. },
  176. },
  177. series: [{
  178. name: 'Achieved',
  179. color: '#e70033',
  180. dataLabels: {
  181. enabled: true,
  182. fontSize: 8,
  183. color: '#fff',
  184. align: 'right',
  185. format: '{y:.1f}%',
  186. style: {
  187. //fontWeight: 'bold'
  188. },
  189. y:-1
  190. },
  191. data:[
  192. @foreach($outcomes as $outcome)
  193. <?php
  194. // Log::info($grouped_outcomes_attempted_results[$index]);
  195. // Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
  196. //
  197. // Log::info($grouped_course);
  198. // Log::info($outcome->level);
  199. // Log::info($grouped_course->is_graduate);
  200. // Log::info($grouped_course->is_graduate==0);
  201. // Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
  202. //
  203. ?>
  204. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  205. @if(
  206. is_array($student_in_course)
  207. && array_key_exists($outcome->id, $student_in_course)
  208. && $student_in_course[$outcome->id]['calculations']['student_attempted']!=0)
  209. {{{ ($student_in_course[$outcome->id]['calculations']['student_achieved']/$student_in_course[$outcome->id]['calculations']['student_attempted'])*100 }}},
  210. @else
  211. 0,
  212. @endif
  213. @endif
  214. @endforeach
  215. ],
  216. pointPadding: 0,
  217. } {{-- , {
  218. } {{--, {
  219. >>>>>>> Stashed changes
  220. name: 'Expected',
  221. color: '#555555',
  222. dataLabels: {
  223. enabled: true,
  224. fontSize: 8,
  225. color: '#fff',
  226. align: 'right',
  227. format: '{y:.1f}%',
  228. style: {
  229. //fontWeight: 'bold'
  230. },
  231. y:-1
  232. },
  233. data: [
  234. @foreach($outcomes as $outcome)
  235. @if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
  236. @if(
  237. is_array($grouped_outcomes_attempted_results[$index])
  238. && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
  239. && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
  240. {{{ $outcome->expected_outcome }}},
  241. @else
  242. 0,
  243. @endif
  244. @endif
  245. @endforeach
  246. ],
  247. pointPadding: 0,
  248. } --}}]
  249. });
  250. @endforeach
  251. }
  252. // --------------------------------------------------------------------------
  253. // Events
  254. // --------------------------------------------------------------------------
  255. $('#levelTabs a').click(function (e) {
  256. e.preventDefault()
  257. $(this).tab('show');
  258. loadGraphs();
  259. });
  260. // Include dummy graph for outcomes
  261. @include('global.dummy-outcomes')
  262. @stop