Bladeren bron

Bugs, reporte de cursos de programas, y drafts de reportes de programas.

Gabriel Santiago Plaza 3 jaren geleden
bovenliggende
commit
b152fb7604

+ 1
- 0
.gitignore Bestand weergeven

@@ -14,3 +14,4 @@ node_modules/
14 14
 app/config/
15 15
 app/controllers/AuthController.php
16 16
 app/controllers/AuthController.php
17
+bootstrap/start.php

+ 40
- 0
app/controllers/AnnualPlansController.php Bestand weergeven

@@ -452,4 +452,44 @@ class AnnualPlansController extends \BaseController
452 452
 
453 453
     return View::make('local.managers.shared.create_annual_plan', compact('title', 'program', 'current_quinquennium', 'outcomes', 'courses'));
454 454
   }
455
+
456
+  function fetchAnnualReport()
457
+  {
458
+    $program_id = Input::get('program_id');
459
+    $annual_plan_id = Input::get('annual_plan_id');
460
+    $semester_start = Input::get('semester_start');
461
+    $semester_end = Input::get('semester_end');
462
+    $academic_year = Input::get('academic_year');
463
+
464
+    $academic_year = (int) explode(",", $academic_year)[0];
465
+
466
+    $course_codes = DB::table('typ_semester_courses')
467
+      ->join('typ_semester_objectives as tso', 'tso.id', '=', 'typ_semester_courses.typ_semester_objective_id')
468
+      ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
469
+      ->join('typ_semester_outcome as typ_out', 'typ_out.id', '=', 'tso.typ_semester_outcome_id')
470
+      ->join('typ_program', 'typ_out.typ_program_id', '=', 'typ_program.id')
471
+      ->where(function ($query) use (&$semester_start, &$semester_end) {
472
+        $query->where('typ_out.semester_id', $semester_start)
473
+          ->orWhere('typ_out.semester_id', $semester_end);
474
+      })
475
+      ->where('typ_program.program_id', $program_id)
476
+      ->select('courses.code', 'courses.number', 'typ_semester_courses.id as typ_sem_cou_id')
477
+      ->distinct()
478
+      ->get();
479
+    foreach ($course_codes as $course_code) {
480
+
481
+      $course_code->sections = DB::table('courses')
482
+        ->join('activities', 'activities.course_id', '=', 'courses.id')
483
+        ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
484
+        ->join('annual_plan_objective', 'annual_plan_objective.criteria_id', '=', 'activity_criterion.criterion_id')
485
+        ->join('typ_semester_courses', 'typ_semester_courses.id', '=', 'annual_plan_objective.typ_semester_course_id')
486
+        ->where('courses.code', $course_code->code)
487
+        ->where('courses.number', $course_code->number)
488
+        ->where('annual_plan_id', $annual_plan_id)
489
+        ->where('annual_plan_objective.typ_semester_course_id', $course_code->typ_sem_cou_id)
490
+        ->toSql();
491
+
492
+      Log::info($course_code->sections);
493
+    }
494
+  }
455 495
 }

+ 36
- 13
app/controllers/OutcomesController.php Bestand weergeven

@@ -911,10 +911,10 @@ class OutcomesController extends \BaseController
911 911
      */
912 912
     public function schoolAssessmentReport($outcome_id)
913 913
     {
914
-        $outcome = Outcome::find($outcome_id);
914
+        //$outcome = Outcome::find($outcome_id);
915 915
 
916
-        if (!$outcome)
917
-            App::abort('404');
916
+        //if (!$outcome)
917
+        //    App::abort('404');
918 918
         $title = "Assessment Report: " . $outcome->name;
919 919
 
920 920
 
@@ -926,31 +926,32 @@ class OutcomesController extends \BaseController
926 926
                     ->with(array('courses' => function ($query2) {
927 927
                         $query2
928 928
                             ->has('activities')
929
-                            //->whereNotNull('outcomes_attempted')
930 929
                             ->join('activities', 'activities.course_id', '=', 'courses.id')
931 930
                             ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
932 931
                             ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
933 932
                             ->where('activities.draft', 0)
934 933
                             ->select('courses.*')->distinct()
934
+                            //->whereNotNull('outcomes_attempted')
935
+
935 936
                             ->whereIn('semester_id', Session::get('semesters_ids'))
936 937
                             ->groupBy(array('code', 'number'));
937 938
                     }));
938 939
             }))
939 940
             ->first();
940 941
 
941
-        return View::make('local.managers.sCoords.assessment_report', compact('title', 'outcome', 'school'));
942
+        return View::make('local.managers.sCoords.assessment_report', compact('title', 'school'));
942 943
     }
943 944
 
944 945
     /**
945 946
      *    Program Assessment Reports
946 947
      */
947
-    public function programAssessmentReport($outcome_id, $program_id)
948
+    public function programAssessmentReport($program_id)
948 949
     {
949
-        $outcome = Outcome::find($outcome_id);
950
+        //$outcome = Outcome::find($outcome_id);
950 951
 
951
-        if (!$outcome)
952
-            App::abort('404');
953
-        $title = "Assessment Report: " . $outcome->name;
952
+        //if (!$outcome)
953
+        //    App::abort('404');
954
+        $title = "Program Courses Report";
954 955
 
955 956
 
956 957
         $program = Program::where('id', $program_id)
@@ -959,6 +960,11 @@ class OutcomesController extends \BaseController
959 960
                 $query
960 961
                     ->has('activities')
961 962
                     //->whereNotNull('outcomes_attempted')
963
+                    ->join('activities', 'activities.course_id', '=', 'courses.id')
964
+                    ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
965
+                    ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
966
+                    ->where('activities.draft', 0)
967
+                    ->select('courses.*')->distinct()
962 968
 
963 969
                     ->whereIn('semester_id', Session::get('semesters_ids'))
964 970
                     ->groupBy(array('code', 'number'));
@@ -966,11 +972,12 @@ class OutcomesController extends \BaseController
966 972
             ->first();
967 973
         Log::info($program);
968 974
 
969
-        return View::make('local.managers.pCoords.assessment_report', compact('title', 'outcome', 'program'));
975
+
976
+        return View::make('local.managers.pCoords.new_assessment_report', compact('title', 'program'));
970 977
     }
971 978
 
972 979
 
973
-    public function professorAssessmentReports()
980
+    /*public function professorAssessmentReports()
974 981
     {
975 982
         $semesters = Session::get('semesters_ids');
976 983
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
@@ -984,7 +991,7 @@ class OutcomesController extends \BaseController
984 991
         $title = "My Courses' Assessment Reports";
985 992
 
986 993
         return View::make('local.professors.assessment_reports', compact('title', 'outcomes'));
987
-    }
994
+    }*/
988 995
 
989 996
 
990 997
     // Report for a single professor //with a single learning outcome
@@ -1026,4 +1033,20 @@ class OutcomesController extends \BaseController
1026 1033
 
1027 1034
         return View::make('local.professors.new_assessment_report', compact('title', 'courses'));
1028 1035
     }
1036
+
1037
+    public function annualReport($program_id)
1038
+    {
1039
+        $title = "Program Courses Report";
1040
+
1041
+
1042
+        $annual_plans = DB::table('annual_plans')
1043
+            ->join('annual_cycle', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
1044
+            ->where('program_id', $program_id)
1045
+            ->orderBy('semester_start', 'DESC')
1046
+            ->select('*', 'annual_plans.id as annual_id')
1047
+            ->get();
1048
+
1049
+
1050
+        return View::make('local.managers.pCoords.annual_report', compact('title', 'program_id', 'annual_plans'));
1051
+    }
1029 1052
 }

+ 46
- 9
app/controllers/ProgramCoordinatorsController.php Bestand weergeven

@@ -17,16 +17,17 @@ class ProgramCoordinatorsController extends \BaseController
17 17
         return Redirect::to('school-coordinator');
18 18
         break;
19 19
     }
20
-    Log::info(Auth::user()->programs);
20
+    //Log::info(Auth::user()->programs);
21 21
     $title = 'Program Coordinator Overview';
22 22
 
23 23
     $programs = Auth::user()->programs;
24
+    //Log::info($programs);
24 25
 
25 26
     //$outcomes = Outcome::orderBy('name', 'asc')->get();
26 27
 
27 28
     $semesters = Session::get('semesters_ids');
28 29
     $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
29
-    Log::info($semesters->start);
30
+    //Log::info($semesters->start);
30 31
     $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
31 32
       ->whereNull('deleted_at')
32 33
       ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
@@ -63,30 +64,62 @@ class ProgramCoordinatorsController extends \BaseController
63 64
       */
64 65
 
65 66
     foreach ($programs as $program) {
67
+      //Log::info($program);
66 68
       $program_array = array();
67
-
68
-      $program_array['program'] = $program;
69
+      $program_object = new \stdClass();
70
+      $program_object->name = $program->name;
71
+      $program_object->school = $program->school->name;
72
+      $program_object->id = $program->id;
73
+      $program_array['program'] = $program_object;
74
+      //Log::info($program_array);
69 75
 
70 76
       $program_array['outcomes_achieved'] = [];
71 77
       $program_array['outcomes_attempted'] = [];
78
+      //Log::info($program_array);
72 79
 
73 80
       $program_array['program_courses'] = $program->courses;
74
-      $program_array['grouped_objectives'] = $program->objectives();
81
+      //Log::info($program_array);
82
+      //Log::info('grouped_objectives, 1.variable, 2.array');
83
+
84
+      ////Log::info(array($program->objectives()));
85
+      // $program_array['grouped_objectives'] = $program->objectives();
86
+      //Log::info($program_array);
87
+      //Log::info("program_courses");
88
+      //Log::info($program_array['program_courses']);
89
+      //Log::info($program_array);
75 90
 
76 91
       $program_array['assessed_courses_count'] = 0;
77 92
       foreach ($program_array['program_courses'] as $course) {
78
-        if (!($program_array['course_outcomes_achieved'] = $course->outcomes_ach())) {
79
-//           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
93
+        //Log::info($program_array);
94
+
95
+        $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
96
+
97
+        //Log::info("course_outcomes_achieved");
98
+        //Log::info($program_array['course_outcomes_achieved']);
99
+        //Log::info($program_array);
100
+        if (($program_array['course_outcomes_achieved'])) {
101
+          $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
80 102
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
81
-          Log::info($program_array['course_outcomes_achieved']);
103
+          //Log::info('course_outcomes_achieved');
104
+          //Log::info($program_array['course_outcomes_achieved']);
105
+          //Log::info($program_array);
106
+
82 107
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
83 108
             if (array_key_exists($i, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$i] += $program_array['course_outcomes_achieved'][$i];
84 109
             else $program_array['outcomes_achieved'][$i] = $program_array['course_outcomes_achieved'][$i];
110
+            //Log::info('program["outcomes_achieved"]');
111
+            //Log::info($program_array['outcomes_achieved'][$i]);
112
+            //Log::info($program_array);
113
+            Log::info("outcomes_achieved");
114
+            Log::info($program_array['outcomes_achieved']);
85 115
           }
86 116
           foreach ($program_array['course_outcomes_attempted'] as $i => $score) {
87 117
 
88 118
             if (array_key_exists($i, $program_array['outcomes_attempted']))  $program_array['outcomes_attempted'][$i] += $program_array['course_outcomes_attempted'][$i];
89 119
             else $program_array['outcomes_attempted'][$i] = $program_array['course_outcomes_attempted'][$i];
120
+            //Log::info('program["outcomes_achieved"]');
121
+            //Log::info($program_array['outcomes_attempted'][$i]);
122
+            //Log::info($program_array);
90 123
           }
91 124
 
92 125
           $program_array['assessed_courses_count'] += 1;
@@ -108,6 +141,7 @@ class ProgramCoordinatorsController extends \BaseController
108 141
         ->orderBy('number')
109 142
         ->orderBy('semester_id')
110 143
         ->get(); */
144
+      //Log::info($program_array);
111 145
       $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, semester_id, program_id'))
112 146
         ->with('semester')
113 147
         ->with('program')
@@ -118,10 +152,12 @@ class ProgramCoordinatorsController extends \BaseController
118 152
         ->orderBy('number')
119 153
         ->orderBy('semester_id')
120 154
         ->get();
121
-
155
+      //Log::info($program_array);
122 156
       $programs_array[] = $program_array;
123 157
 
124 158
 
159
+
160
+
125 161
       // Program contact information
126 162
       $users = User::select('users.*')
127 163
         ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
@@ -146,6 +182,7 @@ class ProgramCoordinatorsController extends \BaseController
146 182
       $programs_contact[] = $users;
147 183
     }
148 184
 
185
+
149 186
     return View::make('local.managers.pCoords.overview', compact('title', 'programs', 'outcomes', 'programs_array', 'programs_contact'));
150 187
   }
151 188
 }

+ 61
- 61
app/controllers/ProgramsController.php Bestand weergeven

@@ -388,43 +388,43 @@ class ProgramsController extends \BaseController
388 388
 
389 389
 
390 390
 
391
-    foreach ($programs as $program) {
392
-      $program_array = array();
393 391
 
394
-      $program_array['program'] = $program;
392
+    $program_array = array();
395 393
 
396
-      $program_array['outcomes_achieved'] = [];
397
-      $program_array['outcomes_attempted'] = [];
394
+    $program_array['program'] = $program;
398 395
 
399
-      $program_array['program_courses'] = $program->courses;
400
-      $program_array['grouped_objectives'] = $program->objectives();
396
+    $program_array['outcomes_achieved'] = [];
397
+    $program_array['outcomes_attempted'] = [];
401 398
 
402
-      $program_array['assessed_courses_count'] = 0;
403
-      foreach ($program_array['program_courses'] as $course) {
404
-        if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
405
-          //           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
406
-          $program_array['course_outcomes_attempted'] = $course->outcomes_att();
407
-          Log::info($program_array['course_outcomes_achieved']);
408
-          foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
409
-            if (array_key_exists($i, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$i] += $program_array['course_outcomes_achieved'][$i];
410
-            else $program_array['outcomes_achieved'][$i] = $program_array['course_outcomes_achieved'][$i];
411
-          }
412
-          foreach ($program_array['course_outcomes_attempted'] as $i => $score) {
399
+    $program_array['program_courses'] = $program->courses;
400
+    // $program_array['grouped_objectives'] = $program->objectives();
413 401
 
414
-            if (array_key_exists($i, $program_array['outcomes_attempted']))  $program_array['outcomes_attempted'][$i] += $program_array['course_outcomes_attempted'][$i];
415
-            else $program_array['outcomes_attempted'][$i] = $program_array['course_outcomes_attempted'][$i];
416
-          }
402
+    $program_array['assessed_courses_count'] = 0;
403
+    foreach ($program_array['program_courses'] as $course) {
404
+      if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
405
+        //           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
406
+        $program_array['course_outcomes_attempted'] = $course->outcomes_att();
407
+        Log::info($program_array['course_outcomes_achieved']);
408
+        foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
409
+          if (array_key_exists($i, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$i] += $program_array['course_outcomes_achieved'][$i];
410
+          else $program_array['outcomes_achieved'][$i] = $program_array['course_outcomes_achieved'][$i];
411
+        }
412
+        foreach ($program_array['course_outcomes_attempted'] as $i => $score) {
417 413
 
418
-          $program_array['assessed_courses_count'] += 1;
414
+          if (array_key_exists($i, $program_array['outcomes_attempted']))  $program_array['outcomes_attempted'][$i] += $program_array['course_outcomes_attempted'][$i];
415
+          else $program_array['outcomes_attempted'][$i] = $program_array['course_outcomes_attempted'][$i];
419 416
         }
417
+
418
+        $program_array['assessed_courses_count'] += 1;
420 419
       }
420
+    }
421 421
 
422
-      /**
423
-       * List of grouped courses (grouped sections)
424
-       */
422
+    /**
423
+     * List of grouped courses (grouped sections)
424
+     */
425 425
 
426
-      //old code
427
-      /* $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
426
+    //old code
427
+    /* $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
428 428
         ->with('semester')
429 429
         ->with('program')
430 430
         ->where('program_id', $program->id)
@@ -434,43 +434,43 @@ class ProgramsController extends \BaseController
434 434
         ->orderBy('number')
435 435
         ->orderBy('semester_id')
436 436
         ->get(); */
437
-      $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, semester_id, program_id'))
438
-        ->with('semester')
439
-        ->with('program')
440
-        ->where('program_id', $program->id)
441
-        ->whereIn('semester_id', Session::get('semesters_ids'))
442
-        ->groupBy(array('code', 'number', 'semester_id'))
443
-        ->orderBy('code')
444
-        ->orderBy('number')
445
-        ->orderBy('semester_id')
446
-        ->get();
437
+    $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, semester_id, program_id'))
438
+      ->with('semester')
439
+      ->with('program')
440
+      ->where('program_id', $program->id)
441
+      ->whereIn('semester_id', Session::get('semesters_ids'))
442
+      ->groupBy(array('code', 'number', 'semester_id'))
443
+      ->orderBy('code')
444
+      ->orderBy('number')
445
+      ->orderBy('semester_id')
446
+      ->get();
447 447
 
448
-      $programs_array[] = $program_array;
449
-
450
-
451
-      // Program contact information
452
-      $users = User::select('users.*')
453
-        ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
454
-        ->where(function ($query) use ($program) {
455
-          $query
456
-            ->where('school_id', $program->school_id)
457
-            ->where('role', 2);
458
-        })
459
-        ->orWhere(function ($query) use ($program) {
460
-          $query
461
-            ->where('role', 3)
462
-            ->where('program_id', $program->id);
463
-        })
464
-        ->orWhere(function ($query) use ($program) {
465
-          $query
466
-            ->where('role', 4)
467
-            ->where('program_id', $program->id);
468
-        })
469
-        ->get();
448
+    $programs_array[] = $program_array;
470 449
 
471 450
 
472
-      $programs_contact[] = $users;
473
-    }
451
+    // Program contact information
452
+    $users = User::select('users.*')
453
+      ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
454
+      ->where(function ($query) use ($program) {
455
+        $query
456
+          ->where('school_id', $program->school_id)
457
+          ->where('role', 2);
458
+      })
459
+      ->orWhere(function ($query) use ($program) {
460
+        $query
461
+          ->where('role', 3)
462
+          ->where('program_id', $program->id);
463
+      })
464
+      ->orWhere(function ($query) use ($program) {
465
+        $query
466
+          ->where('role', 4)
467
+          ->where('program_id', $program->id);
468
+      })
469
+      ->get();
470
+
471
+
472
+    $programs_contact[] = $users;
473
+
474 474
 
475 475
     return View::make('local.managers.shared.print_program', compact('title', 'program', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'schools', 'program_courses', 'assessed_courses_count', 'grouped_courses'));
476 476
   }

+ 6
- 0
app/models/Activity.php Bestand weergeven

@@ -237,6 +237,12 @@ class Activity extends Eloquent
237 237
 
238 238
 
239 239
 
240
+
241
+
242
+
243
+
244
+
245
+
240 246
       /*foreach ($students_attempted as $student) {
241 247
         $student_criteria[$student];
242 248
       }

+ 10
- 0
app/models/Course.php Bestand weergeven

@@ -137,6 +137,9 @@ class Course extends Eloquent
137 137
       $students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
138 138
       $students_achieved = Criterion::students_achieved($criterion->id, $criterion->activity_id);
139 139
 
140
+      Log::info('estamos aqui');
141
+      Log::info($students_attempted);
142
+
140 143
       if ($students_attempted) {
141 144
         $percentage_students_who_achieved = 100.0 * $students_achieved / $students_attempted;
142 145
       } else {
@@ -148,12 +151,19 @@ class Course extends Eloquent
148 151
           ->select('outcome_id')
149 152
           ->distinct()
150 153
           ->lists('outcome_id');
154
+
151 155
         foreach ($outcomes as $outcome_id) {
152 156
           if (array_key_exists($outcome_id, $outcomes_achieved)) $outcomes_achieved[$outcome_id] += 1;
153 157
           else $outcomes_achieved[$outcome_id] = 1;
154 158
         }
155 159
       }
156 160
     }
161
+    Log::info(
162
+      "OUTCOMES_ACHIEVED: "
163
+    );
164
+    Log::info(
165
+      $outcomes_achieved
166
+    );
157 167
     return $outcomes_achieved;
158 168
   }
159 169
 

+ 1
- 0
app/models/Program.php Bestand weergeven

@@ -70,6 +70,7 @@ class Program extends Eloquent
70 70
 
71 71
 	public function objectives()
72 72
 	{
73
+		
73 74
 		return $this->hasMany('Objective');
74 75
 	}
75 76
 

+ 10
- 1
app/routes.php Bestand weergeven

@@ -166,6 +166,15 @@ Route::group(array('before' => 'auth|has_access'), function () {
166 166
     /**
167 167
      * Shared Routes
168 168
      */
169
+
170
+    Route::get('annual_plan_report/{program_id}', array(
171
+        'as' => 'annual_plan_report/{program_id}',
172
+        'uses' => 'OutcomesController@annualReport'
173
+    ));
174
+    Route::post('fetchAnnualReport', array(
175
+        'as' => 'fetchAnnualReport',
176
+        'uses' => 'AnnualPlansController@fetchAnnualReport'
177
+    ));
169 178
     Route::post('postActivityCriterionTrans/{activity_id}', array(
170 179
         'as' => 'postActivityCriterionTrans/{activity_id}',
171 180
         'uses' => 'TransformativeActionsController@postActivityCriterion'
@@ -425,7 +434,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
425 434
         Route::get('print_course/{code}/{number}/{semester_code}', 'CoursesController@print_course');
426 435
 
427 436
         // Assessment reports
428
-        Route::get('program-assessment-report/{outcome_id}/{program_id}', 'OutcomesController@programAssessmentReport');
437
+        Route::get('program-assessment-report/{program_id}', 'OutcomesController@programAssessmentReport');
429 438
         Route::get('assessment-reports', 'OutcomesController@managerAssessmentReports');
430 439
 
431 440
         // Learning Objectives

+ 9
- 1
app/views/local/managers/pCoords/_navigation.blade.php Bestand weergeven

@@ -45,10 +45,18 @@
45 45
       <li class="dropdown">
46 46
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Reports<span class="caret"></span></a>
47 47
         <ul class="dropdown-menu" role="menu">
48
-          <li>{{ HTML::linkAction('OutcomesController@managerAssessmentReports', 'Program Reports') }}</li>
48
+          <li><a href="{{ URL::action('OutcomesController@programAssessmentReport', Auth::user()->programs[0]->id) }}">Program Reports</a></li>
49
+   
50
+            </li>
51
+          
49 52
           @if(count(Auth::user()->courses))
50 53
           <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'My Courses\' Reports') }}</li>
51 54
           @endif
55
+
56
+   
57
+            </li>
58
+            <li><a href="{{ URL::action('OutcomesController@annualReport', Auth::user()->programs[0]->id) }}">Annual Reports</a></li>
59
+  
52 60
           <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Tranformative and Formative Actions')}}
53 61
     
54 62
         </ul>

+ 69
- 0
app/views/local/managers/pCoords/annual_report.blade.php Bestand weergeven

@@ -0,0 +1,69 @@
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="category" >
16
+              <label for="annual_plans">Annual Plan</label>
17
+              <div class="select">
18
+                <select  class="selectpicker" name="annual_plan" id="annual_plans" onchange ="fetchAnnualReport(this)">
19
+                  
20
+                  @foreach ($annual_plans as $an_pl)
21
+                    <option value='{{json_encode($an_pl)}}'>Annual Plan {{$an_pl->academic_year}}</option>
22
+                  @endforeach
23
+                </select>
24
+              </div>
25
+            </div>
26
+
27
+    </div>
28
+
29
+<script>
30
+    function fetchAnnualReport(select){
31
+        object_json = $(select).val();
32
+        object_json = JSON.parse(object_json);
33
+        semester_start = object_json.semester_start;
34
+        semester_end = object_json.semester_end;
35
+        program_id = object_json.program_id;
36
+        annual_plan_id = object_json.annual_id;
37
+
38
+        $.post(
39
+        "{{ URL::action('AnnualPlansController@fetchAnnualReport') }}",
40
+        { 
41
+            semester_start: semester_start,
42
+            semester_end: semester_end,
43
+            program_id: program_id,
44
+            annual_plan_id: annual_plan_id,
45
+            academic_year:object_json.academic_year
46
+
47
+        
48
+        },
49
+        function(data)
50
+        {
51
+
52
+        }
53
+        );
54
+
55
+    }
56
+
57
+    fetchAnnualReport(document.getElementById('annual_plans'));
58
+</script>
59
+@section('included-js')
60
+@include('global._datatables_js')
61
+@stop
62
+    
63
+@stop
64
+
65
+@section('javascript')
66
+
67
+
68
+
69
+@stop

+ 309
- 0
app/views/local/managers/pCoords/new_assessment_report.blade.php Bestand weergeven

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

+ 7
- 2
app/views/local/managers/pCoords/overview.blade.php Bestand weergeven

@@ -184,7 +184,7 @@
184 184
                                                         <td>All</td>
185 185
                                                     @elseif($user->role == 2)
186 186
                                                         <td>School Coordinator</td>
187
-                                                        <td>All in {{ $program_item['program']->school->name }}</td>
187
+                                                        <td>All in {{ $program_item['program']->school }}</td>
188 188
                                                     @elseif($user->role == 3)
189 189
                                                         <td>Program Coordinator</td>
190 190
                                                         <td>
@@ -331,7 +331,12 @@
331 331
                         //fontWeight: 'bold'
332 332
                     },
333 333
                     y:-1
334
-                },
334
+                }, 
335
+                <?php
336
+                Log::info('program_item');
337
+                Log::info($program_item);
338
+
339
+                ?>
335 340
                 data: [
336 341
                     @foreach($outcomes as $index => $outcome)
337 342
                         @if(

+ 22
- 12
app/views/local/professors/new_assessment_report.blade.php Bestand weergeven

@@ -7,8 +7,7 @@
7 7
         @include('local.managers.sCoords._navigation')
8 8
     @elseif(Auth::user()->role==3)
9 9
         @include('local.managers.pCoords._navigation')
10
-    @else
11
-    @include('local.professors._navigation')
10
+
12 11
     @endif
13 12
 @stop
14 13
 
@@ -22,11 +21,6 @@
22 21
                 @endforeach
23 22
             </ul>
24 23
 
25
-          
26
-
27
-                
28
-                
29
-                       
30 24
                                 <!-- For each grouped course -->
31 25
                                 <ul id = "levelTabs" class="nav nav-tabs" role="tablist">
32 26
                                         
@@ -73,7 +67,7 @@
73 67
                             ?>
74 68
                             @if($sections_evaluating)
75 69
                                    <li role= "presentation">
76
-                                        <a onclick = "$(this).tab('show')" data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
70
+                                        <a onclick = "$(this).tab('show');" data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
77 71
                                             role ="tab">{{ $course->code}}-{{ $course->number }}</a>
78 72
                                         </li>
79 73
 
@@ -200,8 +194,8 @@
200 194
                                             
201 195
                                             @foreach(Criterion::outcomes($ac_criterion->criterion_id) as $index6=>$outcome)
202 196
                                             
203
-                                             {{$index6 + 1}}.   {{$outcome->name}}
204
-                                             <br>
197
+                                             {{$index6 + 1}}.   <?php echo $outcome->name."\n\n\n <br>" ?>
198
+                                             
205 199
                                             
206 200
 
207 201
                                             @endforeach
@@ -222,7 +216,17 @@
222 216
                                 </p>
223 217
                                 <br>
224 218
                                 <h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by outcome: </h5>
225
-                                <p  style = "display: inline;"> <i>TODO 75.00 %</i>
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>
226 230
                                 </p>
227 231
                                 <br>
228 232
                                 <table class='table table-striped table-condensed datatable'>
@@ -255,7 +259,7 @@
255 259
                                             <td>
256 260
                                                 {{$outcome->achieved}}
257 261
                                             </td>
258
-                                            @if($outcome->percentage>= 75)
262
+                                            @if($outcome->percentage>= $expected)
259 263
                                                 <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
260 264
                                                                  
261 265
                                                 @else
@@ -302,6 +306,12 @@
302 306
                                         
303 307
         </div>
304 308
     </div>
309
+
310
+ 
311
+@section('included-js')
312
+    @include('global._datatables_js')
313
+@stop
314
+        
305 315
 @stop
306 316
 
307 317
 @section('javascript')

+ 8
- 8
bootstrap/start.php Bestand weergeven

@@ -23,14 +23,14 @@ $app = new Illuminate\Foundation\Application;
23 23
 | given environment, then we will automatically detect it for you.
24 24
 |
25 25
 */
26
-/*
26
+
27 27
 $env = $app->detectEnvironment(array(
28 28
 
29
-	'local' => array(gethostname(), 'RPV20111.rrp.campus', 'homestead'),
29
+    'local' => array(gethostname(), 'RPV20111.rrp.campus', 'homestead'),
30 30
     'production' => array('*.com', '*.edu', '*.org'),
31 31
 
32 32
 ));
33
-*/
33
+/*
34 34
 
35 35
 $env = $app->detectEnvironment(array(
36 36
 
@@ -38,7 +38,7 @@ $env = $app->detectEnvironment(array(
38 38
     'production' => array('*.com', '*.edu', '*.org'),
39 39
 
40 40
 ));
41
-
41
+*/
42 42
 /*
43 43
 |--------------------------------------------------------------------------
44 44
 | Bind Paths
@@ -50,7 +50,7 @@ $env = $app->detectEnvironment(array(
50 50
 |
51 51
 */
52 52
 
53
-$app->bindInstallPaths(require __DIR__.'/paths.php');
53
+$app->bindInstallPaths(require __DIR__ . '/paths.php');
54 54
 
55 55
 /*
56 56
 |--------------------------------------------------------------------------
@@ -63,10 +63,10 @@ $app->bindInstallPaths(require __DIR__.'/paths.php');
63 63
 |
64 64
 */
65 65
 
66
-$framework = $app['path.base'].
67
-                 '/vendor/laravel/framework/src';
66
+$framework = $app['path.base'] .
67
+    '/vendor/laravel/framework/src';
68 68
 
69
-require $framework.'/Illuminate/Foundation/start.php';
69
+require $framework . '/Illuminate/Foundation/start.php';
70 70
 
71 71
 /*
72 72
 |--------------------------------------------------------------------------