No Description

compare_activities.blade.php 33KB

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