暫無描述

compare_activities.blade.php 34KB

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