No Description

activity.blade.php 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. @extends('layouts.master')
  2. @section('css')
  3. {{ HTML::style('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.css') }}
  4. {{ HTML::style('vendor/jquery-ui-1.11.4.custom/jquery-ui.theme.min.css') }}
  5. @stop
  6. @section('navigation')
  7. @if($role==1)
  8. @include('local.managers.admins._navigation')
  9. @elseif($role==2)
  10. @include('local.managers.sCoords._navigation')
  11. @elseif($role==3)
  12. @include('local.managers.pCoords._navigation')
  13. @else
  14. @include('local.professors._navigation')
  15. @endif
  16. @stop
  17. @section('main')
  18. <!-- Edit Activity -->
  19. <div class="modal fade" id="modal-edit-activity">
  20. <div class="modal-dialog modal-sm">
  21. <div class="modal-content">
  22. <div class="modal-header">
  23. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  24. <h4 class="modal-title">Edit Activity</h4>
  25. </div>
  26. <div class="modal-body">
  27. {{ Form::open(array('action' => array('ActivitiesController@update', $activity->id))) }}
  28. <div class="form-group">
  29. {{ Form::label('name', 'Name') }}
  30. {{ Form::text('name', $activity->name, array('class' => 'form-control')) }}
  31. </div>
  32. <div class="form-group">
  33. {{ Form::label('description', 'Description') }}
  34. {{ Form::textarea('description', $activity->description, array('class' => 'form-control', 'rows'=> 4, 'placeholder'=>'Minimum 10 characters')) }}
  35. </div>
  36. <div class="form-group">
  37. {{ Form::label('date', 'Date') }}
  38. {{ Form::text('date', $activity->date, array('id'=>'date', 'class' => 'form-control', 'maxLength'=>10)) }}
  39. </div>
  40. </div>
  41. <div class="modal-footer">
  42. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  43. <input class="btn btn-primary" name="update_activity_information" value="Save" type="submit"/>
  44. {{ Form::close() }}
  45. </div>
  46. </div><!-- /.modal-content -->
  47. </div><!-- /.modal-dialog -->
  48. </div><!-- /.modal -->
  49. <!-- Edit Transforming Actions -->
  50. <div class="modal fade" id="modal-edit-transforming-actions">
  51. <div class="modal-dialog modal-sm">
  52. <div class="modal-content">
  53. <div class="modal-header">
  54. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  55. <h4 class="modal-title">Edit Transforming Actions</h4>
  56. </div>
  57. <div class="modal-body">
  58. {{ Form::open(array('action' => array('ActivitiesController@update', $activity->id))) }}
  59. <p>A Transforming Action is the educational action to be taken to address the criteria of an unachieved Learning Outcome.</p>
  60. <p>Una acción transformadora es una acción educativa a tomarse para atender el o los criterios de un dominio dado que no se alcanzaron.</p>
  61. <div class="form-group">
  62. {{ Form::label('transforming_actions', 'Transforming Actions') }}
  63. {{ Form::textarea('transforming_actions', $activity->transforming_actions, array('class' => 'form-control', 'rows'=> 4, 'placeholder'=>'Actions to improve student performance after assessment (optional)')) }}
  64. </div>
  65. </div>
  66. <div class="modal-footer">
  67. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  68. <input class="btn btn-primary" name="update_transforming_actions" value="Save" type="submit"/>
  69. {{ Form::close() }}
  70. </div>
  71. </div><!-- /.modal-content -->
  72. </div><!-- /.modal-dialog -->
  73. </div><!-- /.modal -->
  74. <!-- Edit Transforming Actions -->
  75. <div class="modal fade" id="modal-edit-assessment-comments">
  76. <div class="modal-dialog modal-sm">
  77. <div class="modal-content">
  78. <div class="modal-header">
  79. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  80. <h4 class="modal-title">Edit Assessment Comments</h4>
  81. </div>
  82. <div class="modal-body">
  83. {{ Form::open(array('action' => array('ActivitiesController@update', $activity->id))) }}
  84. <p>Write any additional comments about this activity.</p>
  85. <p>Escriba cualquier comentario adicional sobre esta actividad.</p>
  86. <div class="form-group">
  87. {{ Form::label('assessment_comments', 'Assessment Comments') }}
  88. {{ Form::textarea('assessment_comments', $activity->assessment_comments, array('class' => 'form-control', 'rows'=> 4, 'placeholder'=>'(optional)')) }}
  89. </div>
  90. </div>
  91. <div class="modal-footer">
  92. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  93. <input class="btn btn-primary" name="update_assessment_comments" value="Save" type="submit"/>
  94. {{ Form::close() }}
  95. </div>
  96. </div><!-- /.modal-content -->
  97. </div><!-- /.modal-dialog -->
  98. </div><!-- /.modal -->
  99. <!-- Delete Activity Modal -->
  100. <div class="modal fade" id="modal-confirm-delete-activity">
  101. <div class="modal-dialog modal-sm">
  102. <div class="modal-content">
  103. <div class="modal-header">
  104. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  105. <h4 class="modal-title">Delete Activity</h4>
  106. </div>
  107. <div class="modal-body">
  108. <p>Deleting this activity will also delete any related assessment data. Do you want to continue?</p>
  109. </div>
  110. <div class="modal-footer">
  111. <!-- Confirm deletion (must use form, because Laravel needs to use the DELETE method) -->
  112. {{ Form::open(array('action' => array('ActivitiesController@destroy', $activity->id), 'method'=>'delete')) }}
  113. <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
  114. <button class="btn btn-primary" type="submit">Delete</button>
  115. {{ Form::close() }}
  116. </div>
  117. </div><!-- /.modal-content -->
  118. </div><!-- /.modal-dialog -->
  119. </div><!-- /.modal -->
  120. <!-- Delete Assessment Modal -->
  121. <div class="modal fade" id="modal-confirm-delete-assessment">
  122. <div class="modal-dialog modal-sm">
  123. <div class="modal-content">
  124. <div class="modal-header">
  125. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  126. <h4 class="modal-title">Delete Assessment</h4>
  127. </div>
  128. <div class="modal-body">
  129. <p>Are you sure you want to delete the assessment results?</p>
  130. </div>
  131. <div class="modal-footer">
  132. <!-- Confirm deletion (must use form, because Laravel needs to use the DELETE method) -->
  133. {{ Form::open(array('action' => array('ActivitiesController@deleteAssessment'))) }}
  134. <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
  135. <input type="hidden" id="id" name="id" value="{{ $activity->id }}">
  136. <button class="btn btn-primary" type="submit">Delete</button>
  137. {{ Form::close() }}
  138. </div>
  139. </div><!-- /.modal-content -->
  140. </div><!-- /.modal-dialog -->
  141. </div><!-- /.modal -->
  142. <div class="row">
  143. <div class="col-md-9" id="graph"></div>
  144. <div class="col-md-3">
  145. <div class="btn-group-vertical btn-block" role="group" aria-label="...">
  146. <!-- If semester is active, allow users to delete the activity -->
  147. @if (in_array($course->semester->id, $active_semesters))
  148. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-edit-activity">Edit Activity Information</button>
  149. @endif
  150. <!-- If no rubric is assigned and the semester is active -->
  151. @if($activity->rubric == NULL && in_array($course->semester->id, $active_semesters))
  152. {{ HTML::linkAction('RubricsController@newRubric', 'Assign Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  153. @else
  154. {{ HTML::linkAction('RubricsController@show', 'View Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  155. <!-- If semester is active, allow users to change rubrics -->
  156. @if (in_array($course->semester->id, $active_semesters))
  157. {{ HTML::linkAction('RubricsController@newRubric', 'Change Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  158. @endif
  159. <!-- If there is no assessment and the semester is active -->
  160. @if($activity->outcomes_attempted == NULL && in_array($course->semester->id, $active_semesters))
  161. {{ HTML::linkAction('ActivitiesController@assess', 'Assess', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  162. @else
  163. {{ HTML::linkAction('ActivitiesController@viewAssessment', 'View Assessment Sheet', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  164. <!-- If semester is active, allow users to edit assessments -->
  165. @if (in_array($course->semester->id, $active_semesters))
  166. {{ HTML::linkAction('ActivitiesController@assess', 'Edit Assessment', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  167. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-confirm-delete-assessment">Delete Assessment</button>
  168. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-edit-transforming-actions">Transforming Actions</button>
  169. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-edit-assessment-comments">Assessment Comments</button>
  170. @endif
  171. @endif
  172. @endif
  173. <!-- If semester is active, allow users to delete the activity -->
  174. @if (in_array($course->semester->id, $active_semesters))
  175. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-confirm-delete-activity">Delete Activity</button>
  176. @endif
  177. {{ HTML::linkAction('CoursesController@show', 'Back to Section', array($course->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  178. </div>
  179. <hr>
  180. <h5>Description</h5>
  181. <p>{{ $activity->description }}</p>
  182. @if($activity->transforming_actions != NULL)
  183. <hr>
  184. <h5>Transforming Actions</h5>
  185. {{{ $activity->transforming_actions }}}
  186. @endif
  187. @if($activity->assessment_comments != NULL)
  188. <hr>
  189. <h5>Assessment Comments</h5>
  190. {{{ $activity->assessment_comments }}}
  191. @endif
  192. </div>
  193. </div>
  194. <div class="row">
  195. <div class="col-md-12" id="criteriaGraph"></div>
  196. </div>
  197. @stop
  198. @section('included-js')
  199. <!-- HighCharts -->
  200. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  201. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  202. <!-- Datepicker -->
  203. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  204. @stop
  205. @section('javascript')
  206. $(function () {
  207. $('#date').datepicker({
  208. dateFormat: "yy-mm-dd"
  209. });
  210. $('#criteriaGraph').highcharts({
  211. chart: {
  212. type: 'bar',
  213. height: {{{ count(json_decode($activity->criteria_achieved, true))*22+225 }}},
  214. },
  215. title: {
  216. text: 'Criteria Achievement',
  217. },
  218. xAxis: {
  219. categories: [
  220. @if($activity->criteria_achieved_percentage!=NULL)
  221. @foreach(json_decode($activity->criteria_achieved, true) as $id=>$value)
  222. "{{{ Criterion::withTrashed()->find($id)->name }}}",
  223. @endforeach
  224. @endif
  225. ],
  226. labels: {
  227. style: {
  228. fontSize:'12px'
  229. },
  230. step:1,
  231. useHTML:true,
  232. formatter: function() {
  233. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  234. },
  235. }
  236. },
  237. yAxis: {
  238. min: 0,
  239. max: 100,
  240. title: {
  241. text: 'Percentage'
  242. },
  243. @if($activity->rubric!=NULL)
  244. plotLines:[{
  245. value:{{ $activity->rubric->expected_percentage }},
  246. color: '#000',
  247. width:3,
  248. zIndex:4,
  249. label:{
  250. text: 'Goal ({{ $activity->rubric->expected_percentage }}%)',
  251. style: {
  252. color: '#000',
  253. fontSize: '14px',
  254. }
  255. }
  256. }]
  257. @endif
  258. },
  259. tooltip: {
  260. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  261. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  262. '<td style="padding:0"><b>{point.y:.2f}%</b></td></tr>',
  263. footerFormat: '</table>',
  264. shared: true,
  265. useHTML: true
  266. },
  267. plotOptions: {
  268. bar: {
  269. //grouping: false,
  270. shadow: false,
  271. borderWidth: 0,
  272. },
  273. series: {
  274. pointPadding: 0,
  275. groupPadding: 0.1
  276. },
  277. },
  278. series: [{
  279. type:'column',
  280. name: 'Passed',
  281. color: '#e70033',
  282. dataLabels: {
  283. enabled: true,
  284. fontSize: 8,
  285. color: '#fff',
  286. align: 'right',
  287. format: '{y:.1f}%',
  288. style: {
  289. //fontWeight: 'bold'
  290. },
  291. y:-1
  292. },
  293. data:[
  294. @if($activity->criteria_achieved_percentage!=NULL)
  295. @foreach(json_decode($activity->criteria_achieved_percentage, true) as $id=>$value)
  296. //This conditional is to ignore criteria that weren't assessed. These would have a value of null.
  297. @if($value)
  298. {{{ $value }}},
  299. @else
  300. 0,
  301. @endif
  302. @endforeach
  303. @endif
  304. ],
  305. pointPadding: 0,
  306. }
  307. ]
  308. });
  309. $('#graph').highcharts({
  310. chart: {
  311. type: 'bar',
  312. },
  313. title: {
  314. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  315. },
  316. xAxis: {
  317. categories: [
  318. @foreach($outcomes as $outcome)
  319. "{{{ $outcome->name }}}",
  320. @endforeach
  321. ],
  322. labels: {
  323. style: {
  324. fontSize:'11px'
  325. },
  326. step:1,
  327. useHTML:true,
  328. formatter: function() {
  329. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  330. },
  331. }
  332. },
  333. yAxis: {
  334. min: 0,
  335. max: 100,
  336. title: {
  337. text: 'Percentage'
  338. }
  339. },
  340. tooltip: {
  341. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  342. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  343. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  344. footerFormat: '</table>',
  345. shared: true,
  346. useHTML: true
  347. },
  348. plotOptions: {
  349. bar: {
  350. //grouping: false,
  351. shadow: false,
  352. borderWidth: 0,
  353. },
  354. series: {
  355. pointPadding: 0,
  356. groupPadding: 0.075
  357. },
  358. },
  359. series: [{
  360. name: 'Obtained Value',
  361. color: '#e70033',
  362. dataLabels: {
  363. enabled: true,
  364. fontSize: 8,
  365. color: '#fff',
  366. align: 'right',
  367. format: '{y:.1f}%',
  368. style: {
  369. //fontWeight: 'bold'
  370. },
  371. y:-1
  372. },
  373. data:[
  374. @foreach($outcomes as $index => $outcome)
  375. @if(
  376. is_array($outcomes_attempted)
  377. && array_key_exists($outcome->id, $outcomes_attempted)
  378. && $outcomes_attempted[$outcome->id]!=0)
  379. {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
  380. @else
  381. 0,
  382. @endif
  383. @endforeach
  384. ],
  385. pointPadding: 0,
  386. }, {
  387. name: 'Expected Value',
  388. color: '#555555',
  389. dataLabels: {
  390. enabled: true,
  391. fontSize: 8,
  392. color: '#fff',
  393. align: 'right',
  394. format: '{y:.1f}%',
  395. style: {
  396. //fontWeight: 'bold'
  397. },
  398. y:-1
  399. },
  400. data: [
  401. @foreach($outcomes as $index => $outcome)
  402. @if(
  403. is_array($outcomes_attempted)
  404. && array_key_exists($outcome->id, $outcomes_attempted)
  405. && $outcomes_attempted[$outcome->id]!=0)
  406. {{{ $outcome->expected_outcome }}},
  407. @else
  408. 0,
  409. @endif
  410. @endforeach
  411. ],
  412. pointPadding: 0,
  413. }]
  414. });
  415. var chart = $('#graph').highcharts();
  416. var titletext = $('#graph').highcharts().options.title.text;
  417. var newtitletext = titletext.replace("&#039;", "\'");
  418. chart.setTitle({text: newtitletext});
  419. // Include dummy graph for outcomes
  420. @include('global.dummy-outcomes')
  421. });
  422. @stop