No Description

new_assessment_report.blade.php 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if (Auth::user()->role == 1)
  4. @include('local.managers.admins._navigation')
  5. @elseif(Auth::user()->role == 2)
  6. @include('local.managers.sCoords._navigation')
  7. @elseif(Auth::user()->role == 3)
  8. @include('local.managers.pCoords._navigation')
  9. @endif
  10. @stop
  11. @section('main')
  12. <div class="row">
  13. <div class="col-md-12">
  14. <p>This report contains performance information for all your Program's assessed courses during the following
  15. semester(s):</p>
  16. <ul>
  17. @foreach (Session::get('semesters_info') as $semester_info)
  18. <li>{{ $semester_info }}</li>
  19. @endforeach
  20. </ul>
  21. @foreach ($schools as $school)
  22. <h3>{{ $school->name }}</h3>
  23. <hr>
  24. @if (!$school->programs->isEmpty())
  25. <h3>Table of Contents</h3>
  26. <ol id="table-of-contents" class="upper-roman">
  27. </ol>
  28. @foreach ($school->programs as $program)
  29. {{-- <ul id='levelTabs' class="nav nav-tabs" role="tablist">
  30. <!-- For each grouped course -->
  31. @foreach ($program->courses as $index2 => $course)
  32. <li role="presentation">
  33. <a data-toggle="tab" href="#{{ $course->code }}-{{ $course->number }}"
  34. role="tab">{{ $course->code }}-{{ $course->number }}</a>
  35. </li>
  36. @endforeach
  37. </ul>
  38. <d id="allLists" class="tab-content"> --}}
  39. <div class="panel panel-default">
  40. <div class="panel-heading">
  41. <h3 class="panel-title">{{ $program->name }}</h3>
  42. </div>
  43. <div class="panel-body">
  44. <!-- If grouped course has activities that evaluate the outcome -->
  45. @foreach ($program->courses as $index2 => $course)
  46. <?php
  47. /*$sections_evaluating = Course::has('activities')
  48. ->whereNotNull('outcomes_attempted')
  49. ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
  50. ->with(array('activities'=>function($query) use(&$outcome){
  51. $query->whereNotNull('outcomes_attempted');
  52. $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
  53. ->where('code', $course->code)->where('number',$course->number)
  54. ->whereIn('semester_id', Session::get('semesters_ids'))
  55. ->get();*/
  56. $sections_evaluating = Course::has('activities')
  57. //->whereNotNull('outcomes_attempted')
  58. //->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
  59. ->with([
  60. 'activities' => function ($query) use (&$course) {
  61. $activities = DB::table('activities')
  62. ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
  63. ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
  64. //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
  65. ->join('courses', 'courses.id', '=', 'activities.course_id')
  66. ->where('courses.code', $course->code)
  67. ->where('courses.number', $course->number)
  68. ->where('activities.draft', 0)
  69. ->where('activities.diagnostic', 0)
  70. //->where('criterion_objective_outcome.outcome_id', $outcome->id)
  71. ->select('activity_id')
  72. ->lists('activity_id');
  73. //$query->whereNotNull('outcomes_attempted');
  74. //$query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
  75. $query->whereIn('id', $activities);
  76. },
  77. ])
  78. ->where('code', $course->code)
  79. ->where('number', $course->number)
  80. ->whereIn('semester_id', Session::get('semesters_ids'))
  81. ->orderBy('semester_id')
  82. ->get();
  83. ?>
  84. @foreach ($sections_evaluating as $index3 => $section)
  85. @if (!$section->publishedActivities->isEmpty())
  86. <h3 style="text-align: center"> Course: {{ $course->code }}
  87. {{ $course->number }}-{{ $section->section }} </h3>
  88. @endif
  89. @foreach ($section->publishedActivities as $index4 => $activity)
  90. <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
  91. <p style="display: inline;">{{ $activity->name }}
  92. <strong>({{ $activity->date }})</strong>
  93. </p>
  94. <br>
  95. <br>
  96. <h5 style="display: inline;">Performance Indicators: </h5>
  97. <?php
  98. Log::info($activity->rubric[0]);
  99. ?>
  100. <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
  101. <?php
  102. $titles = $activity->rubric[0]->getTitles();
  103. ?>
  104. @if (sizeof($titles) != 1)
  105. @foreach ($titles as $index5 => $rubric_title)
  106. @if ($index5 != $activity->rubric[0]->num_scales - 1)
  107. {{ $rubric_title->text }},
  108. @else
  109. and {{ $rubric_title->text }}
  110. @endif
  111. @endforeach
  112. )
  113. @else
  114. {{ $titles[0]->text }} )
  115. @endif
  116. </i></p>
  117. <br>
  118. <h5 style="display: inline;">Scale: </h5>
  119. @if ($activity->rubric[0]->max_score == 1)
  120. <p style="display: inline;">1 point scale</p>
  121. @else
  122. <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point
  123. scale
  124. </p>
  125. @endif
  126. <br>
  127. <br>
  128. <h4>Performance of Students by Learning Outcome Criteria</h4>
  129. <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
  130. <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }}
  131. or
  132. more</i>
  133. </p>
  134. <br>
  135. <h5 style="display: inline; margin:30px;">Expected percent of students achieving
  136. the
  137. target by criterion: </h5>
  138. <p style="display: inline;">
  139. <i>{{ $activity->rubric[0]->expected_percentage }}
  140. %</i>
  141. </p>
  142. <br>
  143. <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
  144. <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
  145. @if ($formative_actions)
  146. <p style="display: inline;">
  147. <strong>{{ $formative_actions[0]->at_text }}:
  148. </strong>
  149. <i>{{ $formative_actions[0]->description }}
  150. </i>
  151. </p>
  152. <br>
  153. <h5>Formative Action's Associated
  154. Criteria: </h5>
  155. <ul>
  156. @foreach ($formative_actions as $criteria)
  157. <li> <i>{{ $criteria->name }} <i></li>
  158. @endforeach
  159. </ul>
  160. @else
  161. <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
  162. @endif
  163. @if ($activity->assessment_comments != null)
  164. <h5 style="display: inline; margin:30px;">Assessment Comments</h5>
  165. <p style="display: inline;">{{ $activity->assessment_comments }}</p>
  166. @endif
  167. <br>
  168. <table class='table table-striped table-condensed datatable'>
  169. <thead>
  170. <tr>
  171. <th>
  172. Criterion
  173. </th>
  174. <th>
  175. Number of Students Assessed
  176. </th>
  177. <th>
  178. Number of students that achieved the target
  179. </th>
  180. <th>
  181. %
  182. </th>
  183. <th>
  184. Outcomes
  185. </th>
  186. </tr>
  187. </thead>
  188. <tbody>
  189. @foreach ($activity->allActivityCriterionInfo() as $index5 => $ac_criterion)
  190. <tr>
  191. <td> {{ $ac_criterion->name }}</td>
  192. <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity->id) }}
  193. </td>
  194. <td>
  195. {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity->id) }}
  196. </td>
  197. <?php
  198. $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
  199. $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
  200. $percentage = 'N/A';
  201. $activity->getOutcomeReport();
  202. ?>
  203. @if ($out_att == 0)
  204. <td class="col-md-1 danger">{{ $percentage }}</td>
  205. @else
  206. <?php
  207. $percentage = round(($out_ach / $out_att) * 100, 2);
  208. ?>
  209. @if ($percentage >= $activity->rubric[0]->expected_percentage)
  210. <td class="col-md-1 success">{{ $percentage }}%</td>
  211. @else
  212. <td class="col-md-1 danger">{{ $percentage }}%</td>
  213. @endif
  214. @endif
  215. <td>
  216. @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
  217. {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
  218. @endforeach
  219. </td>
  220. </tr>
  221. @endforeach
  222. </tbody>
  223. </table>
  224. <hr>
  225. <br>
  226. <h4>Performance of Students by Learning Outcome</h4>
  227. <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
  228. <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
  229. </p>
  230. <br>
  231. <h5 style="display: inline; margin:30px;">Expected percent of students achieving
  232. the
  233. target by outcome: </h5>
  234. <p style="display: inline;"> <i>
  235. <?php
  236. $expected = DB::table('target_outcomes_program')
  237. ->where('program_id', $course->program_id)
  238. ->where('semester_id', $course->semester_id)
  239. ->first(); //->expected_target;
  240. if (!$expected) {
  241. $expected = 'It has not been defined in the annual plan';
  242. }
  243. ?>
  244. {{ $expected }}
  245. </i>
  246. </p>
  247. <br>
  248. <table class='table table-striped table-condensed datatable'>
  249. <thead>
  250. <tr>
  251. <th>
  252. Outcome
  253. </th>
  254. <th>
  255. Number of Students Assessed
  256. </th>
  257. <th>
  258. Number of students that achieved the target
  259. </th>
  260. <th>
  261. %
  262. </th>
  263. </tr>
  264. </thead>
  265. <tbody>
  266. @foreach ($activity->getOutcomeReport() as $outcome)
  267. <tr>
  268. <td>
  269. {{ $outcome->name }}
  270. </td>
  271. <td>
  272. {{ $outcome->attempted }}
  273. </td>
  274. <td>
  275. {{ $outcome->achieved }}
  276. </td>
  277. @if ($outcome->percentage >= $expected)
  278. <td class="col-md-1 success">{{ $outcome->percentage }}%
  279. </td>
  280. @else
  281. <td class="col-md-1 danger">{{ $outcome->percentage }}%
  282. </td>
  283. @endif
  284. </tr>
  285. @endforeach
  286. </tbody>
  287. </table>
  288. <br>
  289. <hr>
  290. @endforeach
  291. @endforeach
  292. @endforeach
  293. </div>
  294. </div>
  295. @endforeach
  296. @else
  297. <h4>This program has not assessed any activity</h4>
  298. @endif
  299. @endforeach
  300. </div>
  301. </div>
  302. <script>
  303. var outcome = $('.outcome');
  304. var str = '';
  305. str += '<li><a href="#' + 1 + '">' + "outcome.text()" + '</a><ol class="schools upper-alpha">';
  306. $('[id^=' + outcome.attr('id') + '-].school:visible').each(function(e) {
  307. var school = $(this);
  308. str += '<li><a href="#' + school.attr('id') + '">' + school.text() + '</a><ol class="programs">';
  309. $('[id^=' + school.attr('id') + '-].program:visible').each(function(e) {
  310. var program = $(this);
  311. if (!program.hasClass('no-courses'))
  312. str += '<li><a href="#' + program.attr('id') + '">' + program.text() + '</a></li>';
  313. else
  314. str += '<li>' + program.text() + '</li>';
  315. });
  316. str += '</ol></li>';
  317. });
  318. // Hide accordion panel contents by default
  319. $('.panel-body').hide();
  320. // --------------------------------------------------------------------------
  321. // Functions
  322. // --------------------------------------------------------------------------
  323. // --------------------------------------------------------------------------
  324. // Events
  325. // --------------------------------------------------------------------------
  326. // When panel heading is clicked, toggle it
  327. $('.panel-heading').on('click', function() {
  328. $(this).next().stop().slideToggle();
  329. })
  330. </script>
  331. @section('included-js')
  332. @include('global._datatables_js')
  333. @stop
  334. @stop
  335. @section('javascript')
  336. // Build table of contents
  337. @stop