Нет описания

course.blade.php 13KB

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>Vas a seleccionar dos actividades para comparar y presentar los datos de las actividades</p>
  127. <h5>Escoge dos actividades para comparar <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. <option value='{{$activity->id}}' >{{$activity->name}}</option>
  133. @endforeach
  134. </select>
  135. <hr>
  136. <label>Activity 2</label>
  137. <select id='select-activity-2' data-count = "1" class="form-control selectpicker" >
  138. @foreach ($activities as $activity)
  139. <option value='{{$activity->id}}' >{{$activity->name}}</option>
  140. @endforeach
  141. </select>
  142. <hr>
  143. </div>
  144. </div>
  145. <div class="modal-footer">
  146. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  147. <button type ="button" class= 'btn btn-primary' onclick ="goToURL()"
  148. @if(!count($activities))
  149. disabled
  150. @endif
  151. >Compare</button>
  152. {{ Form::close() }}
  153. </div>
  154. </div><!-- /.modal-content -->
  155. </div><!-- /.modal-dialog -->
  156. </div>
  157. </div>
  158. <div class="col-md-5">
  159. <h3>Students</h3>
  160. @if(!$students->isEmpty())
  161. <!-- If any section is assessed -->
  162. @if($course->outcomes_attempted!=NULL)
  163. {{ HTML::linkAction('CoursesController@exportGrades', 'Export grades to CSV file', array('id'=>$course->id), array('class'=>'btn btn-default btn-sm pull-right')) }}
  164. @endif
  165. <table class="table table-striped table-condensed">
  166. <thead><tr>
  167. <th></th>
  168. <th>Name</th>
  169. <th>Number</th>
  170. <th>School</th>
  171. <th>Major</th>
  172. </tr></thead>
  173. <tbody>
  174. @foreach ($students as $i => $student)
  175. <?php $formatted_student_number = substr($student->number, 0, 3).'-'.substr($student->number, 3, -4).'-'.substr($student->number, 5, 8); ?>
  176. <tr>
  177. <td>{{$i+1}}</td>
  178. <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>
  179. <td>{{ $formatted_student_number }}</td>
  180. <td>{{ $student->school_code }}</td>
  181. <td>{{ $student->conc_code }}</td>
  182. </tr>
  183. @endforeach
  184. </tbody>
  185. </table>
  186. @else
  187. <div class="alert alert-info"><p>No students. <a href=""></a></p></div>
  188. @endif
  189. </div>
  190. </div>
  191. <script>
  192. function goToURL(){
  193. activity1 = $('#select-activity-1').val();
  194. activity2 = $('#select-activity-2').val();
  195. if(activity1 && activity2)
  196. window.open('../compare_activities/'+activity1+'/'+activity2,'_self');
  197. }
  198. </script>
  199. @stop
  200. @section('included-js')
  201. <!-- HighCharts -->
  202. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  203. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  204. @stop
  205. @section('javascript')
  206. $(function () {
  207. $('#graph').highcharts({
  208. chart: {
  209. type: 'bar'
  210. },
  211. title: {
  212. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  213. },
  214. xAxis: {
  215. categories: [
  216. @foreach($outcomes as $outcome)
  217. "{{{ $outcome->name }}}",
  218. @endforeach
  219. ],
  220. labels: {
  221. style: {
  222. fontSize:'11px'
  223. },
  224. step:1,
  225. useHTML:true,
  226. formatter: function() {
  227. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  228. },
  229. }
  230. },
  231. yAxis: {
  232. min: 0,
  233. max: 100,
  234. title: {
  235. text: 'Percentage'
  236. }
  237. },
  238. tooltip: {
  239. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  240. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  241. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  242. footerFormat: '</table>',
  243. shared: true,
  244. useHTML: true
  245. },
  246. plotOptions: {
  247. bar: {
  248. //grouping: false,
  249. shadow: false,
  250. borderWidth: 0,
  251. },
  252. series: {
  253. pointPadding: 0,
  254. groupPadding: 0.075
  255. },
  256. },
  257. series: [{
  258. name: 'Obtained Value',
  259. color: '#e70033',
  260. dataLabels: {
  261. enabled: true,
  262. fontSize: 8,
  263. color: '#fff',
  264. align: 'right',
  265. format: '{y:.1f}%',
  266. style: {
  267. //fontWeight: 'bold'
  268. },
  269. y:-1
  270. },
  271. data:[
  272. @foreach($outcomes as $index => $outcome)
  273. @if(
  274. is_array($outcomes_attempted)
  275. && array_key_exists($outcome->id, $outcomes_attempted)
  276. && array_key_exists($outcome->id, $outcomes_achieved)
  277. && $outcomes_attempted[$outcome->id]!=0)
  278. {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
  279. @else
  280. 0,
  281. @endif
  282. @endforeach
  283. ],
  284. pointPadding: 0,
  285. }, {
  286. name: 'Expected Value',
  287. color: '#555555',
  288. dataLabels: {
  289. enabled: true,
  290. fontSize: 8,
  291. color: '#fff',
  292. align: 'right',
  293. format: '{y:.1f}%',
  294. style: {
  295. //fontWeight: 'bold'
  296. },
  297. y:-1
  298. },
  299. data: [
  300. @foreach($outcomes as $index => $outcome)
  301. @if(
  302. is_array($outcomes_attempted)
  303. && array_key_exists($outcome->id, $outcomes_attempted)
  304. && $outcomes_attempted[$outcome->id]!=0)
  305. {{{ $outcome->expected_outcome }}},
  306. @else
  307. 0,
  308. @endif
  309. @endforeach
  310. ],
  311. pointPadding: 0,
  312. }]
  313. });
  314. // Include dummy graph for outcomes
  315. @include('global.dummy-outcomes')
  316. });
  317. @stop