No Description

compare_activities.blade.php 35KB

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