Nenhuma descrição

course.blade.php 14KB

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