No Description

compare_activities.blade.php 33KB

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