No Description

compare_activities.blade.php 34KB

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