No Description

course.blade.php 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. <th>Diagnostic</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. @foreach ($activities as $activity)
  74. <tr>
  75. <td>{{ link_to_action('ActivitiesController@show', $activity->name, $parameters = array('id'=>$activity->id)) }}</td>
  76. <td>{{ date('M d, Y', strtotime($activity->date)) }}</td>
  77. <td>{{ date('M d, Y', strtotime($activity->updated_at)) }}</td>
  78. <td>
  79. @if($activity->o_att_array)
  80. <span class="glyphicon glyphicon-ok"></span>
  81. @endif
  82. </td>
  83. <td>
  84. @if($activity->o_att_array && !$activity->draft && !$activity->diagnostic)
  85. <span class="glyphicon glyphicon-ok"></span>
  86. @endif
  87. </td>
  88. <td>
  89. @if($activity->o_att_array && !$activity->draft && $activity->diagnostic)
  90. <span class="glyphicon glyphicon-ok"></span>
  91. @endif
  92. </td>
  93. </tr>
  94. @endforeach
  95. @if (!in_array($course->semester->id, $active_semesters))
  96. <tr>
  97. <td colspan="3"><div class="alert alert-info">The semester for this course is inactive. You cannot create any more activities.</div></td>
  98. </tr>
  99. @endif
  100. </tbody>
  101. </table>
  102. <p>Unplublished activity results are <strong>not considered</strong> in the graph above.</p>
  103. @else
  104. <div class="alert alert-info">
  105. @if(in_array($course->semester->id, $active_semesters))
  106. <p>
  107. No activities.
  108. <a data-toggle="modal" data-target="#newActivityModal">
  109. Create one.
  110. </a>
  111. </p>
  112. @else
  113. <p>The semester for this course is inactive. You cannot create any activities.</p>
  114. @endif
  115. </div>
  116. @endif
  117. <button class="btn-lg btn-primary" style="margin:5px;" data-toggle="modal" data-target="#compareActivities">Compare Activities</button>
  118. <div class="modal fade" id="compareActivities">
  119. <div class="modal-dialog modal-sm">
  120. <div class="modal-content">
  121. <div class="modal-header">
  122. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  123. <h4 class="modal-title">Compare Two Activities</h4>
  124. </div>
  125. <div class="modal-body">
  126. <p></p>
  127. <h5>Select two activities to compare and present their data. <br></h5>
  128. <div class="form-group">
  129. <label>Activity 1</label>
  130. <select id='select-activity-1' data-count = "1" class="form-control selectpicker" >
  131. @foreach ($activities as $activity)
  132. @if($activity->is_assessed())
  133. <option value='{{$activity->id}}' >{{$activity->name}}</option>
  134. @endif
  135. @endforeach
  136. </select>
  137. <hr>
  138. <label>Activity 2</label>
  139. <select id='select-activity-2' data-count = "1" class="form-control selectpicker" >
  140. @foreach ($activities as $activity)
  141. @if($activity->is_assessed())
  142. <option value='{{$activity->id}}' >{{$activity->name}}</option>
  143. @endif
  144. @endforeach
  145. </select>
  146. <hr>
  147. </div>
  148. </div>
  149. <div class="modal-footer">
  150. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  151. <button type ="button" class= 'btn btn-primary' onclick ="goToURL()"
  152. @if(!count($activities))
  153. disabled
  154. @endif
  155. >Compare</button>
  156. {{ Form::close() }}
  157. </div>
  158. </div><!-- /.modal-content -->
  159. </div><!-- /.modal-dialog -->
  160. </div>
  161. </div>
  162. <div class="col-md-5">
  163. <h3>Students</h3>
  164. @if(!$students->isEmpty())
  165. <!-- If any section is assessed -->
  166. @if($course->outcomes_attempted!=NULL)
  167. {{ HTML::linkAction('CoursesController@exportGrades', 'Export grades to CSV file', array('id'=>$course->id), array('class'=>'btn btn-default btn-sm pull-right')) }}
  168. @endif
  169. <table class="table table-striped table-condensed">
  170. <thead><tr>
  171. <th></th>
  172. <th>Name</th>
  173. <th>Number</th>
  174. <th>School</th>
  175. <th>Major</th>
  176. </tr></thead>
  177. <tbody>
  178. @foreach ($students as $i => $student)
  179. <?php $formatted_student_number = substr($student->number, 0, 3).'-'.substr($student->number, 3, -4).'-'.substr($student->number, 5, 8); ?>
  180. <tr>
  181. <td>{{$i+1}}</td>
  182. <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>
  183. <td>{{ $formatted_student_number }}</td>
  184. <td>{{ $student->school_code }}</td>
  185. <td>{{ $student->conc_code }}</td>
  186. </tr>
  187. @endforeach
  188. </tbody>
  189. </table>
  190. @else
  191. <div class="alert alert-info"><p>No students. <a href=""></a></p></div>
  192. @endif
  193. </div>
  194. </div>
  195. <script>
  196. function goToURL(){
  197. activity1 = $('#select-activity-1').val();
  198. activity2 = $('#select-activity-2').val();
  199. if(activity1 && activity2)
  200. window.open('../compare_activities/'+activity1+'/'+activity2,'_self');
  201. }
  202. </script>
  203. @stop
  204. @section('included-js')
  205. <!-- HighCharts -->
  206. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  207. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  208. @stop
  209. @section('javascript')
  210. $(function () {
  211. $('#graph').highcharts({
  212. chart: {
  213. type: 'bar'
  214. },
  215. title: {
  216. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  217. },
  218. xAxis: {
  219. categories: [
  220. @foreach($outcomes as $outcome)
  221. "{{{ $outcome->name }}}",
  222. @endforeach
  223. ],
  224. labels: {
  225. style: {
  226. fontSize:'11px'
  227. },
  228. step:1,
  229. useHTML:true,
  230. formatter: function() {
  231. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  232. },
  233. }
  234. },
  235. yAxis: {
  236. min: 0,
  237. max: 100,
  238. title: {
  239. text: 'Percentage'
  240. }
  241. },
  242. tooltip: {
  243. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  244. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  245. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  246. footerFormat: '</table>',
  247. shared: true,
  248. useHTML: true
  249. },
  250. plotOptions: {
  251. bar: {
  252. //grouping: false,
  253. shadow: false,
  254. borderWidth: 0,
  255. },
  256. series: {
  257. pointPadding: 0,
  258. groupPadding: 0.075
  259. },
  260. },
  261. series: [{
  262. name: 'Obtained Value',
  263. color: '#e70033',
  264. dataLabels: {
  265. enabled: true,
  266. fontSize: 8,
  267. color: '#fff',
  268. align: 'right',
  269. format: '{y:.1f}%',
  270. style: {
  271. //fontWeight: 'bold'
  272. },
  273. y:-1
  274. },
  275. data:[
  276. @foreach($outcomes as $index => $outcome)
  277. @if(
  278. is_array($outcomes_attempted)
  279. && array_key_exists($outcome->id, $outcomes_attempted)
  280. && array_key_exists($outcome->id, $outcomes_achieved)
  281. && $outcomes_attempted[$outcome->id]!=0)
  282. {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
  283. @else
  284. 0,
  285. @endif
  286. @endforeach
  287. ],
  288. pointPadding: 0,
  289. }, {
  290. name: 'Expected Value',
  291. color: '#555555',
  292. dataLabels: {
  293. enabled: true,
  294. fontSize: 8,
  295. color: '#fff',
  296. align: 'right',
  297. format: '{y:.1f}%',
  298. style: {
  299. //fontWeight: 'bold'
  300. },
  301. y:-1
  302. },
  303. data: [
  304. @foreach($outcomes as $index => $outcome)
  305. @if(
  306. is_array($outcomes_attempted)
  307. && array_key_exists($outcome->id, $outcomes_attempted)
  308. && $outcomes_attempted[$outcome->id]!=0)
  309. {{{ $outcome->expected_outcome }}},
  310. @else
  311. 0,
  312. @endif
  313. @endforeach
  314. ],
  315. pointPadding: 0,
  316. }]
  317. });
  318. // Include dummy graph for outcomes
  319. @include('global.dummy-outcomes')
  320. });
  321. @stop