Aucune description

course.blade.php 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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. <!-- New Activity Modal -->
  15. <div class="modal fade" id="newActivityModal" tabindex="-1" role="dialog" aria-labelledby="newActivityModalLabel" aria-hidden="true">
  16. <div class="modal-dialog modal-sm">
  17. <div class="modal-content">
  18. <div class="modal-header">
  19. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  20. <h4 class="modal-title" id="newActivityModalLabel">New Activity</h4>
  21. </div>
  22. <div class="modal-body">
  23. {{ Form::open(array('action' => array('ActivitiesController@create', $course->id))) }}
  24. <div class="form-group">
  25. {{ Form::label('name', 'Name') }}
  26. {{ Form::text('name', Input::old('name'), array('class' => 'form-control')) }}
  27. </div>
  28. <div class="form-group">
  29. {{ Form::label('description', 'Description') }}
  30. {{ Form::textarea('description', Input::old('description'), array('class' => 'form-control', 'rows'=> 5, 'placeholder'=>'Minimum 10 characters')) }}
  31. </div>
  32. <div class="btn-group" role="group">
  33. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  34. <button type="submit" class="btn btn-default btn-primary">Submit</button>
  35. </div>
  36. {{ Form::close() }}
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="row">
  42. <div class="col-md-12">
  43. <p>{{$course->name}}</p>
  44. </div>
  45. </div>
  46. <div id="dummy-graph-container" class="row">
  47. @if(is_array($outcomes_attempted))
  48. <div class="col-md-12" id="graph"></div>
  49. @else
  50. <div id="overlay"><h2>No Data</h2></div>
  51. <div class="col-md-12" id="dummy"></div>
  52. @endif
  53. </div>
  54. <div class="row">
  55. <div class="col-md-7">
  56. <h3>Activities</h3>
  57. @if(!$activities->isEmpty())
  58. @if (in_array($course->semester->id, $active_semesters))
  59. <button data-toggle="modal" data-target="#newActivityModal" class="btn btn-sm btn-default pull-right"> New Activity</button>
  60. @endif
  61. <table class="table table-striped table-condensed">
  62. <thead>
  63. <tr>
  64. <th>Name</th>
  65. <th>Date</th>
  66. <th>Updated</th>
  67. <th>Assessed</th>
  68. <th>Published</th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. @foreach ($activities as $activity)
  73. <tr>
  74. <td>{{ link_to_action('ActivitiesController@show', $activity->name, $parameters = array('id'=>$activity->id)) }}</td>
  75. <td>{{ date('M d, Y', strtotime($activity->date)) }}</td>
  76. <td>{{ date('M d, Y', strtotime($activity->updated_at)) }}</td>
  77. <td>
  78. @if($activity->outcomes_attempted!=NULL)
  79. <span class="glyphicon glyphicon-ok"></span>
  80. @endif
  81. </td>
  82. <td>
  83. @if($activity->outcomes_attempted!=NULL && !$activity->draft)
  84. <span class="glyphicon glyphicon-ok"></span>
  85. @endif
  86. </td>
  87. </tr>
  88. @endforeach
  89. @if (!in_array($course->semester->id, $active_semesters))
  90. <tr>
  91. <td colspan="3"><div class="alert alert-info">The semester for this course is inactive. You cannot create any more activities.</div></td>
  92. </tr>
  93. @endif
  94. </tbody>
  95. </table>
  96. <p>Unplublished activity results are <strong>not considered</strong> in the graph above.</p>
  97. @else
  98. <div class="alert alert-info">
  99. @if(in_array($course->semester->id, $active_semesters))
  100. <p>
  101. No activities.
  102. <a data-toggle="modal" data-target="#newActivityModal">
  103. Create one.
  104. </a>
  105. </p>
  106. @else
  107. <p>The semester for this course is inactive. You cannot create any activities.</p>
  108. @endif
  109. </div>
  110. @endif
  111. </div>
  112. <div class="col-md-5">
  113. <h3>Students</h3>
  114. @if(!$students->isEmpty())
  115. <!-- If any section is assessed -->
  116. @if($course->outcomes_attempted!=NULL)
  117. {{ HTML::linkAction('CoursesController@exportGrades', 'Export grades to CSV file', array('id'=>$course->id), array('class'=>'btn btn-default btn-sm pull-right')) }}
  118. @endif
  119. <table class="table table-striped table-condensed">
  120. <thead><tr>
  121. <th></th>
  122. <th>Name</th>
  123. <th>Number</th>
  124. <th>School</th>
  125. <th>Major</th>
  126. </tr></thead>
  127. <tbody>
  128. @foreach ($students as $i => $student)
  129. <?php $formatted_student_number = substr($student->number, 0, 3).'-'.substr($student->number, 3, -4).'-'.substr($student->number, 5, 8); ?>
  130. <tr>
  131. <td>{{$i+1}}</td>
  132. <td><a href="{{ URL::action('StudentsController@show', array('semester'=>$course->semester_id, 'id'=>$course->code.$course->number.'-'.$course->section, 'number'=>$student->number)) }}">{{ $student->name }}</a></td>
  133. <td>{{ $formatted_student_number }}</td>
  134. <td>{{ $student->school_code }}</td>
  135. <td>{{ $student->conc_code }}</td>
  136. </tr>
  137. @endforeach
  138. </tbody>
  139. </table>
  140. @else
  141. <div class="alert alert-info"><p>No students. <a href=""></a></p></div>
  142. @endif
  143. </div>
  144. </div>
  145. @stop
  146. @section('included-js')
  147. <!-- HighCharts -->
  148. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  149. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  150. @stop
  151. @section('javascript')
  152. $(function () {
  153. $('#graph').highcharts({
  154. chart: {
  155. type: 'bar'
  156. },
  157. title: {
  158. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  159. },
  160. xAxis: {
  161. categories: [
  162. @foreach($outcomes as $outcome)
  163. "{{{ $outcome->name }}}",
  164. @endforeach
  165. ],
  166. labels: {
  167. style: {
  168. fontSize:'11px'
  169. },
  170. step:1,
  171. useHTML:true,
  172. formatter: function() {
  173. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  174. },
  175. }
  176. },
  177. yAxis: {
  178. min: 0,
  179. max: 100,
  180. title: {
  181. text: 'Percentage'
  182. }
  183. },
  184. tooltip: {
  185. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  186. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  187. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  188. footerFormat: '</table>',
  189. shared: true,
  190. useHTML: true
  191. },
  192. plotOptions: {
  193. bar: {
  194. //grouping: false,
  195. shadow: false,
  196. borderWidth: 0,
  197. },
  198. series: {
  199. pointPadding: 0,
  200. groupPadding: 0.075
  201. },
  202. },
  203. series: [{
  204. name: 'Obtained Value',
  205. color: '#e70033',
  206. dataLabels: {
  207. enabled: true,
  208. fontSize: 8,
  209. color: '#fff',
  210. align: 'right',
  211. format: '{y:.1f}%',
  212. style: {
  213. //fontWeight: 'bold'
  214. },
  215. y:-1
  216. },
  217. data:[
  218. @foreach($outcomes as $index => $outcome)
  219. @if(
  220. is_array($outcomes_attempted)
  221. && array_key_exists($outcome->id, $outcomes_attempted)
  222. && $outcomes_attempted[$outcome->id]!=0)
  223. {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
  224. @else
  225. 0,
  226. @endif
  227. @endforeach
  228. ],
  229. pointPadding: 0,
  230. }, {
  231. name: 'Expected Value',
  232. color: '#555555',
  233. dataLabels: {
  234. enabled: true,
  235. fontSize: 8,
  236. color: '#fff',
  237. align: 'right',
  238. format: '{y:.1f}%',
  239. style: {
  240. //fontWeight: 'bold'
  241. },
  242. y:-1
  243. },
  244. data: [
  245. @foreach($outcomes as $index => $outcome)
  246. @if(
  247. is_array($outcomes_attempted)
  248. && array_key_exists($outcome->id, $outcomes_attempted)
  249. && $outcomes_attempted[$outcome->id]!=0)
  250. {{{ $outcome->expected_outcome }}},
  251. @else
  252. 0,
  253. @endif
  254. @endforeach
  255. ],
  256. pointPadding: 0,
  257. }]
  258. });
  259. // Include dummy graph for outcomes
  260. @include('global.dummy-outcomes')
  261. });
  262. @stop