Nav apraksta

activity.blade.php 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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">
  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. 'name': 'trans_act[]',
  263. })
  264. var $button = $('<button/>', {
  265. 'type': 'button',
  266. 'class': 'btn btn-primary',
  267. 'onclick': '$(this).parent().parent().remove();$("#button-add-activity-criterion").show(); '
  268. }).html('X');
  269. divForSelect.append(select);
  270. divForSelect.append($button);
  271. div.append(divForSelect);
  272. $('#select-activity-criterion').parent().parent().after(div);
  273. select.html(options);
  274. refreshSelects();
  275. countSelects = $('.selectpicker').length;
  276. countOptions = $('#select-activity-criterion option').length;
  277. if (countOptions == countSelects) {
  278. $('#button-add-activity-criterion').hide();
  279. }
  280. });
  281. function refreshSelects() {
  282. $('.selectpicker').each(function() {
  283. $(this).selectpicker('refresh');
  284. });
  285. }
  286. $(document).ready(function() {
  287. if ({{ count($transformative_actions) }}) {
  288. var trans_actions = {{ json_encode($transformative_actions) }};
  289. //$('#select-activity-criterion').val(trans_actions[0].activity_id);
  290. $('#name_trans').val(trans_actions[0].at_text);
  291. $('#transforming_actions').val(trans_actions[0].description);
  292. refreshSelects();
  293. for (index in trans_actions) {
  294. if (index == 0) continue;
  295. $('#button-add-activity-criterion').click();
  296. }
  297. $('.selectpicker').each(function(index) {
  298. $(this).val(trans_actions[index].activity_criterion_id);
  299. });
  300. refreshSelects();
  301. }
  302. });
  303. </script>
  304. @stop
  305. @section('included-js')
  306. <!-- HighCharts -->
  307. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  308. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  309. <!-- Datepicker -->
  310. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  311. @stop
  312. @section('javascript')
  313. $(function () {
  314. $('#date').datepicker({
  315. dateFormat: "yy-mm-dd"
  316. });
  317. string_for_format = "";
  318. $('#criteriaGraph').highcharts({
  319. chart: {
  320. type: 'bar',
  321. height:
  322. @if ($activity->is_assessed())
  323. {{ count($activity->criteria_achieved()) * 22 + 225 }}
  324. @else
  325. {{ 22 + 225 }}
  326. @endif
  327. ,
  328. },
  329. title: {
  330. text: 'Criteria Achievement',
  331. },
  332. xAxis: {
  333. categories: [
  334. @if ($activity->is_assessed())
  335. @foreach ($activity->criteria_achieved() as $id => $value)
  336. "{{ Criterion::withTrashed()->find($id)->name }}",
  337. @endforeach
  338. @endif
  339. ],
  340. labels: {
  341. style: {
  342. fontSize:'12px'
  343. },
  344. step:1,
  345. useHTML:true,
  346. formatter: function() {
  347. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  348. },
  349. }
  350. },
  351. yAxis: {
  352. min: 0,
  353. max: 100,
  354. title: {
  355. text: 'Percentage'
  356. },
  357. @if (isset($activity->rubric[0]) and isset($activity->rubric[0]->expected_percentage))
  358. plotLines:[{
  359. value:{{ $activity->rubric[0]->expected_percentage }},
  360. color: '#000',
  361. width:3,
  362. zIndex:4,
  363. label:{
  364. text: 'Goal ({{ $activity->rubric[0]->expected_percentage }}%)',
  365. style: {
  366. color: '#000',
  367. fontSize: '14px',
  368. }
  369. }
  370. }]
  371. @endif
  372. },
  373. tooltip: {
  374. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  375. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  376. '<td style="padding:0"><b>{point.y:.2f}%</b></td></tr>'+
  377. '{point.outcomes}',
  378. //'<tr><td style="color:{series.color};padding:0">Learning Outcomes:</td>'+
  379. // '<td style="padding:0">{point.outcomes}, <br>Outcome2</td></tr>',
  380. // '<td style="padding:0">{point.outcomes}, <br>Outcome2</td>
  381. //'</tr>',
  382. footerFormat: '</table>',
  383. shared: true,
  384. useHTML: true
  385. },
  386. plotOptions: {
  387. bar: {
  388. //grouping: false,
  389. shadow: false,
  390. borderWidth: 0,
  391. },
  392. series: {
  393. pointPadding: 0,
  394. groupPadding: 0.1
  395. },
  396. },
  397. series: [{
  398. type:'column',
  399. name: 'Passed',
  400. color: '#e70033',
  401. dataLabels: {
  402. enabled: true,
  403. fontSize: 8,
  404. color: '#fff',
  405. align: 'right',
  406. format: '{y:.1f}%',
  407. style: {
  408. //fontWeight: 'bold'
  409. },
  410. y:-1
  411. },
  412. data:[
  413. @if ($activity->is_assessed())
  414. @foreach ($activity->cap_array as $id => $crit)
  415. //This conditional is to ignore criteria that weren't assessed. These would have a value of null.
  416. @if ($crit->score_percentage)
  417. {y: {{ $crit->score_percentage }}, outcomes: "{{ $crit->outcome_names_html }}"},
  418. @else
  419. {y:0, outcomes:"{{ $crit->outcome_names_html }}"},
  420. @endif
  421. @endforeach
  422. @endif
  423. ],
  424. pointPadding: 0,
  425. }
  426. ]
  427. });
  428. $('#graph').highcharts({
  429. chart: {
  430. type: 'bar',
  431. },
  432. title: {
  433. text: 'Performance by Learning Outcome Criteria in {{ $title }}'
  434. },
  435. xAxis: {
  436. categories: [
  437. @foreach ($outcomes as $outcome)
  438. @if( array_key_exists($outcome->id, $outcomes_activity) &&
  439. $outcomes_activity[$outcome->id] //&&
  440. //array_key_exists($outcome->id, $outcomes_attempted) &&
  441. //$outcomes_attempted[$outcome->id] != 0
  442. )
  443. <?php
  444. $attempted = $outcomes_activity[$outcome->id]->attempted;
  445. $achieved = $outcomes_activity[$outcome->id]->achieved;
  446. ?>
  447. @else
  448. <?php
  449. $attempted = 0;
  450. $achieved = 0;
  451. ?>
  452. @endif
  453. "{{ $outcome->name }}<br> (N = {{$attempted}} , {{$achieved}})",
  454. @endforeach
  455. ],
  456. labels: {
  457. style: {
  458. fontSize:'11px'
  459. },
  460. step:1,
  461. useHTML:true,
  462. formatter: function() {
  463. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
  464. },
  465. }
  466. },
  467. yAxis: {
  468. min: 0,
  469. max: 100,
  470. title: {
  471. text: 'Percentage'
  472. },
  473. @if($activity->course->program->expected_outcome_target == null)
  474. plotLines:[{
  475. value:70.00,
  476. color: '#000',
  477. width:3,
  478. zIndex:4,
  479. label:{
  480. text: 'Goal (70.00%)',
  481. style: {
  482. color: '#000',
  483. fontSize: '14px',
  484. }
  485. }
  486. }]
  487. @else
  488. plotLines:[{
  489. value:{{$activity->course->program->expected_outcome_target->expected_target}},
  490. color: '#000',
  491. width:3,
  492. zIndex:4,
  493. label:{
  494. text: 'Goal ({{$activity->course->program->expected_outcome_target->expected_target}})',
  495. style: {
  496. color: '#000',
  497. fontSize: '14px',
  498. }
  499. }
  500. }]
  501. @endif
  502. },
  503. tooltip: {
  504. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  505. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  506. '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
  507. footerFormat: '</table>',
  508. shared: true,
  509. useHTML: true
  510. },
  511. plotOptions: {
  512. bar: {
  513. //grouping: false,
  514. shadow: false,
  515. borderWidth: 0,
  516. },
  517. series: {
  518. pointPadding: 0,
  519. groupPadding: 0.075
  520. },
  521. },
  522. series: [{
  523. name: 'Obtained Value',
  524. color: '#e70033',
  525. dataLabels: {
  526. enabled: true,
  527. fontSize: 8,
  528. color: '#fff',
  529. align: 'right',
  530. format: '{y:.1f}%',
  531. style: {
  532. //fontWeight: 'bold'
  533. },
  534. y:-1
  535. },
  536. data:[
  537. @foreach ($outcomes as $index => $outcome)
  538. @if( array_key_exists($outcome->id, $outcomes_activity) &&
  539. $outcomes_activity[$outcome->id] && $outcomes_activity[$outcome->id]->attempted!=0)
  540. {{$outcomes_activity[$outcome->id]->achieved / $outcomes_activity[$outcome->id]->attempted * 100}}
  541. {{-- ($outcomes_achieved[$outcome->id] / $outcomes_attempted[$outcome->id]) * 100 --}},
  542. {{--@if (is_array($outcomes_attempted) && array_key_exists($outcome->id, $outcomes_attempted) && $outcomes_attempted[$outcome->id] != 0) --}}
  543. {{-- {{ ($outcomes_achieved[$outcome->id] / $outcomes_attempted[$outcome->id]) * 100 }}, --}}
  544. @else
  545. 0,
  546. @endif
  547. @endforeach
  548. ],
  549. pointPadding: 0,
  550. } {{--, {
  551. name: 'Expected Value',
  552. color: '#555555',
  553. dataLabels: {
  554. enabled: true,
  555. fontSize: 8,
  556. color: '#fff',
  557. align: 'right',
  558. format: '{y:.1f}%',
  559. style: {
  560. //fontWeight: 'bold'
  561. },
  562. y:-1
  563. },
  564. data: [
  565. @foreach ($outcomes as $index => $outcome)
  566. @if (is_array($outcomes_attempted) && array_key_exists($outcome->id, $outcomes_attempted) && $outcomes_attempted[$outcome->id] != 0)
  567. {{ $outcome->expected_outcome }},
  568. @else
  569. 0,
  570. @endif
  571. @endforeach
  572. ],
  573. pointPadding: 0,
  574. } --}}]
  575. });
  576. var chart = $('#graph').highcharts();
  577. var titletext = $('#graph').highcharts().options.title.text;
  578. var newtitletext = titletext.replace("&#039;", "\'");
  579. chart.setTitle({text: newtitletext});
  580. // Include dummy graph for outcomes
  581. @include('global.dummy-outcomes')
  582. });
  583. @stop