Aucune description

compare_activities.blade.php 36KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  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. @if($activity_1->course->program->expected_outcome_target == null)
  732. plotLines:[{
  733. value:70.00,
  734. color: '#000',
  735. width:3,
  736. zIndex:4,
  737. label:{
  738. text: 'Goal (70.00%)',
  739. style: {
  740. color: '#000',
  741. fontSize: '14px',
  742. }
  743. }
  744. }]
  745. @else
  746. plotLines:[{
  747. value:{{$activity_1->course->program->expected_outcome_target->expected_target}},
  748. color: '#000',
  749. width:3,
  750. zIndex:4,
  751. label:{
  752. text: 'Goal ({{$activity_1->course->program->expected_outcome_target->expected_target}}%)',
  753. style: {
  754. color: '#000',
  755. fontSize: '14px',
  756. }
  757. }
  758. }]
  759. @endif
  760. },
  761. tooltip: {
  762. headerFormat: '<span style="font-size:10px">{point.key}</span>'+
  763. '<table> ',
  764. pointFormat: '<tr>'+
  765. '<td style="color:{series.color};padding:0"> {series.name}: </td>' +
  766. '<td style="padding:0"><b>{point.y:.2f}</b></td>'+
  767. '</tr>',
  768. footerFormat: '</table>',
  769. shared: true,
  770. useHTML: true
  771. },
  772. plotOptions: {
  773. bar: {
  774. //grouping: false,
  775. shadow: false,
  776. borderWidth: 0,
  777. },
  778. series: {
  779. pointPadding: 0,
  780. groupPadding: 0.075
  781. },
  782. },
  783. series: [{
  784. name: 'Obtained Value',
  785. color: '#e70033',
  786. dataLabels: {
  787. enabled: true,
  788. fontSize: 8,
  789. color: '#fff',
  790. align: 'right',
  791. format: '{y:.1f}%',
  792. style: {
  793. //fontWeight: 'bold'
  794. },
  795. y: -1
  796. },
  797. data: [
  798. @foreach ($outcomes as $index => $outcome)
  799. @if (is_array($results_1) && array_key_exists($outcome->id, $results_1) && $results_1[$outcome->id]->attempted != 0)
  800. {{ ($results_1[$outcome->id]->achieved / $results_1[$outcome->id]->attempted) * 100 }},
  801. @else
  802. 0,
  803. @endif
  804. @endforeach
  805. ],
  806. pointPadding: 0,
  807. }/*, {
  808. name: 'Expected Value',
  809. color: '#555555',
  810. dataLabels: {
  811. enabled: true,
  812. fontSize: 8,
  813. color: '#fff',
  814. align: 'right',
  815. format: '{y:.1f}%',
  816. style: {
  817. //fontWeight: 'bold'
  818. },
  819. y: -1
  820. },
  821. data: [
  822. @foreach ($outcomes as $index => $outcome)
  823. @if (is_array($results_1) && array_key_exists($outcome->id, $results_1) && $results_1[$outcome->id]->attempted != 0)
  824. {{ $outcome->expected_outcome }},
  825. @else
  826. 0,
  827. @endif
  828. @endforeach
  829. ],
  830. pointPadding: 0,
  831. }*/]
  832. });
  833. $('#graph_2').highcharts({
  834. chart: {
  835. type: 'bar',
  836. },
  837. title: {
  838. text:' '
  839. },
  840. xAxis: {
  841. categories: [
  842. @foreach ($outcomes as $outcome)
  843. "{{ $outcome->name }}<br>"+
  844. @if(isset($results_2[$outcome->id]))
  845. "( N = {{$results_2[$outcome->id]->attempted}}, {{$results_2[$outcome->id]->achieved}})",
  846. @else
  847. "( N = 0, 0)",
  848. @endif
  849. @endforeach
  850. ],
  851. labels: {
  852. style: {
  853. fontSize: '11px'
  854. },
  855. step: 1,
  856. useHTML: true,
  857. formatter: function() {
  858. return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">' +
  859. this.value + '</div>';
  860. },
  861. }
  862. },
  863. yAxis: {
  864. min: 0,
  865. max: 100,
  866. title: {
  867. text: 'Percentage'
  868. },
  869. @if($activity_2->course->program->expected_outcome_target == null)
  870. plotLines:[{
  871. value:70.00,
  872. color: '#000',
  873. width:3,
  874. zIndex:4,
  875. label:{
  876. text: 'Goal (70.00%)',
  877. style: {
  878. color: '#000',
  879. fontSize: '14px',
  880. }
  881. }
  882. }]
  883. @else
  884. plotLines:[{
  885. value:{{$activity_2->course->program->expected_outcome_target->expected_target}},
  886. color: '#000',
  887. width:3,
  888. zIndex:4,
  889. label:{
  890. text: 'Goal ({{$activity_2->course->program->expected_outcome_target->expected_target}}%)',
  891. style: {
  892. color: '#000',
  893. fontSize: '14px',
  894. }
  895. }
  896. }]
  897. @endif
  898. },
  899. tooltip: {
  900. headerFormat: '<span style="font-size:10px">{point.key}</span>'+
  901. '<table> ',
  902. pointFormat: '<tr>'+
  903. '<td style="color:{series.color};padding:0"> {series.name}: </td>' +
  904. '<td style="padding:0"><b>{point.y:.2f}</b></td>'+
  905. '</tr>',
  906. footerFormat: '</table>',
  907. shared: true,
  908. useHTML: true
  909. },
  910. plotOptions: {
  911. bar: {
  912. //grouping: false,
  913. shadow: false,
  914. borderWidth: 0,
  915. },
  916. series: {
  917. pointPadding: 0,
  918. groupPadding: 0.075
  919. },
  920. },
  921. series: [{
  922. name: 'Obtained Value',
  923. color: '#e70033',
  924. dataLabels: {
  925. enabled: true,
  926. fontSize: 8,
  927. color: '#fff',
  928. align: 'right',
  929. format: '{y:.1f}%',
  930. style: {
  931. //fontWeight: 'bold'
  932. },
  933. y: -1
  934. },
  935. data: [
  936. @foreach ($outcomes as $index => $outcome)
  937. @if (is_array($results_2) && array_key_exists($outcome->id, $results_2) && $results_2[$outcome->id]->attempted != 0)
  938. {{ ($results_2[$outcome->id]->achieved / $results_2[$outcome->id]->attempted) * 100 }},
  939. @else
  940. 0,
  941. @endif
  942. @endforeach
  943. ],
  944. pointPadding: 0,
  945. }, /*{
  946. name: 'Expected Value',
  947. color: '#555555',
  948. dataLabels: {
  949. enabled: true,
  950. fontSize: 8,
  951. color: '#fff',
  952. align: 'right',
  953. format: '{y:.1f}%',
  954. style: {
  955. //fontWeight: 'bold'
  956. },
  957. y: -1
  958. },
  959. data: [
  960. @foreach ($outcomes as $index => $outcome)
  961. @if (is_array($results_2) && array_key_exists($outcome->id, $results_2) && $results_2[$outcome->id]->attempted != 0)
  962. {{ $outcome->expected_outcome }},
  963. @else
  964. 0,
  965. @endif
  966. @endforeach
  967. ],
  968. pointPadding: 0,
  969. }*/]
  970. });
  971. var chart = $('#graph_1').highcharts();
  972. var titletext = $('#graph_1').highcharts().options.title.text;
  973. var newtitletext = titletext.replace("&#039;", "\'");
  974. chart.setTitle({
  975. text: newtitletext
  976. });
  977. var chart = $('#graph_2').highcharts();
  978. var titletext = $('#graph_2').highcharts().options.title.text;
  979. var newtitletext = titletext.replace("&#039;", "\'");
  980. chart.setTitle({
  981. text: newtitletext
  982. });
  983. $('.first').each(function(){
  984. $(this).addClass('active');
  985. })
  986. // Include dummy graph for outcomes
  987. @include('global.dummy-outcomes')
  988. });
  989. @stop
  990. @section('included-js')
  991. @include('global._datatables_js')
  992. <!-- HighCharts -->
  993. <script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
  994. <!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
  995. <!-- Datepicker -->
  996. <script src="{{ asset('vendor/jquery-ui-1.11.4.custom/jquery-ui.min.js') }}"></script>
  997. @stop