No Description

activity.blade.php 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  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._new_navigation')
  9. @elseif($role == 2)
  10. @include('local.managers.sCoords._new_navigation')
  11. @elseif($role == 3)
  12. @include('local.managers.pCoords._new_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
  24. aria-hidden="true">&times;</span></button>
  25. <h4 class="modal-title">Edit Activity</h4>
  26. </div>
  27. <div class="modal-body">
  28. {{ Form::open(['action' => ['ActivitiesController@update', $activity->id]]) }}
  29. <div class="form-group">
  30. {{ Form::label('name', 'Name') }}
  31. {{ Form::text('name', $activity->name, ['class' => 'form-control']) }}
  32. </div>
  33. <div class="form-group">
  34. {{ Form::label('description', 'Description') }}
  35. {{ Form::textarea('description', $activity->description, ['class' => 'form-control', 'rows' => 4, 'placeholder' => 'Minimum 10 characters']) }}
  36. </div>
  37. <div class="form-group">
  38. {{ Form::label('date', 'Date') }}
  39. {{ Form::text('date', $activity->date, ['id' => 'date', 'class' => 'form-control', 'maxLength' => 10]) }}
  40. </div>
  41. </div>
  42. <div class="modal-footer">
  43. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  44. <input class="btn btn-primary" name="update_activity_information" value="Save" type="submit" />
  45. {{ Form::close() }}
  46. </div>
  47. </div><!-- /.modal-content -->
  48. </div><!-- /.modal-dialog -->
  49. </div><!-- /.modal -->
  50. <!-- Edit Transforming Actions -->
  51. <div class="modal fade" id="modal-edit-transforming-actions">
  52. <div class="modal-dialog modal-sm">
  53. <div class="modal-content">
  54. <div class="modal-header">
  55. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  56. aria-hidden="true">&times;</span></button>
  57. <h4 class="modal-title">Edit Formative Actions</h4>
  58. </div>
  59. <div class="modal-body">
  60. {{ Form::open(['action' => ['TransformativeActionsController@postActivityCriterion', $activity->id]]) }}
  61. <p>A Formative Action is the educational action to be taken to address the criteria of an unachieved
  62. Learning Outcome.</p>
  63. <p>Una acción formativa es una acción educativa a tomarse para atender el o los criterios de un dominio
  64. dado que no se alcanzaron.</p>
  65. <h5>Choose criteria for the transforming action <br>
  66. Escoge los criterion para la acción transformadora</h5>
  67. <div class="form-group">
  68. {{ Form::label('select-activity-criterion', 'Criteria') }}
  69. <select id='select-activity-criterion' name="trans_act[]" data-count="1"
  70. class="form-control selectpicker" data-live-search='true'>
  71. @foreach ($activity_criterion as $ac)
  72. <option value='{{ $ac->id }}' selected>{{ $ac->name }}</option>
  73. @endforeach
  74. </select>
  75. </div>
  76. <button id='button-add-activity-criterion' class='btn btn-md btn-secondary'>
  77. <span class='glyphicon glyphicon-plus'>
  78. </span>
  79. Add another Criteria
  80. </button>
  81. <hr>
  82. <div class="form-group">
  83. {{ Form::label('name_trans', 'Name of Formative Actions') }}
  84. {{ Form::text('name_trans', '', ['class' => 'form-control']) }}
  85. </div>
  86. <div class="form-group">
  87. {{ Form::label('transforming_actions', 'Formative Actions') }}
  88. {{ Form::textarea('transforming_actions', $activity->transforming_actions, ['class' => 'form-control', 'rows' => 4, 'placeholder' => 'Actions to improve student performance after assessment (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_transforming_actions" value="Save" type="submit" />
  94. {{ Form::close() }}
  95. </div>
  96. </div><!-- /.modal-content -->
  97. </div><!-- /.modal-dialog -->
  98. </div><!-- /.modal -->
  99. <!-- Edit Transforming Actions -->
  100. <div class="modal fade" id="modal-edit-assessment-comments">
  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
  105. aria-hidden="true">&times;</span></button>
  106. <h4 class="modal-title">Edit Assessment Comments</h4>
  107. </div>
  108. <div class="modal-body">
  109. {{ Form::open(['action' => ['ActivitiesController@update', $activity->id]]) }}
  110. <p>Write any additional comments about this activity.</p>
  111. <p>Escriba cualquier comentario adicional sobre esta actividad.</p>
  112. <div class="form-group">
  113. {{ Form::label('assessment_comments', 'Assessment Comments') }}
  114. {{ Form::textarea('assessment_comments', $activity->assessment_comments, ['class' => 'form-control', 'rows' => 4, 'placeholder' => '(optional)']) }}
  115. </div>
  116. </div>
  117. <div class="modal-footer">
  118. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  119. <input class="btn btn-primary" name="update_assessment_comments" value="Save" type="submit" />
  120. {{ Form::close() }}
  121. </div>
  122. </div><!-- /.modal-content -->
  123. </div><!-- /.modal-dialog -->
  124. </div><!-- /.modal -->
  125. <!-- Delete Activity Modal -->
  126. <div class="modal fade" id="modal-confirm-delete-activity">
  127. <div class="modal-dialog modal-sm">
  128. <div class="modal-content">
  129. <div class="modal-header">
  130. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  131. aria-hidden="true">&times;</span></button>
  132. <h4 class="modal-title">Delete Activity</h4>
  133. </div>
  134. <div class="modal-body">
  135. <p>Deleting this activity will also delete any related assessment data. Do you want to continue?</p>
  136. </div>
  137. <div class="modal-footer">
  138. <!-- Confirm deletion (must use form, because Laravel needs to use the DELETE method) -->
  139. {{ Form::open(['action' => ['ActivitiesController@destroy', $activity->id], 'method' => 'delete']) }}
  140. <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
  141. <button class="btn btn-primary" type="submit">Delete</button>
  142. {{ Form::close() }}
  143. </div>
  144. </div><!-- /.modal-content -->
  145. </div><!-- /.modal-dialog -->
  146. </div><!-- /.modal -->
  147. <!-- Delete Assessment Modal -->
  148. <div class="modal fade" id="modal-confirm-delete-assessment">
  149. <div class="modal-dialog modal-sm">
  150. <div class="modal-content">
  151. <div class="modal-header">
  152. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  153. aria-hidden="true">&times;</span></button>
  154. <h4 class="modal-title">Delete Assessment</h4>
  155. </div>
  156. <div class="modal-body">
  157. <p>Are you sure you want to delete the assessment results?</p>
  158. </div>
  159. <div class="modal-footer">
  160. <!-- Confirm deletion (must use form, because Laravel needs to use the DELETE method) -->
  161. {{ Form::open(['action' => ['ActivitiesController@deleteAssessment']]) }}
  162. <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
  163. <input type="hidden" id="id" name="id" value="{{ $activity->id }}">
  164. <button class="btn btn-primary" type="submit">Delete</button>
  165. {{ Form::close() }}
  166. </div>
  167. </div><!-- /.modal-content -->
  168. </div><!-- /.modal-dialog -->
  169. </div><!-- /.modal -->
  170. <div class="row">
  171. <div class="col-md-9" id="graph"></div>
  172. <div class="col-md-3">
  173. <div class="btn-group-vertical btn-block" role="group" aria-label="...">
  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"
  177. data-target="#modal-edit-activity">Edit Activity Information</button>
  178. @endif
  179. <!-- If no rubric is assigned and the semester is active -->
  180. @if (count($activity->rubric) == 0 && in_array($course->semester->id, $active_semesters))
  181. {{ HTML::linkAction('RubricsController@newRubric', 'Assign Rubric', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  182. <!--{{ HTML::linkAction('RubricsController@newOtherMethod', 'Assign Other Assessment Method', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}-->
  183. @else
  184. @if (count($activity->rubric) != 0)
  185. {{ HTML::linkAction('RubricsController@show', 'View Rubric', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  186. @else
  187. <h5>No rubric associated to this activity</h5>
  188. @endif
  189. <!-- If semester is active, allow users to change rubrics -->
  190. @if (in_array($course->semester->id, $active_semesters))
  191. {{ HTML::linkAction('RubricsController@newRubric', 'Change Rubric', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  192. @endif
  193. <!-- If there is no assessment and the semester is active -->
  194. @if (!$activity->is_assessed() && in_array($course->semester->id, $active_semesters))
  195. {{ HTML::linkAction('ActivitiesController@assess', 'Assess', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  196. @else
  197. @if ($activity->is_assessed())
  198. {{ HTML::linkAction('ActivitiesController@viewAssessment', 'View Assessment Sheet', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  199. @else
  200. <h5>No assessment associated to this activity</h5>
  201. @endif
  202. <!-- If semester is active, allow users to edit assessments -->
  203. @if (in_array($course->semester->id, $active_semesters))
  204. {{ HTML::linkAction('ActivitiesController@assess', 'Edit Assessment', [$activity->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  205. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal"
  206. data-target="#modal-confirm-delete-assessment">Delete Assessment</button>
  207. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal"
  208. data-target="#modal-edit-transforming-actions">Formative Actions</button>
  209. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal"
  210. data-target="#modal-edit-assessment-comments">Assessment Comments</button>
  211. @endif
  212. @endif
  213. @endif
  214. <!-- If semester is active, allow users to delete the activity -->
  215. @if (in_array($course->semester->id, $active_semesters))
  216. <button class="btn btn-primary btn-sm btn-block" btn-block data-toggle="modal"
  217. data-target="#modal-confirm-delete-activity">Delete Activity</button>
  218. @endif
  219. {{ HTML::linkAction('CoursesController@show', 'Back to Section', [$course->id], ['class' => 'btn btn-primary btn-sm btn-block']) }}
  220. </div>
  221. <hr>
  222. <h5>Description</h5>
  223. <p>{{ $activity->description }}</p>
  224. <?php
  225. $formative_actions = $activity->formativeActionsWithCriteria();
  226. ?>
  227. @if ($formative_actions != null)
  228. <hr>
  229. <h5>Formative Actions</h5>
  230. <p><strong>{{ $formative_actions[0]->at_text }}: </strong> {{ $formative_actions[0]->description }}
  231. </p>
  232. <h5>Formative Action's Associated Criteria</h5>
  233. <ul>
  234. @foreach ($formative_actions as $criteria)
  235. <li>{{ $criteria->name }}</li>
  236. @endforeach
  237. </ul>
  238. @endif
  239. @if ($activity->assessment_comments != null)
  240. <hr>
  241. <h5>Assessment Comments</h5>
  242. {{ $activity->assessment_comments }}
  243. @endif
  244. </div>
  245. </div>
  246. <div class="row">
  247. <div class="col-md-12" id="criteriaGraph"></div>
  248. </div>
  249. <script>
  250. $('#button-add-activity-criterion').on('click', function(e) {
  251. e.preventDefault();
  252. options = $('#select-activity-criterion').html();
  253. counter = $('#select-activity-criterion').data('count');
  254. var div = $('<div/>', {
  255. 'id': "selectFor" + counter
  256. });
  257. var divForSelect = $('<div/>', {
  258. 'class': 'col-12 form-group'
  259. });
  260. var select = $('<select/>', {
  261. 'class': 'selectpicker',
  262. 'data-live-search':'true',
  263. 'name': 'trans_act[]',
  264. })
  265. var $button = $('<button/>', {
  266. 'type': 'button',
  267. 'class': 'btn btn-primary',
  268. 'onclick': '$(this).parent().parent().remove();$("#button-add-activity-criterion").show(); '
  269. }).html('X');
  270. divForSelect.append(select);
  271. divForSelect.append($button);
  272. div.append(divForSelect);
  273. $('#select-activity-criterion').parent().parent().after(div);
  274. select.html(options);
  275. refreshSelects();
  276. countSelects = $('.selectpicker').length;
  277. countOptions = $('#select-activity-criterion option').length;
  278. if (countOptions == countSelects) {
  279. $('#button-add-activity-criterion').hide();
  280. }
  281. });
  282. function refreshSelects() {
  283. $('.selectpicker').each(function() {
  284. $(this).selectpicker('refresh');
  285. });
  286. }
  287. $(document).ready(function() {
  288. if ({{ count($transformative_actions) }}) {
  289. var trans_actions = {{ json_encode($transformative_actions) }};
  290. //$('#select-activity-criterion').val(trans_actions[0].activity_id);
  291. $('#name_trans').val(trans_actions[0].at_text);
  292. $('#transforming_actions').val(trans_actions[0].description);
  293. refreshSelects();
  294. for (index in trans_actions) {
  295. if (index == 0) continue;
  296. $('#button-add-activity-criterion').click();
  297. }
  298. $('.selectpicker').each(function(index) {
  299. $(this).val(trans_actions[index].activity_criterion_id);
  300. });
  301. refreshSelects();
  302. }
  303. });
  304. </script>
  305. @stop
  306. @section('included-js')
  307. <!-- HighCharts -->
  308. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  309. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  310. <!-- Datepicker -->
  311. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  312. @stop
  313. @section('javascript')
  314. $(function () {
  315. $('#date').datepicker({
  316. dateFormat: "yy-mm-dd"
  317. });
  318. string_for_format = "";
  319. $('#criteriaGraph').highcharts({
  320. chart: {
  321. type: 'bar',
  322. height:
  323. @if ($activity->is_assessed())
  324. {{ count($activity->criteria_achieved()) * 22 + 225 }}
  325. @else
  326. {{ 22 + 225 }}
  327. @endif
  328. ,
  329. },
  330. title: {
  331. text: 'Criteria Achievement',
  332. },
  333. xAxis: {
  334. categories: [
  335. @if ($activity->is_assessed())
  336. @foreach ($activity->criteria_achieved() as $id => $value)
  337. "{{ Criterion::withTrashed()->find($id)->name }}",
  338. @endforeach
  339. @endif
  340. ],
  341. labels: {
  342. style: {
  343. fontSize:'12px'
  344. },
  345. step:1,
  346. useHTML:true,
  347. formatter: function() {
  348. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  349. },
  350. }
  351. },
  352. yAxis: {
  353. min: 0,
  354. max: 100,
  355. title: {
  356. text: 'Percentage'
  357. },
  358. @if (isset($activity->rubric[0]) and isset($activity->rubric[0]->expected_percentage))
  359. plotLines:[{
  360. value:{{ $activity->rubric[0]->expected_percentage }},
  361. color: '#000',
  362. width:3,
  363. zIndex:4,
  364. label:{
  365. text: 'Goal ({{ $activity->rubric[0]->expected_percentage }}%)',
  366. style: {
  367. color: '#000',
  368. fontSize: '14px',
  369. }
  370. }
  371. }]
  372. @endif
  373. },
  374. tooltip: {
  375. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  376. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  377. '<td style="padding:0"><b>{point.y:.2f}%</b></td></tr>'+
  378. '{point.outcomes}',
  379. //'<tr><td style="color:{series.color};padding:0">Learning Outcomes:</td>'+
  380. // '<td style="padding:0">{point.outcomes}, <br>Outcome2</td></tr>',
  381. // '<td style="padding:0">{point.outcomes}, <br>Outcome2</td>
  382. //'</tr>',
  383. footerFormat: '</table>',
  384. shared: true,
  385. useHTML: true
  386. },
  387. plotOptions: {
  388. bar: {
  389. //grouping: false,
  390. shadow: false,
  391. borderWidth: 0,
  392. },
  393. series: {
  394. pointPadding: 0,
  395. groupPadding: 0.1
  396. },
  397. },
  398. series: [{
  399. type:'column',
  400. name: 'Passed',
  401. color: '#e70033',
  402. dataLabels: {
  403. enabled: true,
  404. fontSize: 8,
  405. color: '#fff',
  406. align: 'right',
  407. format: '{y:.1f}%',
  408. style: {
  409. //fontWeight: 'bold'
  410. },
  411. y:-1
  412. },
  413. data:[
  414. @if ($activity->is_assessed())
  415. @foreach ($activity->cap_array as $id => $crit)
  416. //This conditional is to ignore criteria that weren't assessed. These would have a value of null.
  417. @if ($crit->score_percentage)
  418. {y: {{ $crit->score_percentage }}, outcomes: "{{ $crit->outcome_names_html }}"},
  419. @else
  420. {y:0, outcomes:"{{ $crit->outcome_names_html }}"},
  421. @endif
  422. @endforeach
  423. @endif
  424. ],
  425. pointPadding: 0,
  426. }
  427. ]
  428. });
  429. $('#graph').highcharts({
  430. chart: {
  431. type: 'bar',
  432. },
  433. title: {
  434. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  435. },
  436. xAxis: {
  437. categories: [
  438. @foreach ($outcomes as $outcome)
  439. @if( array_key_exists($outcome->id, $outcomes_activity) &&
  440. $outcomes_activity[$outcome->id] //&&
  441. //array_key_exists($outcome->id, $outcomes_attempted) &&
  442. //$outcomes_attempted[$outcome->id] != 0
  443. )
  444. <?php
  445. $attempted = $outcomes_activity[$outcome->id]->attempted;
  446. $achieved = $outcomes_activity[$outcome->id]->achieved;
  447. ?>
  448. @else
  449. <?php
  450. $attempted = 0;
  451. $achieved = 0;
  452. ?>
  453. @endif
  454. "{{ $outcome->name }}<br> (N = {{$attempted}} , {{$achieved}})",
  455. @endforeach
  456. ],
  457. labels: {
  458. style: {
  459. fontSize:'11px'
  460. },
  461. step:1,
  462. useHTML:true,
  463. formatter: function() {
  464. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  465. },
  466. }
  467. },
  468. yAxis: {
  469. min: 0,
  470. max: 100,
  471. title: {
  472. text: 'Percentage'
  473. },
  474. @if($activity->course->program->expected_outcome_target == null)
  475. plotLines:[{
  476. value:70.00,
  477. color: '#000',
  478. width:3,
  479. zIndex:4,
  480. label:{
  481. text: 'Goal (70.00%)',
  482. style: {
  483. color: '#000',
  484. fontSize: '14px',
  485. }
  486. }
  487. }]
  488. @else
  489. plotLines:[{
  490. value:{{$activity->course->program->expected_outcome_target->expected_target}},
  491. color: '#000',
  492. width:3,
  493. zIndex:4,
  494. label:{
  495. text: 'Goal ({{$activity->course->program->expected_outcome_target->expected_target}})',
  496. style: {
  497. color: '#000',
  498. fontSize: '14px',
  499. }
  500. }
  501. }]
  502. @endif
  503. },
  504. tooltip: {
  505. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  506. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  507. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  508. footerFormat: '</table>',
  509. shared: true,
  510. useHTML: true
  511. },
  512. plotOptions: {
  513. bar: {
  514. //grouping: false,
  515. shadow: false,
  516. borderWidth: 0,
  517. },
  518. series: {
  519. pointPadding: 0,
  520. groupPadding: 0.075
  521. },
  522. },
  523. series: [{
  524. name: 'Obtained Value',
  525. color: '#e70033',
  526. dataLabels: {
  527. enabled: true,
  528. fontSize: 8,
  529. color: '#fff',
  530. align: 'right',
  531. format: '{y:.1f}%',
  532. style: {
  533. //fontWeight: 'bold'
  534. },
  535. y:-1
  536. },
  537. data:[
  538. @foreach ($outcomes as $index => $outcome)
  539. @if( array_key_exists($outcome->id, $outcomes_activity) &&
  540. $outcomes_activity[$outcome->id] && $outcomes_activity[$outcome->id]->attempted!=0)
  541. {{$outcomes_activity[$outcome->id]->achieved / $outcomes_activity[$outcome->id]->attempted * 100}}
  542. {{-- ($outcomes_achieved[$outcome->id] / $outcomes_attempted[$outcome->id]) * 100 --}},
  543. {{--@if (is_array($outcomes_attempted) && array_key_exists($outcome->id, $outcomes_attempted) && $outcomes_attempted[$outcome->id] != 0) --}}
  544. {{-- {{ ($outcomes_achieved[$outcome->id] / $outcomes_attempted[$outcome->id]) * 100 }}, --}}
  545. @else
  546. 0,
  547. @endif
  548. @endforeach
  549. ],
  550. pointPadding: 0,
  551. } {{--, {
  552. name: 'Expected Value',
  553. color: '#555555',
  554. dataLabels: {
  555. enabled: true,
  556. fontSize: 8,
  557. color: '#fff',
  558. align: 'right',
  559. format: '{y:.1f}%',
  560. style: {
  561. //fontWeight: 'bold'
  562. },
  563. y:-1
  564. },
  565. data: [
  566. @foreach ($outcomes as $index => $outcome)
  567. @if (is_array($outcomes_attempted) && array_key_exists($outcome->id, $outcomes_attempted) && $outcomes_attempted[$outcome->id] != 0)
  568. {{ $outcome->expected_outcome }},
  569. @else
  570. 0,
  571. @endif
  572. @endforeach
  573. ],
  574. pointPadding: 0,
  575. } --}}]
  576. });
  577. var chart = $('#graph').highcharts();
  578. var titletext = $('#graph').highcharts().options.title.text;
  579. var newtitletext = titletext.replace("&#039;", "\'");
  580. chart.setTitle({text: newtitletext});
  581. // Include dummy graph for outcomes
  582. @include('global.dummy-outcomes')
  583. });
  584. @stop