Browse Source

EStamos

Activos
parent
commit
e116e37147

+ 71
- 1
app/controllers/ActivitiesController.php View File

@@ -907,4 +907,74 @@ class ActivitiesController extends \BaseController
907 907
 
908 908
         return View::make('local.professors.print_assessment', compact('activity', 'title', 'students', 'course', 'rubric_contents', 'assessments', 'scores_array', 'rubric'));
909 909
     }
910
-}
910
+
911
+    public function compareActivities($activity_1, $activity_2)
912
+    {
913
+        $activity_1 = Activity::find($activity_1);
914
+        $activity_2 = Activity::find($activity_2);
915
+
916
+
917
+        // If activity does not exist, display 404
918
+        if (!$activity_1 || !$activity_2)
919
+            App::abort('404');
920
+
921
+        // Get activity's course
922
+        $course = Course::where('id', '=', $activity_1->course_id)->firstOrFail();
923
+
924
+        // If activity does not belong to the requesting user, display 403
925
+        if ($course->user_id != Auth::id() and Auth::user()->role == 4)
926
+            App::abort('403', 'Access Forbidden');
927
+
928
+        // Get active semesters
929
+        $active_semesters = array();
930
+        $active_semesters_collection = Semester::select('id')->where('is_visible', 1)->where('start', '<=', date('Y-m-d H:i:s'))->where('end', '>=', date('Y-m-d H:i:s'))->get();
931
+        foreach ($active_semesters_collection as $active_semester) {
932
+            $active_semesters[] = $active_semester->id;
933
+        }
934
+
935
+        Log::info($active_semesters);
936
+        // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
937
+        $title = $course->code . $course->number . '-' . $course->section . ': ' . htmlspecialchars($activity_1->name, ENT_QUOTES) . ' <span class="small attention">(' . $course->semester->code . ')</span>';
938
+        $outcomes = Outcome::orderBy('name', 'asc')->get();
939
+        $assessment_1 = DB::table('assessments')
940
+            ->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
941
+            ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
942
+            ->where('activity_id', $activity_1->id)
943
+            ->get();
944
+
945
+        if ($assessment_1) {
946
+            $outcomes_achieved_1 = $activity_1->o_ach_array;
947
+            $outcomes_attempted_1 = $activity_1->o_att_array;
948
+        } else {
949
+            $outcomes_achieved_1 = [];
950
+            $outcomes_attempted_1 = [];
951
+        }
952
+
953
+        $assessment_2 = DB::table('assessments')
954
+            ->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
955
+            ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
956
+            ->where('activity_id', $activity_2->id)
957
+            ->get();
958
+
959
+        if ($assessment_2) {
960
+            $outcomes_achieved_2 = $activity_2->o_ach_array;
961
+            $outcomes_attempted_2 = $activity_2->o_att_array;
962
+        } else {
963
+            $outcomes_achieved_2 = [];
964
+            $outcomes_attempted_2 = [];
965
+        }
966
+
967
+
968
+
969
+        $activity_criterion_2 = DB::table('criteria')
970
+            ->join('activity_criterion', 'criteria.id', '=', 'activity_criterion.criterion_id')
971
+            ->where('activity_id', $activity_2->id)
972
+            ->select('activity_criterion.id', 'activity_criterion.criterion_id')
973
+            ->addSelect('criteria.name')
974
+            ->get();
975
+
976
+
977
+
978
+        return View::make('local.professors.compare_activities', compact('activity_1', 'activity_2', 'activity_criterion_1', 'activity_criterion_2', 'title', 'outcomes', 'outcomes_achieved_1', 'outcomes_attempted_1', 'outcomes_achieved_2', 'outcomes_attempted_2', 'course', 'student_count', 'active_semesters'));
979
+    }
980
+}

+ 25
- 13
app/controllers/OutcomesController.php View File

@@ -773,31 +773,42 @@ class OutcomesController extends \BaseController
773 773
     /**
774 774
      * Campus Assessment Reports
775 775
      */
776
-    public function assessmentReport($outcome_id)
776
+    public function assessmentReport()
777 777
     {
778
-        $outcome = Outcome::find($outcome_id);
778
+        //$outcome = Outcome::find($outcome_id);
779 779
 
780
-        if (!$outcome)
781
-            App::abort('404');
782
-        $title = "Assessment Report: " . $outcome->name;
780
+        //if (!$outcome)
781
+        //    App::abort('404');
782
+        $title = "Campus Assessment Report "; //. $outcome->name;
783 783
 
784 784
 
785 785
         $schools = School::has('courses')
786
-            ->with(array('programs' => function ($query) use ($outcome_id) {
786
+            ->with(array('programs' => function ($query) /*use ($outcome_id)*/ {
787 787
                 $query
788 788
                     ->has('courses')
789
-                    ->with(array('courses' => function ($query2) use ($outcome_id) {
789
+                    ->with(array('courses' => function ($query2) /*use ($outcome_id)*/ {
790 790
                         $query2
791
-                            ->has('activities')
791
+                            /*->has('activities')
792 792
                             //                             ->whereNotNull('outcomes_attempted')
793 793
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
794 794
                             ->whereIn('semester_id', Session::get('semesters_ids'))
795
+                            ->groupBy(array('code', 'number'));*/
796
+                            ->has('activities')
797
+                            ->join('activities', 'activities.course_id', '=', 'courses.id')
798
+                            ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
799
+                            ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
800
+                            ->where('activities.draft', 0)
801
+                            ->where('activities.diagnostic', 0)
802
+                            ->select('courses.*')->distinct()
803
+                            //->whereNotNull('outcomes_attempted')
804
+
805
+                            ->whereIn('semester_id', Session::get('semesters_ids'))
795 806
                             ->groupBy(array('code', 'number'));
796 807
                     }));
797 808
             }))
798 809
             ->get();
799 810
 
800
-        return View::make('local.managers.admins.assessment_report', compact('title', 'outcome', 'schools'));
811
+        return View::make('local.managers.admins.new_assessment_report', compact('title', 'schools'));
801 812
     }
802 813
 
803 814
     public function totalAssessmentReport()
@@ -910,9 +921,10 @@ class OutcomesController extends \BaseController
910 921
     /**
911 922
      * School Assessment Reports
912 923
      */
913
-    public function schoolAssessmentReport($outcome_id)
924
+    public function schoolAssessmentReport()
914 925
     {
915
-        $outcome = Outcome::find($outcome_id);
926
+
927
+        //$outcome = Outcome::find($outcome_id);
916 928
 
917 929
         //if (!$outcome)
918 930
         //    App::abort('404');
@@ -941,7 +953,7 @@ class OutcomesController extends \BaseController
941 953
             }))
942 954
             ->first();
943 955
 
944
-        return View::make('local.managers.sCoords.assessment_report', compact('title', 'school', 'outcome'));
956
+        return View::make('local.managers.sCoords.new_assessment_report', compact('title', 'school'));
945 957
     }
946 958
 
947 959
     /**
@@ -1076,4 +1088,4 @@ class OutcomesController extends \BaseController
1076 1088
 
1077 1089
         return View::make('local.managers.shared.annual_report', compact('title', 'program_id', 'annual_plans', 'program'));
1078 1090
     }
1079
-}
1091
+}

+ 4
- 3
app/routes.php View File

@@ -341,7 +341,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
341 341
         Route::post('administrator/semesters/update', 'SemestersController@update');
342 342
         Route::post('deleteObjective', 'Objective2Controller@delete');
343 343
 
344
-        Route::get('assessment-report/{outcome_id}', 'OutcomesController@assessmentReport');
344
+        Route::get('assessment-report', 'OutcomesController@assessmentReport');
345 345
         // TODO: Change later
346 346
         Route::get('new-assessment-report/{outcome_id}', 'OutcomesController@newAssessmentReport');
347 347
 
@@ -376,7 +376,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
376 376
 
377 377
         // Assessment reports
378 378
 
379
-        Route::get('school-assessment-report/{outcome_id}', 'OutcomesController@schoolAssessmentReport');
379
+        Route::get('school-assessment-report', 'OutcomesController@schoolAssessmentReport');
380 380
 
381 381
         // Gabriel added this, so the school coordinator can add criterias and objectives
382 382
         Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
@@ -558,10 +558,11 @@ Route::group(array('before' => 'auth|has_access'), function () {
558 558
         Route::get('learning-objectives-criteria', 'CriteriaController@objectivesIndex');
559 559
         Route::get('export_grades/{id}', 'CoursesController@exportGrades');
560 560
         Route::get('learning-objectives-criteria', 'CriteriaController@objectivesIndex');
561
+        Route::get('compare_activities/{activity_1}/{activity_2}', 'ActivitiesController@compareActivities');
561 562
         // Assessment reports
562 563
         //Route::get('professor-assessment-report/{outcome_id}', 'OutcomesController@professorAssessmentReport');
563 564
         Route::get('professor-assessment-reports', 'OutcomesController@professorAssessmentReport');
564 565
 
565 566
         Route::get('general-studies-overview', 'ProfessorsController@generalStudiesOverview');
566 567
     });
567
-});
568
+});

+ 89
- 77
app/views/local/managers/admins/_navigation.blade.php View File

@@ -1,88 +1,100 @@
1 1
 <div class="navbar navbar-inverse navbar-static-top">
2
-  <div class="container-fluid">
2
+    <div class="container-fluid">
3 3
 
4
-    <ul class="nav navbar-nav navbar-right">
5
-      <li>{{ HTML::linkAction('AdministratorsController@overview', 'Overview') }}</li>
6
-      <li>{{ HTML::linkAction('AdministratorsController@overview2', 'Overview2') }}</li>
4
+        <ul class="nav navbar-nav navbar-right">
5
+            <li>{{ HTML::linkAction('AdministratorsController@overview', 'Overview') }}</li>
6
+            <li>{{ HTML::linkAction('AdministratorsController@overview2', 'Overview2') }}</li>
7 7
 
8
-      <li class="dropdown">
9
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Management<span class="caret"></span></a>
10
-        <ul class="dropdown-menu" role="menu">
11
-          <li>{{ HTML::linkAction('CoursesController@reassign', 'Courses') }}</li>
12
-          <li>{{ HTML::linkAction('Objective2Controller@edit', 'Objectives')}}</li>
13
-          <li>{{ HTML::linkAction('CriteriaController@edit', 'Criteria') }}</li>
14
-          <li>{{ HTML::linkAction('OutcomesController@index', 'Learning Outcomes') }}</li>
15
-          <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubric Builder') }}</li>
16
-          <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
17
-          <li>{{ HTML::linkAction('SemestersController@edit', 'Semesters') }}</li>
18
-          <li>{{ HTML::linkAction('UsersController@index', 'Users') }}</li>
19
-        </ul>
20
-      </li>
21
-      <li class="dropdown">
22
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
23
-        <ul class="dropdown-menu" role="menu">
24
-          <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
25
-          <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
26
-        </ul>
27
-      </li>
28
-      <li class="dropdown">
29
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Colleges and Schools<span class="caret"></span></a>
30
-        <ul class="dropdown-menu" role="menu">
31
-          @foreach ($schools as $school)
32
-          <li>{{ HTML::linkAction('SchoolsController@show', $school->name, array($school->id)) }}</li>
33
-          @endforeach
34
-        </ul>
35
-      </li>
36
-      <li>{{ HTML::linkAction('ProgramsController@index', 'Programs') }}</li>
8
+            <li class="dropdown">
9
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
10
+                    aria-expanded="false">Management<span class="caret"></span></a>
11
+                <ul class="dropdown-menu" role="menu">
12
+                    <li>{{ HTML::linkAction('CoursesController@reassign', 'Courses') }}</li>
13
+                    <li>{{ HTML::linkAction('Objective2Controller@edit', 'Objectives') }}</li>
14
+                    <li>{{ HTML::linkAction('CriteriaController@edit', 'Criteria') }}</li>
15
+                    <li>{{ HTML::linkAction('OutcomesController@index', 'Learning Outcomes') }}</li>
16
+                    <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubric Builder') }}</li>
17
+                    <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
18
+                    <li>{{ HTML::linkAction('SemestersController@edit', 'Semesters') }}</li>
19
+                    <li>{{ HTML::linkAction('UsersController@index', 'Users') }}</li>
20
+                </ul>
21
+            </li>
22
+            <li class="dropdown">
23
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning
24
+                    and Criterias<span class="caret"></span></a>
25
+                <ul class="dropdown-menu" role="menu">
26
+                    <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
27
+                    <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
28
+                </ul>
29
+            </li>
30
+            <li class="dropdown">
31
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Colleges
32
+                    and Schools<span class="caret"></span></a>
33
+                <ul class="dropdown-menu" role="menu">
34
+                    @foreach ($schools as $school)
35
+                        <li>{{ HTML::linkAction('SchoolsController@show', $school->name, [$school->id]) }}</li>
36
+                    @endforeach
37
+                </ul>
38
+            </li>
39
+            <li>{{ HTML::linkAction('ProgramsController@index', 'Programs') }}</li>
37 40
 
38
-      @if(count(Auth::user()->courses))
39
-      <li> {{ HTML::linkAction('ProfessorsController@overview', 'My Courses', NULL) }}</li>
40
-      <li class="dropdown">
41
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Sections<span class="caret"></span></a>
42
-        <ul class="dropdown-menu" role="menu">
43
-          @foreach ($courses as $course)
44
-          <li> {{ HTML::linkAction('CoursesController@show', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</li>
45
-          @endforeach
46
-        </ul>
47
-      </li>
41
+            @if (count(Auth::user()->courses))
42
+                <li> {{ HTML::linkAction('ProfessorsController@overview', 'My Courses', null) }}</li>
43
+                <li class="dropdown">
44
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
45
+                        aria-expanded="false">Sections<span class="caret"></span></a>
46
+                    <ul class="dropdown-menu" role="menu">
47
+                        @foreach ($courses as $course)
48
+                            <li> {{ HTML::linkAction('CoursesController@show', $course->code . $course->number . '-' . $course->section . ' (' . $course->semester->code . ')', ['id' => $course->id]) }}
49
+                            </li>
50
+                        @endforeach
51
+                    </ul>
52
+                </li>
48 53
 
49
-      @endif
54
+            @endif
50 55
 
51
-      <li class="dropdown">
52
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Reports<span class="caret"></span></a>
53
-        <ul class="dropdown-menu" role="menu">
54
-          <li>{{ HTML::linkAction('OutcomesController@managerAssessmentReports', 'Campus Reports') }}</li>
55
-          <li>{{ HTML::linkAction('OutcomesController@totalAssessmentReport', 'Total Assessment Reports') }}</li>
56
-         @if(count(Auth::user()->courses))
57
-          <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'My Courses\' Reports') }}</li>
56
+            <li class="dropdown">
57
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
58
+                    aria-expanded="false">Reports<span class="caret"></span></a>
59
+                <ul class="dropdown-menu" role="menu">
60
+                    <li>{{ HTML::linkAction('OutcomesController@assessmentReport', 'Campus Reports') }}</li>
61
+                    <li>{{ HTML::linkAction('OutcomesController@totalAssessmentReport', 'Total Assessment Reports') }}
62
+                    </li>
63
+                    @if (count(Auth::user()->courses))
64
+                        <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'My Courses\' Reports') }}
65
+                        </li>
58 66
 
59
-          @endif
60
-        </ul>
61
-      </li>
67
+                    @endif
68
+                </ul>
69
+            </li>
62 70
 
63
-      <li class="dropdown">
64
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span class="caret"></span></a>
65
-        <ul class="dropdown-menu" role="menu">
66
-          <li>{{ HTML::linkAction('FeedbackController@create', 'Feedback') }}</li>
67
-          <!-- <li><a href="{{ asset('files/OLAS-intro.pdf') }}">Introduction to OLAS</a></li> -->
68
-          <li><a href="{{ asset('files/intro-avaluo.pdf') }}">Introduction to Assessment</a></li>
69
-          <!-- <li><a href="{{ asset('files/OLAS-coords.pdf') }}">OLAS for Coordinators</a></li> -->
70
-          <li><a href="http://oeae.uprrp.edu/wp-content/uploads/2019/01/Brochure-de-OLAS-rev.-agosto-2018.pdf">Brochure</a></li>
71
-        </ul>
72
-      </li>
73
-      <li class="dropdown">
74
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Account<span class="caret"></span></a>
75
-         <ul class="dropdown-menu" role="menu">
76
-          <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
77
-          <li>{{ HTML::linkAction('AuthController@logout', 'Log out ('.Auth::user()->email.')') }}</li>
78
-        </ul>
79
-      </li>
80
-<!-- 
81
-          <li>{{ HTML::linkAction('AuthController@logout', 'Log out ('.Auth::user()->email.')') }}
71
+            <li class="dropdown">
72
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span
73
+                        class="caret"></span></a>
74
+                <ul class="dropdown-menu" role="menu">
75
+                    <li>{{ HTML::linkAction('FeedbackController@create', 'Feedback') }}</li>
76
+                    <!-- <li><a href="{{ asset('files/OLAS-intro.pdf') }}">Introduction to OLAS</a></li> -->
77
+                    <li><a href="{{ asset('files/intro-avaluo.pdf') }}">Introduction to Assessment</a></li>
78
+                    <!-- <li><a href="{{ asset('files/OLAS-coords.pdf') }}">OLAS for Coordinators</a></li> -->
79
+                    <li><a
80
+                            href="http://oeae.uprrp.edu/wp-content/uploads/2019/01/Brochure-de-OLAS-rev.-agosto-2018.pdf">Brochure</a>
81
+                    </li>
82
+                </ul>
83
+            </li>
84
+            <li class="dropdown">
85
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
86
+                    aria-expanded="false">Account<span class="caret"></span></a>
87
+                <ul class="dropdown-menu" role="menu">
88
+                    <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
89
+                    <li>{{ HTML::linkAction('AuthController@logout', 'Log out (' . Auth::user()->email . ')') }}</li>
90
+                </ul>
91
+            </li>
92
+            <!-- 
93
+          <li>{{ HTML::linkAction('AuthController@logout', 'Log out (' . Auth::user()->email . ')') }}
82 94
       </li>
83 95
  -->
84
-    </ul>
85
-    </li>
86
-    </ul>
87
-  </div>
96
+        </ul>
97
+        </li>
98
+        </ul>
99
+    </div>
88 100
 </div>

+ 390
- 0
app/views/local/managers/admins/new_assessment_report.blade.php View File

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

+ 237
- 233
app/views/local/managers/pCoords/new_assessment_report.blade.php View File

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

+ 1
- 1
app/views/local/managers/sCoords/_navigation.blade.php View File

@@ -40,7 +40,7 @@
40 40
       <li class="dropdown">
41 41
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Reports<span class="caret"></span></a>
42 42
         <ul class="dropdown-menu" role="menu">
43
-          <li>{{ HTML::linkAction('OutcomesController@managerAssessmentReports', 'School Reports') }}</li>
43
+          <li>{{ HTML::linkAction('OutcomesController@schoolAssessmentReport', 'School Reports') }}</li>
44 44
           @if(count(Auth::user()->courses))
45 45
           <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'My Courses\' Reports') }}</li>
46 46
           

+ 200
- 154
app/views/local/managers/sCoords/assessment_report.blade.php View File

@@ -1,11 +1,11 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-    @if(Auth::user()->role==1)
4
+    @if (Auth::user()->role == 1)
5 5
         @include('local.managers.admins._navigation')
6
-    @elseif(Auth::user()->role==2)
6
+    @elseif(Auth::user()->role == 2)
7 7
         @include('local.managers.sCoords._navigation')
8
-    @elseif(Auth::user()->role==3)
8
+    @elseif(Auth::user()->role == 3)
9 9
         @include('local.managers.pCoords._navigation')
10 10
     @endif
11 11
 @stop
@@ -13,27 +13,28 @@
13 13
 @section('main')
14 14
     <div class="row">
15 15
         <div class="col-md-12">
16
-            <p>This report contains performance information for all your School's Programs with assessed courses during the following semester(s):</p>
16
+            <p>This report contains performance information for all your School's Programs with assessed courses during the
17
+                following semester(s):</p>
17 18
             <ul>
18 19
                 @foreach (Session::get('semesters_info') as $semester_info)
19 20
                     <li>{{ $semester_info }}</li>
20 21
                 @endforeach
21 22
             </ul>
22 23
 
23
-            @if(!$school->programs->isEmpty())
24
+            @if (!$school->programs->isEmpty())
24 25
                 <p class="hidden-print">Unlinked programs did not assess this outcome.</p>
25 26
 
26 27
                 <h3>Table of Contents</h3>
27 28
                 <ol id="table-of-contents" class="upper-roman">
28 29
 
29 30
                 </ol>
30
-                
31
+
31 32
                 <h3 id="{{ $outcome->id }}" class="outcome">{{ $outcome->name }}</h3>
32 33
                 <table class="table table-condensed table-bordered">
33 34
                     <thead>
34 35
                         <tr>
35 36
                             <th colspan="12">
36
-                                <h4 id="{{ $outcome->id }}-{{ $school->id }}" class="school table-header" >
37
+                                <h4 id="{{ $outcome->id }}-{{ $school->id }}" class="school table-header">
37 38
                                     {{ $school->name }}
38 39
                                 </h4>
39 40
                             </th>
@@ -44,119 +45,160 @@
44 45
                         </tr>
45 46
                     </thead>
46 47
                     <tbody>
47
-                    @foreach ($school->programs as $program)
48
-                        @if($program->assessesOutcome($outcome->id))
49
-                            <tr>
50
-                                <td id="{{ $outcome->id }}-{{ $school->id }}-{{ $program->id }}" class="program col-md-3" ><h5>{{ $program->name }}</h5></td>
51
-                                <td class="col-md-9">
52
-
53
-                                <!-- For each grouped course -->
54
-                                @foreach($program->courses as $index2=>$course)
55
-                                    <!-- If grouped course has activities that evaluate the outcome -->
56
-
57
-                                    <?php
58
-
59
-                                        $sections_evaluating = Course::has('activities')
60
-                                        ->whereNotNull('outcomes_attempted')
61
-                                        ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
62
-                                        ->with(array('activities'=>function($query) use(&$outcome){
63
-                                            $query->whereNotNull('outcomes_attempted');
64
-                                            $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
65
-                                        ->where('code', $course->code)->where('number',$course->number)
66
-                                        ->whereIn('semester_id', Session::get('semesters_ids'))
67
-                                        ->get();
68
-                                    ?>
69
-
70
-                                    @if(count($sections_evaluating))
71
-                                        <a class="to-top hidden-print" href="">
72
-                                            <span class="glyphicon glyphicon-arrow-up"></span>
73
-                                            To Top
74
-                                        </a>
75
-                                        <h4>{{ $course->code}}-{{ $course->number }}</h4>
76
-
77
-                                        <!-- For each section -->
78
-                                        @foreach($sections_evaluating as $index3 => $section)
79
-                                            <h5><u>Instance {{ $index3 + 1}}</u></h5>
80
-
81
-                                            <!-- For each activity in the section -->
82
-                                            @foreach($section->activities as $index4 => $activity)
83
-
84
-                                                <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
85
-                                                @if(array_key_exists($outcome->id, (array)$activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1)
86
-                                                    <h5>Measure {{ $index4 + 1 }}</h5>
87
-                                                    <p>A rubric was used in the {{ $section->code }}-{{ $section->number }} ({{ $section->name }}) course ({{ date('M Y', strtotime($course->updated_at))}}) to assess students’ <u>{{ strtolower($outcome->name) }}</u> in the activity: "<strong>{{ $activity->name }}</strong>". N= {{ count($section->students) }}. </p>
88
-                                                    <p>The expected performance level was that <strong>{{ $activity->rubric->expected_percentage }}%</strong> of students participating in the activity would score <strong>{{ $activity->rubric->expected_points }} points</strong> or more in the 1-8 point scale used.</p>
89
-                                                    <p>The results for each criterion were as follows:</p>
90
-
91
-                                                    <table class="table table-condensed table-bordered">
92
-                                                        @foreach((array)$activity->cap_array as $index5 => $cap)
93
-                                                            <?php
94
-                                                                $criterion = Criterion::find($index5);
95
-                                                            ?>
96
-
97
-                                                            @if($criterion['outcome_id'] == $outcome->id && $cap >= $activity->rubric->expected_percentage )
98
-                                                                <tr>
99
-                                                                    <td>{{ $criterion['name'] }}</td>
100
-                                                                    <td class="col-md-1 success">{{ $cap }}%</td>
101
-                                                                </tr>
102
-                                                            @elseif($criterion['outcome_id'] == $outcome->id && $cap < $activity->rubric->expected_percentage )
103
-                                                                <tr>
104
-                                                                    <td>{{ $criterion['name'] }}</td>
105
-                                                                    <td class="col-md-1 danger">{{ $cap }}%</td>
106
-                                                                </tr>
48
+                        @foreach ($school->programs as $program)
49
+                            @if ($program->assessesOutcome($outcome->id))
50
+                                <tr>
51
+                                    <td id="{{ $outcome->id }}-{{ $school->id }}-{{ $program->id }}"
52
+                                        class="program col-md-3">
53
+                                        <h5>{{ $program->name }}</h5>
54
+                                    </td>
55
+                                    <td class="col-md-9">
56
+
57
+                                        <!-- For each grouped course -->
58
+                                        @foreach ($program->courses as $index2 => $course)
59
+                                            <!-- If grouped course has activities that evaluate the outcome -->
60
+
61
+                                            <?php
62
+                                            
63
+                                            $sections_evaluating = Course::has('activities')
64
+                                                ->whereNotNull('outcomes_attempted')
65
+                                                ->whereRaw('outcomes_attempted not like \'%"' . $outcome->id . '":0%\'')
66
+                                                ->with([
67
+                                                    'activities' => function ($query) use (&$outcome) {
68
+                                                        $query->whereNotNull('outcomes_attempted');
69
+                                                        $query->whereRaw('outcomes_attempted not like \'%"' . $outcome->id . '":0%\'');
70
+                                                    },
71
+                                                ])
72
+                                                ->where('code', $course->code)
73
+                                                ->where('number', $course->number)
74
+                                                ->whereIn('semester_id', Session::get('semesters_ids'))
75
+                                                ->get();
76
+                                            ?>
77
+
78
+                                            @if (count($sections_evaluating))
79
+                                                <a class="to-top hidden-print" href="">
80
+                                                    <span class="glyphicon glyphicon-arrow-up"></span>
81
+                                                    To Top
82
+                                                </a>
83
+                                                <h4>{{ $course->code }}-{{ $course->number }}</h4>
84
+
85
+                                                <!-- For each section -->
86
+                                                @foreach ($sections_evaluating as $index3 => $section)
87
+                                                    <h5><u>Instance {{ $index3 + 1 }}</u></h5>
88
+
89
+                                                    <!-- For each activity in the section -->
90
+                                                    @foreach ($section->activities as $index4 => $activity)
91
+
92
+                                                        <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
93
+                                                        @if (array_key_exists($outcome->id, (array) $activity->o_att_array) && $activity->o_att_array[$outcome->id] >= 1)
94
+                                                            <h5>Measure {{ $index4 + 1 }}</h5>
95
+                                                            <p>A rubric was used in the
96
+                                                                {{ $section->code }}-{{ $section->number }}
97
+                                                                ({{ $section->name }}) course
98
+                                                                ({{ date('M Y', strtotime($course->updated_at)) }}) to
99
+                                                                assess students’ <u>{{ strtolower($outcome->name) }}</u>
100
+                                                                in the activity:
101
+                                                                "<strong>{{ $activity->name }}</strong>". N=
102
+                                                                {{ count($section->students) }}. </p>
103
+                                                            <p>The expected performance level was that
104
+                                                                <strong>{{ $activity->rubric->expected_percentage }}%</strong>
105
+                                                                of students participating in the activity would score
106
+                                                                <strong>{{ $activity->rubric->expected_points }}
107
+                                                                    points</strong> or more in the 1-8 point scale used.</p>
108
+                                                            <p>The results for each criterion were as follows:</p>
109
+
110
+                                                            <table class="table table-condensed table-bordered">
111
+                                                                @foreach ((array) $activity->cap_array as $index5 => $cap)
112
+                                                                    <?php
113
+                                                                    $criterion = Criterion::find($index5);
114
+                                                                    ?>
115
+
116
+                                                                    @if ($criterion['outcome_id'] == $outcome->id && $cap >= $activity->rubric->expected_percentage)
117
+                                                                        <tr>
118
+                                                                            <td>{{ $criterion['name'] }}</td>
119
+                                                                            <td class="col-md-1 success">
120
+                                                                                {{ $cap }}%</td>
121
+                                                                        </tr>
122
+                                                                    @elseif($criterion['outcome_id'] == $outcome->id && $cap < $activity->rubric->expected_percentage)
123
+                                                                        <tr>
124
+                                                                            <td>{{ $criterion['name'] }}</td>
125
+                                                                            <td class="col-md-1 danger">
126
+                                                                                {{ $cap }}%</td>
127
+                                                                        </tr>
128
+                                                                    @endif
129
+                                                                @endforeach
130
+                                                            </table>
131
+
132
+                                                            <ul>
133
+
134
+                                                            </ul>
135
+                                                            <p>
136
+
137
+                                                                <?php
138
+                                                                $o_att_array = $activity->o_att_array;
139
+                                                                $o_ach_array = $activity->o_ach_array;
140
+                                                                $percentage = ($o_ach_array[$outcome->id] / $o_att_array[$outcome->id]) * 100;
141
+                                                                ?>
142
+                                                                @if ($percentage >= 100)
143
+                                                                    The expected goal was reached in <strong>all</strong>
144
+                                                                    (100%) of the criteria assessed. Therefore, the goal for
145
+                                                                    this outcome ({{ $outcome->expected_outcome }}%) was
146
+                                                                    <strong>met</strong>.
147
+                                                                @elseif ($percentage < 1)
148
+                                                                    The expected goal was reached in <strong>none</strong>
149
+                                                                    (0%) of the criteria assessed. Therefore, the goal for
150
+                                                                    this outcome ({{ $outcome->expected_outcome }}%) was
151
+                                                                    <strong>not met</strong>.
152
+                                                                @elseif ($percentage >= $outcome->expected_outcome)
153
+                                                                    The expected goal was reached in
154
+                                                                    <strong>{{ $o_ach_array[$outcome->id] }}</strong> out
155
+                                                                    of the
156
+                                                                    <strong>{{ $o_att_array[$outcome->id] }}</strong>
157
+                                                                    ({{ round($percentage, 2) }}%) criteria assessed.
158
+                                                                    Therefore, the goal for this outcome
159
+                                                                    ({{ $outcome->expected_outcome }}%) was
160
+                                                                    <strong>met</strong>.
161
+                                                                @elseif ($percentage < $outcome->expected_outcome)
162
+                                                                    The expected goal was reached in
163
+                                                                    <strong>{{ $o_ach_array[$outcome->id] }}</strong> out
164
+                                                                    of the
165
+                                                                    <strong>{{ $o_att_array[$outcome->id] }}</strong>
166
+                                                                    ({{ round($percentage, 2) }}%) criteria assessed.
167
+                                                                    Therefore, the goal for this outcome
168
+                                                                    ({{ $outcome->expected_outcome }}%) was <strong> not
169
+                                                                        met</strong>.
170
+                                                                @endif
171
+                                                            </p>
172
+
173
+                                                            <h5><strong>Transforming Actions</strong></h5>
174
+                                                            @if ($activity->transforming_actions)
175
+                                                                {{ $activity->transforming_actions }}
176
+                                                            @else
177
+                                                                None
107 178
                                                             @endif
108
-                                                        @endforeach
109
-                                                    </table>
110
-
111
-                                                    <ul>
112
-
113
-                                                    </ul>
114
-                                                    <p>
115
-
116
-                                                    <?php
117
-                                                        $o_att_array = $activity->o_att_array;
118
-                                                        $o_ach_array = $activity->o_ach_array;
119
-                                                        $percentage = ($o_ach_array[$outcome->id]/$o_att_array[$outcome->id])*100;
120
-                                                    ?>
121
-                                                    @if($percentage >= 100)
122
-                                                        The expected goal was reached in <strong>all</strong> (100%) of the criteria assessed. Therefore, the goal for this outcome ({{ $outcome->expected_outcome }}%) was <strong>met</strong>.
123
-                                                    @elseif ($percentage < 1)
124
-                                                        The expected goal was reached in <strong>none</strong> (0%) of the criteria assessed. Therefore, the goal for this outcome ({{ $outcome->expected_outcome }}%) was <strong>not met</strong>.
125
-                                                    @elseif ($percentage >= $outcome->expected_outcome)
126
-                                                        The expected goal was reached in <strong>{{ $o_ach_array[$outcome->id] }}</strong> out of the <strong>{{ $o_att_array[$outcome->id] }}</strong> ({{ round($percentage, 2) }}%) criteria assessed. Therefore, the goal for this outcome ({{ $outcome->expected_outcome }}%) was <strong>met</strong>.
127
-                                                    @elseif ($percentage < $outcome->expected_outcome)
128
-                                                        The expected goal was reached in <strong>{{ $o_ach_array[$outcome->id] }}</strong> out of the <strong>{{ $o_att_array[$outcome->id] }}</strong> ({{ round($percentage, 2) }}%) criteria assessed. Therefore, the goal for this outcome ({{ $outcome->expected_outcome }}%) was <strong> not met</strong>.
129
-                                                    @endif
130
-                                                    </p>
131
-
132
-                                                    <h5><strong>Transforming Actions</strong></h5>
133
-                                                    @if($activity->transforming_actions)
134
-                                                        {{ $activity->transforming_actions }}
135
-                                                    @else
136
-                                                        None
137
-                                                    @endif
138
-                                                    <br><br>
139
-
140
-                                                @else
141
-                                                    <h5>Measure {{ $index4 + 1 }}</h5>
142
-                                                    <em>Outcome not measured.</em>
143
-                                                @endif
144
-                                            @endforeach
179
+                                                            <br><br>
180
+
181
+                                                        @else
182
+                                                            <h5>Measure {{ $index4 + 1 }}</h5>
183
+                                                            <em>Outcome not measured.</em>
184
+                                                        @endif
185
+                                                    @endforeach
186
+                                                @endforeach
187
+                                                <hr>
188
+                                            @endif
145 189
                                         @endforeach
146
-                                    <hr>
147
-                                    @endif
148
-                                @endforeach
149
-                                </td>
150
-                            </tr>
151
-                        @else
152
-                            <tr>
153
-                                <td id="{{ $outcome->id }}-{{ $school->id }}-{{ $program->id }}" class="program no-courses col-md-3" >{{ $program->name }}</td>
154
-                                <td class="col-md-9">
155
-                                    This program does not assess {{ $outcome->name }}.
156
-                                </td>
157
-                            </tr>
158
-                        @endif
159
-                    @endforeach
190
+                                    </td>
191
+                                </tr>
192
+                            @else
193
+                                <tr>
194
+                                    <td id="{{ $outcome->id }}-{{ $school->id }}-{{ $program->id }}"
195
+                                        class="program no-courses col-md-3">{{ $program->name }}</td>
196
+                                    <td class="col-md-9">
197
+                                        This program does not assess {{ $outcome->name }}.
198
+                                    </td>
199
+                                </tr>
200
+                            @endif
201
+                        @endforeach
160 202
                     </tbody>
161 203
                 </table>
162 204
             @else
@@ -168,61 +210,65 @@
168 210
 
169 211
 @section('javascript')
170 212
 
171
-// Hide tables that have no courses
172
-$('.no-courses').each(function() {
213
+    // Hide tables that have no courses
214
+    $('.no-courses').each(function() {
173 215
 
174
-   // $(this).closest('tr').hide();
216
+    // $(this).closest('tr').hide();
175 217
 
176
-});
218
+    });
177 219
 
178
-// Hide tables with empty bodies
179
-$('tbody').each(function() {
180
-   if($(this).children(':visible').length==0)
181
-   {
182
-       $(this).closest('table').hide();
183
-   }
184
-});
220
+    // Hide tables with empty bodies
221
+    $('tbody').each(function() {
222
+    if($(this).children(':visible').length==0)
223
+    {
224
+    $(this).closest('table').hide();
225
+    }
226
+    });
185 227
 
186 228
 
187 229
 
188 230
 
189
-// Build table of contents
190
-var outcome = $('.outcome');
191
-var str ='';
192
-str+='<li><a href="#'+outcome.attr('id')+'">'+outcome.text()+'</a><ol class="schools upper-alpha">';
231
+    // Build table of contents
232
+    var outcome = $('.outcome');
233
+    var str ='';
234
+    str+='<li><a href="#'+outcome.attr('id')+'">'+outcome.text()+'</a>
235
+        <ol class="schools upper-alpha">';
193 236
 
194
-$('[id^='+outcome.attr('id')+'-].school:visible').each(function(e){
195
-    var school = $(this);
196
-    str+='<li><a href="#'+school.attr('id')+'">'+school.text()+'</a><ol class="programs">';
237
+            $('[id^='+outcome.attr('id')+'-].school:visible').each(function(e){
238
+            var school = $(this);
239
+            str+='<li><a href="#'+school.attr('id')+'">'+school.text()+'</a>
240
+                <ol class="programs">';
197 241
 
198
-    $('[id^='+school.attr('id')+'-].program:visible').each(function(e){
242
+                    $('[id^='+school.attr('id')+'-].program:visible').each(function(e){
199 243
 
200
-        var program = $(this);
201
-        if(!program.hasClass('no-courses'))
202
-            str+='<li><a href="#'+program.attr('id')+'">'+program.text()+'</a></li>';
203
-        else
204
-            str+='<li>'+program.text()+'</li>';
244
+                    var program = $(this);
245
+                    if(!program.hasClass('no-courses'))
246
+                    str+='<li><a href="#'+program.attr('id')+'">'+program.text()+'</a></li>';
247
+                    else
248
+                    str+='<li>'+program.text()+'</li>';
205 249
 
206
-    });
250
+                    });
207 251
 
208
-    str+='</ol></li>';
209
-});
252
+                    str+='</ol>
253
+            </li>';
254
+            });
210 255
 
211
-str+='</ol></li>';
212
-// console.log(str);
213
-$('#table-of-contents').append(str);
256
+            str+='</ol>
257
+    </li>';
258
+    // console.log(str);
259
+    $('#table-of-contents').append(str);
214 260
 
215 261
 
216
-// ----------------------------------------------------------------------------
217
-// Events
218
-//
262
+    // ----------------------------------------------------------------------------
263
+    // Events
264
+    //
219 265
 
220
-$('.to-top').on('click', function(e) {
266
+    $('.to-top').on('click', function(e) {
221 267
     e.preventDefault();
222 268
 
223
-     $(this).scrollTop(0);
269
+    $(this).scrollTop(0);
224 270
     $('html').animate({scrollTop:0}, 1);
225 271
     $('body').animate({scrollTop:0}, 1);
226
-})
272
+    })
227 273
 
228 274
 @stop

+ 336
- 270
app/views/local/managers/sCoords/new_assessment_report.blade.php View File

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

+ 996
- 0
app/views/local/professors/compare_activities.blade.php View File

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

+ 71
- 0
app/views/local/professors/course.blade.php View File

@@ -59,6 +59,7 @@
59 59
 </div>
60 60
 
61 61
 
62
+
62 63
 <div class="row">
63 64
     <div class="col-md-7">
64 65
         <h3>Activities</h3>
@@ -77,6 +78,7 @@
77 78
                         <th>Updated</th>
78 79
                         <th>Assessed</th>
79 80
                         <th>Published</th>
81
+                        <th>Diagnostic</th>
80 82
                     </tr>
81 83
                 </thead>
82 84
                 <tbody>
@@ -95,6 +97,12 @@
95 97
                                 <span class="glyphicon glyphicon-ok"></span>
96 98
                             @endif
97 99
                         </td>
100
+                        <td>
101
+                        @if($activity->o_att_array && !$activity->draft && $activity->diagnostic)
102
+                        <span class="glyphicon glyphicon-ok"></span>
103
+                        
104
+                    @endif
105
+                        </td>
98 106
                     </tr>
99 107
                     @endforeach
100 108
 
@@ -122,7 +130,62 @@
122 130
                 @endif
123 131
             </div>
124 132
         @endif
133
+        
134
+        <button class="btn-lg btn-primary" style="margin:5px;" data-toggle="modal" data-target="#compareActivities">Compare Activities</button>
135
+        <div class="modal fade" id="compareActivities">
136
+            <div class="modal-dialog modal-sm">
137
+              <div class="modal-content">
138
+                <div class="modal-header">
139
+                  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
140
+                  <h4 class="modal-title">Compare Two Activities</h4>
141
+                </div>
142
+                  <div class="modal-body">
143
+                                           
144
+          
145
+                          <p>Vas a seleccionar dos actividades para comparar y presentar los datos de las actividades</p>
146
+                          
147
+                          <h5>Escoge dos actividades para comparar <br></h5>
148
+          
149
+                          <div class="form-group">
150
+          
151
+                             <label>Activity 1</label>
152
+                              
153
+                              <select id='select-activity-1' data-count = "1" class="form-control selectpicker" >
154
+                                  @foreach ($activities as $activity)
155
+                                 
156
+                                  <option value='{{$activity->id}}' >{{$activity->name}}</option>
157
+          
158
+                                  @endforeach
159
+                              </select>
160
+                              <hr>
161
+                              <label>Activity 2</label>
162
+
163
+                              <select id='select-activity-2' data-count = "1" class="form-control selectpicker" >
164
+                                @foreach ($activities as $activity)
165
+                               
166
+                                <option value='{{$activity->id}}' >{{$activity->name}}</option>
167
+        
168
+                                @endforeach
169
+                            </select>
170
+                            <hr>
171
+                          </div>
172
+          
173
+          
174
+                         
175
+                         
176
+                          
177
+                         
178
+                  </div>
179
+                <div class="modal-footer">
180
+                      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
181
+                     <button type ="button" class= 'btn btn-primary' onclick ="goToURL()">Compare</button>
182
+                  {{ Form::close() }}
183
+                </div>
184
+              </div><!-- /.modal-content -->
185
+            </div><!-- /.modal-dialog -->
186
+          </div>
125 187
     </div>
188
+       
126 189
     <div class="col-md-5">
127 190
         <h3>Students</h3>
128 191
         @if(!$students->isEmpty())
@@ -159,6 +222,14 @@
159 222
         @endif
160 223
     </div>
161 224
 </div>
225
+<script>
226
+    function goToURL(){
227
+        activity1 = $('#select-activity-1').val();
228
+        activity2 = $('#select-activity-2').val();
229
+
230
+        window.open('../compare_activities/'+activity1+'/'+activity2,'_self');
231
+    }
232
+</script>
162 233
 @stop
163 234
 
164 235
 @section('included-js')