Açıklama Yok

compare_activities.blade.php 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  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. <div class="row">
  19. <ul id='levelTabs' class="nav nav-tabs" role="tablist">
  20. <!-- For each grouped course -->
  21. <li role="presentation" class ='first'>
  22. <a data-toggle="tab" href="#activity_1"
  23. role="tab">{{ strlen($activity_1->name) > 50 ? substr($activity_1->name, 0, 50) . '...' : $activity_1->name }}</a>
  24. </li>
  25. <li role="presentation">
  26. <a data-toggle="tab" href="#activity_2"
  27. role="tab">{{ strlen($activity_2->name) > 50 ? substr($activity_2->name, 0, 50) . '...' : $activity_2->name }}</a>
  28. </li>
  29. </ul>
  30. <div id="allLists" class="tab-content">
  31. <div role="tabpanel" class='tab-pane first' id="activity_1">
  32. <h3 style="text-align: center">Performance by Learning Outcome Criteria in {{ $activity_1->name }}</h3><hr>
  33. <div class="col-md-9" id="graph_1"></div>
  34. </div>
  35. <div role="tabpanel" class='tab-pane' id="activity_2">
  36. <h3 style="text-align: center">Performance by Learning Outcome Criteria in {{ $activity_2->name }}</h3><hr>
  37. <div class="col-md-9" id="graph_2"></div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="row">
  42. <ul id='levelTabs' class="nav nav-tabs" role="tablist">
  43. <!-- For each grouped course -->
  44. <li role="presentation" class = "first">
  45. <a data-toggle="tab" href="#activity_criteriaGraph_1"
  46. role="tab">{{ strlen($activity_1->name) > 50 ? substr($activity_1->name, 0, 50) . '...' : $activity_1->name }}</a>
  47. </li>
  48. <li role="presentation">
  49. <a data-toggle="tab" href="#activity_criteriaGraph_2"
  50. role="tab">{{ strlen($activity_2->name) > 50 ? substr($activity_2->name, 0, 50) . '...' : $activity_2->name }}</a>
  51. </li>
  52. </ul>
  53. <div id="allLists" class="tab-content">
  54. <div role="tabpanel" class='tab-pane first' id="activity_criteriaGraph_1">
  55. <h3 style="text-align: center">Criteria Achievement {{ $activity_1->name }}</h3><hr>
  56. <div class="col-md-9" id="criteriaGraph_1">
  57. </div>
  58. </div>
  59. <div role="tabpanel" class='tab-pane' id="activity_criteriaGraph_2">
  60. <h3 style="text-align: center">Criteria Achievement {{ $activity_2->name }}</h3><hr>
  61. <div class="col-md-9" id="criteriaGraph_2">
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="row">
  67. <ul id='levelTabs' class="nav nav-tabs" role="tablist">
  68. <!-- For each grouped course -->
  69. <li role="presentation" class ="first">
  70. <a data-toggle="tab" href="#activity_tabla_1"
  71. role="tab">{{ strlen($activity_1->name) > 50 ? substr($activity_1->name, 0, 50) . '...' : $activity_1->name }}</a>
  72. </li>
  73. <li role="presentation">
  74. <a data-toggle="tab" href="#activity_tabla_2"
  75. role="tab">{{ strlen($activity_2->name) > 50 ? substr($activity_2->name, 0, 50) . '...' : $activity_2->name }}</a>
  76. </li>
  77. </ul>
  78. <div id="allLists" class="tab-content">
  79. <div role="tabpanel" class='tab-pane first' id="activity_tabla_1">
  80. <h3 style="text-align: center;">{{ $activity_1->name }} </h3>
  81. <br>
  82. <br>
  83. <h5 style="display: inline;">Date: </h5>
  84. <p style="display: inline;">
  85. <strong>({{ $activity_1->date }})</strong>
  86. </p>
  87. <br>
  88. <h5 style="display: inline;">Performance Indicators: </h5>
  89. <?php
  90. Log::info($activity_1->rubric[0]);
  91. ?>
  92. <p style="display: inline;"><i>{{ $activity_1->rubric[0]->num_scales }} (
  93. <?php
  94. $titles = $activity_1->rubric[0]->getTitles();
  95. ?>
  96. @if (sizeof($titles) != 1)
  97. @foreach ($titles as $index5 => $rubric_title)
  98. @if ($index5 != $activity_1->rubric[0]->num_scales - 1)
  99. {{ $rubric_title->text }},
  100. @else
  101. and {{ $rubric_title->text }}
  102. @endif
  103. @endforeach
  104. )
  105. @else
  106. {{ $titles[0]->text }} )
  107. @endif
  108. </i></p>
  109. <br>
  110. <h5 style="display: inline;">Scale: </h5>
  111. @if ($activity_1->rubric[0]->max_score == 1)
  112. <p style="display: inline;">1 point scale</p>
  113. @else
  114. <p style="display: inline;">1-{{ $activity_1->rubric[0]->max_score }} point scale</p>
  115. @endif
  116. <br>
  117. <br>
  118. <h4>Perfomance by Learning Outcome Criteria</h4>
  119. <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
  120. <p style="display: inline;"> <i>{{ $activity_1->rubric[0]->expected_points }} or more</i>
  121. </p>
  122. <br>
  123. <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
  124. target by criterion: </h5>
  125. <p style="display: inline;"> <i>{{ $activity_1->rubric[0]->expected_percentage }} %</i>
  126. </p>
  127. <br>
  128. <table class='table table-striped table-condensed datatable'>
  129. <thead>
  130. <tr>
  131. <th>
  132. Criterion
  133. </th>
  134. <th>
  135. Number of Students Assessed
  136. </th>
  137. <th>
  138. Number of students that achieved the target
  139. </th>
  140. <th>
  141. %
  142. </th>
  143. <th>
  144. Outcomes
  145. </th>
  146. </tr>
  147. </thead>
  148. <tbody>
  149. @foreach ($activity_1->allActivityCriterionInfo() as $index5 => $ac_criterion)
  150. <tr>
  151. <td> {{ $ac_criterion->name }}</td>
  152. <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity_1->id) }}
  153. </td>
  154. <td>
  155. {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity_1->id) }}
  156. </td>
  157. <?php
  158. $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity_1->id);
  159. $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity_1->id);
  160. $percentage = 'N/A';
  161. $activity_1->getOutcomeReport();
  162. ?>
  163. @if ($out_att == 0)
  164. <td class="col-md-1 danger">{{ $percentage }}</td>
  165. @else
  166. <?php
  167. $percentage = round(($out_ach / $out_att) * 100, 2);
  168. ?>
  169. @if ($percentage >= $activity_1->rubric[0]->expected_percentage)
  170. <td class="col-md-1 success">{{ $percentage }}%</td>
  171. @else
  172. <td class="col-md-1 danger">{{ $percentage }}%</td>
  173. @endif
  174. @endif
  175. <td>
  176. @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
  177. {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
  178. @endforeach
  179. </td>
  180. </tr>
  181. @endforeach
  182. </tbody>
  183. </table>
  184. <hr>
  185. <br>
  186. <h4>Perfomance by Learning Outcome Student</h4>
  187. <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
  188. <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
  189. </p>
  190. <br>
  191. <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
  192. target by outcome: </h5>
  193. <p style="display: inline;"> <i>
  194. <?php
  195. $expected = DB::table('target_outcomes_program')
  196. ->where('program_id', $course->program_id)
  197. ->where('semester_id', $course->semester_id)
  198. ->first()->expected_target;
  199. ?>
  200. {{ $expected }}
  201. </i>
  202. </p>
  203. <br>
  204. <table class='table table-striped table-condensed datatable'>
  205. <thead>
  206. <tr>
  207. <th>
  208. Outcome
  209. </th>
  210. <th>
  211. Number of Students Assessed
  212. </th>
  213. <th>
  214. Number of students that achieved the target
  215. </th>
  216. <th>
  217. %
  218. </th>
  219. </tr>
  220. </thead>
  221. <tbody>
  222. @foreach ($activity_1->getOutcomeReport() as $outcome)
  223. <tr>
  224. <td>
  225. {{ $outcome->name }}
  226. </td>
  227. <td>
  228. {{ $outcome->attempted }}
  229. </td>
  230. <td>
  231. {{ $outcome->achieved }}
  232. </td>
  233. @if ($outcome->percentage >= $expected)
  234. <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
  235. @else
  236. <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
  237. @endif
  238. </tr>
  239. @endforeach
  240. </tbody>
  241. </table>
  242. <br>
  243. <hr>
  244. </div>
  245. <div role="tabpanel" class='tab-pane' id="activity_tabla_2">
  246. <h3 style="text-align: center;">{{ $activity_2->name }} </h3>
  247. <br>
  248. <br>
  249. <h5 style="display: inline;">Date: </h5>
  250. <p style="display: inline;">
  251. <strong>({{ $activity_2->date }})</strong>
  252. </p>
  253. <br>
  254. <h5 style="display: inline;">Performance Indicators: </h5>
  255. <?php
  256. Log::info($activity_2->rubric[0]);
  257. ?>
  258. <p style="display: inline;"><i>{{ $activity_2->rubric[0]->num_scales }} (
  259. <?php
  260. $titles = $activity_2->rubric[0]->getTitles();
  261. ?>
  262. @if (sizeof($titles) != 1)
  263. @foreach ($titles as $index5 => $rubric_title)
  264. @if ($index5 != $activity_2->rubric[0]->num_scales - 1)
  265. {{ $rubric_title->text }},
  266. @else
  267. and {{ $rubric_title->text }}
  268. @endif
  269. @endforeach
  270. )
  271. @else
  272. {{ $titles[0]->text }} )
  273. @endif
  274. </i></p>
  275. <br>
  276. <h5 style="display: inline;">Scale: </h5>
  277. @if ($activity_2->rubric[0]->max_score == 1)
  278. <p style="display: inline;">1 point scale</p>
  279. @else
  280. <p style="display: inline;">1-{{ $activity_2->rubric[0]->max_score }} point scale</p>
  281. @endif
  282. <br>
  283. <br>
  284. <h4>Perfomance by Learning Outcome Criteria</h4>
  285. <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
  286. <p style="display: inline;"> <i>{{ $activity_2->rubric[0]->expected_points }} or more</i>
  287. </p>
  288. <br>
  289. <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
  290. target by criterion: </h5>
  291. <p style="display: inline;"> <i>{{ $activity_2->rubric[0]->expected_percentage }} %</i>
  292. </p>
  293. <br>
  294. <table class='table table-striped table-condensed datatable'>
  295. <thead>
  296. <tr>
  297. <th>
  298. Criterion
  299. </th>
  300. <th>
  301. Number of Students Assessed
  302. </th>
  303. <th>
  304. Number of students that achieved the target
  305. </th>
  306. <th>
  307. %
  308. </th>
  309. <th>
  310. Outcomes
  311. </th>
  312. </tr>
  313. </thead>
  314. <tbody>
  315. @foreach ($activity_2->allActivityCriterionInfo() as $index5 => $ac_criterion)
  316. <tr>
  317. <td> {{ $ac_criterion->name }}</td>
  318. <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity_2->id) }}
  319. </td>
  320. <td>
  321. {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity_2->id) }}
  322. </td>
  323. <?php
  324. $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity_2->id);
  325. $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity_2->id);
  326. $percentage = 'N/A';
  327. $activity_2->getOutcomeReport();
  328. ?>
  329. @if ($out_att == 0)
  330. <td class="col-md-1 danger">{{ $percentage }}</td>
  331. @else
  332. <?php
  333. $percentage = round(($out_ach / $out_att) * 100, 2);
  334. ?>
  335. @if ($percentage >= $activity_2->rubric[0]->expected_percentage)
  336. <td class="col-md-1 success">{{ $percentage }}%</td>
  337. @else
  338. <td class="col-md-1 danger">{{ $percentage }}%</td>
  339. @endif
  340. @endif
  341. <td>
  342. @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
  343. {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
  344. @endforeach
  345. </td>
  346. </tr>
  347. @endforeach
  348. </tbody>
  349. </table>
  350. <hr>
  351. <br>
  352. <h4>Perfomance by Learning Outcome Student</h4>
  353. <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
  354. <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
  355. </p>
  356. <br>
  357. <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
  358. target by outcome: </h5>
  359. <p style="display: inline;"> <i>
  360. <?php
  361. $expected = DB::table('target_outcomes_program')
  362. ->where('program_id', $course->program_id)
  363. ->where('semester_id', $course->semester_id)
  364. ->first()->expected_target;
  365. ?>
  366. {{ $expected }}
  367. </i>
  368. </p>
  369. <br>
  370. <table class='table table-striped table-condensed datatable'>
  371. <thead>
  372. <tr>
  373. <th>
  374. Outcome
  375. </th>
  376. <th>
  377. Number of Students Assessed
  378. </th>
  379. <th>
  380. Number of students that achieved the target
  381. </th>
  382. <th>
  383. %
  384. </th>
  385. </tr>
  386. </thead>
  387. <tbody>
  388. @foreach ($activity_2->getOutcomeReport() as $outcome)
  389. <tr>
  390. <td>
  391. {{ $outcome->name }}
  392. </td>
  393. <td>
  394. {{ $outcome->attempted }}
  395. </td>
  396. <td>
  397. {{ $outcome->achieved }}
  398. </td>
  399. @if ($outcome->percentage >= $expected)
  400. <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
  401. @else
  402. <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
  403. @endif
  404. </tr>
  405. @endforeach
  406. </tbody>
  407. </table>
  408. <br>
  409. <hr>
  410. </div>
  411. </div>
  412. </div>
  413. @stop
  414. @section('included-js')
  415. @include('global._datatables_js')
  416. <!-- HighCharts -->
  417. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  418. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  419. <!-- Datepicker -->
  420. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  421. @stop
  422. @section('javascript')
  423. $(function() {
  424. $('#criteriaGraph_1').highcharts({
  425. chart: {
  426. type: 'bar',
  427. height:
  428. @if ($activity_1->is_assessed())
  429. {{ count($activity_1->criteria_achieved()) * 22 + 225 }}
  430. @else
  431. {{ 22 + 225 }}
  432. @endif,
  433. },
  434. title: {
  435. text: ' ',
  436. },
  437. xAxis: {
  438. categories: [
  439. @if ($activity_1->is_assessed())
  440. @foreach ($activity_1->criteria_achieved() as $id => $value)
  441. "{{ Criterion::withTrashed()->find($id)->name }}",
  442. @endforeach
  443. @endif
  444. ],
  445. labels: {
  446. style: {
  447. fontSize: '12px'
  448. },
  449. step: 1,
  450. useHTML: true,
  451. formatter: function() {
  452. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">' +
  453. this.value + '</div>';
  454. },
  455. }
  456. },
  457. yAxis: {
  458. min: 0,
  459. max: 100,
  460. title: {
  461. text: 'Percentage'
  462. },
  463. @if (isset($activity_1->rubric[0]) and isset($activity_1->rubric[0]->expected_percentage))
  464. plotLines:[{
  465. value:{{ $activity_1->rubric[0]->expected_percentage }},
  466. color: '#000',
  467. width:3,
  468. zIndex:4,
  469. label:{
  470. text: 'Goal ({{ $activity_1->rubric[0]->expected_percentage }}%)',
  471. style: {
  472. color: '#000',
  473. fontSize: '14px',
  474. }
  475. }
  476. }]
  477. @endif
  478. },
  479. tooltip: {
  480. headerFormat: '<span style="font-size:10px">{point.key}</span> <table > ',
  481. pointFormat: '<tr> <td style = "color:{series.color};padding:0" > {series.name}: </td>' +
  482. '<td style="padding:0"><b>{point.y:.2f}%</b></td> </tr>',
  483. footerFormat: '</table>',
  484. shared: true,
  485. useHTML: true
  486. },
  487. plotOptions: {
  488. bar: {
  489. //grouping: false,
  490. shadow: false,
  491. borderWidth: 0,
  492. },
  493. series: {
  494. pointPadding: 0,
  495. groupPadding: 0.1
  496. },
  497. },
  498. series: [{
  499. type: 'column',
  500. name: 'Passed',
  501. color: '#e70033',
  502. dataLabels: {
  503. enabled: true,
  504. fontSize: 8,
  505. color: '#fff',
  506. align: 'right',
  507. format: '{y:.1f}%',
  508. style: {
  509. //fontWeight: 'bold'
  510. },
  511. y: -1
  512. },
  513. data: [
  514. @if ($activity_1->is_assessed())
  515. @foreach ($activity_1->cap_array as $id => $crit)
  516. //This conditional is to ignore criteria that weren't assessed. These would have a value of null.
  517. @if ($crit->score_percentage)
  518. {{ $crit->score_percentage }},
  519. @else
  520. 0,
  521. @endif
  522. @endforeach
  523. @endif
  524. ],
  525. pointPadding: 0,
  526. }]
  527. });
  528. $('#criteriaGraph_2').highcharts({
  529. chart: {
  530. type: 'bar',
  531. height:
  532. @if ($activity_2->is_assessed())
  533. {{ count($activity_2->criteria_achieved()) * 22 + 225 }}
  534. @else
  535. {{ 22 + 225 }}
  536. @endif,
  537. },
  538. title: {
  539. text: ' ',
  540. },
  541. xAxis: {
  542. categories: [
  543. @if ($activity_2->is_assessed())
  544. @foreach ($activity_2->criteria_achieved() as $id => $value)
  545. "{{ Criterion::withTrashed()->find($id)->name }}",
  546. @endforeach
  547. @endif
  548. ],
  549. labels: {
  550. style: {
  551. fontSize: '12px'
  552. },
  553. step: 1,
  554. useHTML: true,
  555. formatter: function() {
  556. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">' +
  557. this.value + '</div>';
  558. },
  559. }
  560. },
  561. yAxis: {
  562. min: 0,
  563. max: 100,
  564. title: {
  565. text: 'Percentage'
  566. },
  567. @if (isset($activity_2->rubric[0]) and isset($activity_2->rubric[0]->expected_percentage))
  568. plotLines:[{
  569. value:{{ $activity_2->rubric[0]->expected_percentage }},
  570. color: '#000',
  571. width:3,
  572. zIndex:4,
  573. label:{
  574. text: 'Goal ({{ $activity_2->rubric[0]->expected_percentage }}%)',
  575. style: {
  576. color: '#000',
  577. fontSize: '14px',
  578. }
  579. }
  580. }]
  581. @endif
  582. },
  583. tooltip: {
  584. headerFormat: '<span style="font-size:10px">{point.key}</span> <table > ',
  585. pointFormat: '<tr> <td style = "color:{series.color};padding:0" > {series.name}: </td>' +
  586. '<td style="padding:0"><b>{point.y:.2f}%</b></td> </tr>',
  587. footerFormat: '</table>',
  588. shared: true,
  589. useHTML: true
  590. },
  591. plotOptions: {
  592. bar: {
  593. //grouping: false,
  594. shadow: false,
  595. borderWidth: 0,
  596. },
  597. series: {
  598. pointPadding: 0,
  599. groupPadding: 0.1
  600. },
  601. },
  602. series: [{
  603. type: 'column',
  604. name: 'Passed',
  605. color: '#e70033',
  606. dataLabels: {
  607. enabled: true,
  608. fontSize: 8,
  609. color: '#fff',
  610. align: 'right',
  611. format: '{y:.1f}%',
  612. style: {
  613. //fontWeight: 'bold'
  614. },
  615. y: -1
  616. },
  617. data: [
  618. @if ($activity_2->is_assessed())
  619. @foreach ($activity_2->cap_array as $id => $crit)
  620. //This conditional is to ignore criteria that weren't assessed. These would have a value of null.
  621. @if ($crit->score_percentage)
  622. {{ $crit->score_percentage }},
  623. @else
  624. 0,
  625. @endif
  626. @endforeach
  627. @endif
  628. ],
  629. pointPadding: 0,
  630. }]
  631. });
  632. $('#graph_1').highcharts({
  633. chart: {
  634. type: 'bar',
  635. },
  636. title: {
  637. text: ' '
  638. },
  639. xAxis: {
  640. categories: [
  641. @foreach ($outcomes as $outcome)
  642. "{{ $outcome->name }}",
  643. @endforeach
  644. ],
  645. labels: {
  646. style: {
  647. fontSize: '11px'
  648. },
  649. step: 1,
  650. useHTML: true,
  651. formatter: function() {
  652. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">' +
  653. this.value + '</div>';
  654. },
  655. }
  656. },
  657. yAxis: {
  658. min: 0,
  659. max: 100,
  660. title: {
  661. text: 'Percentage'
  662. }
  663. },
  664. tooltip: {
  665. headerFormat: '<span style="font-size:10px">{point.key}</span> <table > ',
  666. pointFormat: '<tr> <td style = "color:{series.color};padding:0" > {series.name}: </td>' +
  667. '<td style="padding:0"><b>{point.y:.2f}</b></td> </tr>',
  668. footerFormat: '</table>',
  669. shared: true,
  670. useHTML: true
  671. },
  672. plotOptions: {
  673. bar: {
  674. //grouping: false,
  675. shadow: false,
  676. borderWidth: 0,
  677. },
  678. series: {
  679. pointPadding: 0,
  680. groupPadding: 0.075
  681. },
  682. },
  683. series: [{
  684. name: 'Obtained Value',
  685. color: '#e70033',
  686. dataLabels: {
  687. enabled: true,
  688. fontSize: 8,
  689. color: '#fff',
  690. align: 'right',
  691. format: '{y:.1f}%',
  692. style: {
  693. //fontWeight: 'bold'
  694. },
  695. y: -1
  696. },
  697. data: [
  698. @foreach ($outcomes as $index => $outcome)
  699. @if (is_array($outcomes_attempted_1) && array_key_exists($outcome->id, $outcomes_attempted_1) && $outcomes_attempted_1[$outcome->id] != 0)
  700. {{ ($outcomes_achieved_1[$outcome->id] / $outcomes_attempted_1[$outcome->id]) * 100 }},
  701. @else
  702. 0,
  703. @endif
  704. @endforeach
  705. ],
  706. pointPadding: 0,
  707. }, {
  708. name: 'Expected Value',
  709. color: '#555555',
  710. dataLabels: {
  711. enabled: true,
  712. fontSize: 8,
  713. color: '#fff',
  714. align: 'right',
  715. format: '{y:.1f}%',
  716. style: {
  717. //fontWeight: 'bold'
  718. },
  719. y: -1
  720. },
  721. data: [
  722. @foreach ($outcomes as $index => $outcome)
  723. @if (is_array($outcomes_attempted_1) && array_key_exists($outcome->id, $outcomes_attempted_1) && $outcomes_attempted_1[$outcome->id] != 0)
  724. {{ $outcome->expected_outcome }},
  725. @else
  726. 0,
  727. @endif
  728. @endforeach
  729. ],
  730. pointPadding: 0,
  731. }]
  732. });
  733. $('#graph_2').highcharts({
  734. chart: {
  735. type: 'bar',
  736. },
  737. title: {
  738. text:' '
  739. },
  740. xAxis: {
  741. categories: [
  742. @foreach ($outcomes as $outcome)
  743. "{{ $outcome->name }}",
  744. @endforeach
  745. ],
  746. labels: {
  747. style: {
  748. fontSize: '11px'
  749. },
  750. step: 1,
  751. useHTML: true,
  752. formatter: function() {
  753. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">' +
  754. this.value + '</div>';
  755. },
  756. }
  757. },
  758. yAxis: {
  759. min: 0,
  760. max: 100,
  761. title: {
  762. text: 'Percentage'
  763. }
  764. },
  765. tooltip: {
  766. headerFormat: '<span style="font-size:10px">{point.key}</span> <table > ',
  767. pointFormat: '<tr> <td style = "color:{series.color};padding:0" > {series.name}: </td>' +
  768. '<td style="padding:0"><b>{point.y:.2f}</b></td> </tr>',
  769. footerFormat: '</table>',
  770. shared: true,
  771. useHTML: true
  772. },
  773. plotOptions: {
  774. bar: {
  775. //grouping: false,
  776. shadow: false,
  777. borderWidth: 0,
  778. },
  779. series: {
  780. pointPadding: 0,
  781. groupPadding: 0.075
  782. },
  783. },
  784. series: [{
  785. name: 'Obtained Value',
  786. color: '#e70033',
  787. dataLabels: {
  788. enabled: true,
  789. fontSize: 8,
  790. color: '#fff',
  791. align: 'right',
  792. format: '{y:.1f}%',
  793. style: {
  794. //fontWeight: 'bold'
  795. },
  796. y: -1
  797. },
  798. data: [
  799. @foreach ($outcomes as $index => $outcome)
  800. @if (is_array($outcomes_attempted_2) && array_key_exists($outcome->id, $outcomes_attempted_2) && $outcomes_attempted_2[$outcome->id] != 0)
  801. {{ ($outcomes_achieved_2[$outcome->id] / $outcomes_attempted_2[$outcome->id]) * 100 }},
  802. @else
  803. 0,
  804. @endif
  805. @endforeach
  806. ],
  807. pointPadding: 0,
  808. }, {
  809. name: 'Expected Value',
  810. color: '#555555',
  811. dataLabels: {
  812. enabled: true,
  813. fontSize: 8,
  814. color: '#fff',
  815. align: 'right',
  816. format: '{y:.1f}%',
  817. style: {
  818. //fontWeight: 'bold'
  819. },
  820. y: -1
  821. },
  822. data: [
  823. @foreach ($outcomes as $index => $outcome)
  824. @if (is_array($outcomes_attempted_2) && array_key_exists($outcome->id, $outcomes_attempted_2) && $outcomes_attempted_2[$outcome->id] != 0)
  825. {{ $outcome->expected_outcome }},
  826. @else
  827. 0,
  828. @endif
  829. @endforeach
  830. ],
  831. pointPadding: 0,
  832. }]
  833. });
  834. var chart = $('#graph_1').highcharts();
  835. var titletext = $('#graph_1').highcharts().options.title.text;
  836. var newtitletext = titletext.replace("&#039;", "\'");
  837. chart.setTitle({
  838. text: newtitletext
  839. });
  840. var chart = $('#graph_2').highcharts();
  841. var titletext = $('#graph_2').highcharts().options.title.text;
  842. var newtitletext = titletext.replace("&#039;", "\'");
  843. chart.setTitle({
  844. text: newtitletext
  845. });
  846. $('.first').each(function(){
  847. $(this).addClass('active');
  848. })
  849. // Include dummy graph for outcomes
  850. @include('global.dummy-outcomes')
  851. });
  852. @stop
  853. @section('included-js')
  854. @include('global._datatables_js')
  855. <!-- HighCharts -->
  856. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  857. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  858. <!-- Datepicker -->
  859. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  860. @stop