Nessuna descrizione

activity.blade.php 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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(count($activity->rubric) == 0 && 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. {{ HTML::linkAction('RubricsController@newOtherMethod', 'Assign Other Assessment Method', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  154. @else
  155. {{ HTML::linkAction('RubricsController@show', 'View Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  156. <!-- If semester is active, allow users to change rubrics -->
  157. @if (in_array($course->semester->id, $active_semesters))
  158. {{ HTML::linkAction('RubricsController@newRubric', 'Change Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  159. @endif
  160. <!-- If there is no assessment and the semester is active -->
  161. @if($activity->outcomes_attempted == NULL && in_array($course->semester->id, $active_semesters))
  162. {{ HTML::linkAction('ActivitiesController@assess', 'Assess', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  163. @else
  164. {{ HTML::linkAction('ActivitiesController@viewAssessment', 'View Assessment Sheet', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  165. <!-- If semester is active, allow users to edit assessments -->
  166. @if (in_array($course->semester->id, $active_semesters))
  167. {{ HTML::linkAction('ActivitiesController@assess', 'Edit Assessment', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  168. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-confirm-delete-assessment">Delete Assessment</button>
  169. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-edit-transforming-actions">Transforming Actions</button>
  170. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-edit-assessment-comments">Assessment Comments</button>
  171. @endif
  172. @endif
  173. @endif
  174. <!-- If semester is active, allow users to delete the activity -->
  175. @if (in_array($course->semester->id, $active_semesters))
  176. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal" data-target="#modal-confirm-delete-activity">Delete Activity</button>
  177. @endif
  178. {{ HTML::linkAction('CoursesController@show', 'Back to Section', array($course->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
  179. </div>
  180. <hr>
  181. <h5>Description</h5>
  182. <p>{{ $activity->description }}</p>
  183. @if($activity->transforming_actions != NULL)
  184. <hr>
  185. <h5>Transforming Actions</h5>
  186. {{{ $activity->transforming_actions }}}
  187. @endif
  188. @if($activity->assessment_comments != NULL)
  189. <hr>
  190. <h5>Assessment Comments</h5>
  191. {{{ $activity->assessment_comments }}}
  192. @endif
  193. </div>
  194. </div>
  195. <div class="row">
  196. <div class="col-md-12" id="criteriaGraph"></div>
  197. </div>
  198. @stop
  199. @section('included-js')
  200. <!-- HighCharts -->
  201. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  202. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  203. <!-- Datepicker -->
  204. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  205. @stop
  206. @section('javascript')
  207. $(function () {
  208. $('#date').datepicker({
  209. dateFormat: "yy-mm-dd"
  210. });
  211. $('#criteriaGraph').highcharts({
  212. chart: {
  213. type: 'bar',
  214. height: {{{ count(json_decode($activity->criteria_achieved, true))*22+225 }}},
  215. },
  216. title: {
  217. text: 'Criteria Achievement',
  218. },
  219. xAxis: {
  220. categories: [
  221. @if($activity->criteria_achieved_percentage!=NULL)
  222. @foreach(json_decode($activity->criteria_achieved, true) as $id=>$value)
  223. "{{{ Criterion::withTrashed()->find($id)->name }}}",
  224. @endforeach
  225. @endif
  226. ],
  227. labels: {
  228. style: {
  229. fontSize:'12px'
  230. },
  231. step:1,
  232. useHTML:true,
  233. formatter: function() {
  234. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  235. },
  236. }
  237. },
  238. yAxis: {
  239. min: 0,
  240. max: 100,
  241. title: {
  242. text: 'Percentage'
  243. },
  244. @if(isset($activity->rubric->expected_percentage) )
  245. plotLines:[{
  246. value:{{ $activity->rubric->expected_percentage }},
  247. color: '#000',
  248. width:3,
  249. zIndex:4,
  250. label:{
  251. text: 'Goal ({{ $activity->rubric->expected_percentage }}%)',
  252. style: {
  253. color: '#000',
  254. fontSize: '14px',
  255. }
  256. }
  257. }]
  258. @endif
  259. },
  260. tooltip: {
  261. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  262. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  263. '<td style="padding:0"><b>{point.y:.2f}%</b></td></tr>',
  264. footerFormat: '</table>',
  265. shared: true,
  266. useHTML: true
  267. },
  268. plotOptions: {
  269. bar: {
  270. //grouping: false,
  271. shadow: false,
  272. borderWidth: 0,
  273. },
  274. series: {
  275. pointPadding: 0,
  276. groupPadding: 0.1
  277. },
  278. },
  279. series: [{
  280. type:'column',
  281. name: 'Passed',
  282. color: '#e70033',
  283. dataLabels: {
  284. enabled: true,
  285. fontSize: 8,
  286. color: '#fff',
  287. align: 'right',
  288. format: '{y:.1f}%',
  289. style: {
  290. //fontWeight: 'bold'
  291. },
  292. y:-1
  293. },
  294. data:[
  295. @if($activity->criteria_achieved_percentage!=NULL)
  296. @foreach(json_decode($activity->criteria_achieved_percentage, true) as $id=>$value)
  297. //This conditional is to ignore criteria that weren't assessed. These would have a value of null.
  298. @if($value)
  299. {{{ $value }}},
  300. @else
  301. 0,
  302. @endif
  303. @endforeach
  304. @endif
  305. ],
  306. pointPadding: 0,
  307. }
  308. ]
  309. });
  310. $('#graph').highcharts({
  311. chart: {
  312. type: 'bar',
  313. },
  314. title: {
  315. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  316. },
  317. xAxis: {
  318. categories: [
  319. @foreach($outcomes as $outcome)
  320. "{{{ $outcome->name }}}",
  321. @endforeach
  322. ],
  323. labels: {
  324. style: {
  325. fontSize:'11px'
  326. },
  327. step:1,
  328. useHTML:true,
  329. formatter: function() {
  330. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  331. },
  332. }
  333. },
  334. yAxis: {
  335. min: 0,
  336. max: 100,
  337. title: {
  338. text: 'Percentage'
  339. }
  340. },
  341. tooltip: {
  342. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  343. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  344. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  345. footerFormat: '</table>',
  346. shared: true,
  347. useHTML: true
  348. },
  349. plotOptions: {
  350. bar: {
  351. //grouping: false,
  352. shadow: false,
  353. borderWidth: 0,
  354. },
  355. series: {
  356. pointPadding: 0,
  357. groupPadding: 0.075
  358. },
  359. },
  360. series: [{
  361. name: 'Obtained Value',
  362. color: '#e70033',
  363. dataLabels: {
  364. enabled: true,
  365. fontSize: 8,
  366. color: '#fff',
  367. align: 'right',
  368. format: '{y:.1f}%',
  369. style: {
  370. //fontWeight: 'bold'
  371. },
  372. y:-1
  373. },
  374. data:[
  375. @foreach($outcomes as $index => $outcome)
  376. @if(
  377. is_array($outcomes_attempted)
  378. && array_key_exists($outcome->id, $outcomes_attempted)
  379. && $outcomes_attempted[$outcome->id]!=0)
  380. {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
  381. @else
  382. 0,
  383. @endif
  384. @endforeach
  385. ],
  386. pointPadding: 0,
  387. }, {
  388. name: 'Expected Value',
  389. color: '#555555',
  390. dataLabels: {
  391. enabled: true,
  392. fontSize: 8,
  393. color: '#fff',
  394. align: 'right',
  395. format: '{y:.1f}%',
  396. style: {
  397. //fontWeight: 'bold'
  398. },
  399. y:-1
  400. },
  401. data: [
  402. @foreach($outcomes as $index => $outcome)
  403. @if(
  404. is_array($outcomes_attempted)
  405. && array_key_exists($outcome->id, $outcomes_attempted)
  406. && $outcomes_attempted[$outcome->id]!=0)
  407. {{{ $outcome->expected_outcome }}},
  408. @else
  409. 0,
  410. @endif
  411. @endforeach
  412. ],
  413. pointPadding: 0,
  414. }]
  415. });
  416. var chart = $('#graph').highcharts();
  417. var titletext = $('#graph').highcharts().options.title.text;
  418. var newtitletext = titletext.replace("&#039;", "\'");
  419. chart.setTitle({text: newtitletext});
  420. // Include dummy graph for outcomes
  421. @include('global.dummy-outcomes')
  422. });
  423. @stop