瀏覽代碼

Merge branch 'Merge_gabriel_mayo' of https://git.ccom.uprrp.edu/CDCC/OLAS into Merge_gabriel_mayo

Corrigiendo bugs
父節點
當前提交
8dfb0ea5cf
共有 39 個文件被更改,包括 2023 次插入1396 次删除
  1. 1
    1
      app/controllers/ActivitiesController.php
  2. 109
    11
      app/controllers/AnnualPlansController.php
  3. 1
    1
      app/controllers/CoursesController.php
  4. 1
    1
      app/controllers/CriteriaController.php
  5. 4
    0
      app/controllers/Objective2Controller.php
  6. 5
    15
      app/controllers/OutcomesController.php
  7. 12
    12
      app/controllers/ProfessorsController.php
  8. 1
    1
      app/controllers/ProgramsController.php
  9. 6
    6
      app/controllers/RubricsController.php
  10. 208
    225
      app/controllers/SchoolCoordinatorsController.php
  11. 265
    287
      app/controllers/SchoolsController.php
  12. 42
    3
      app/controllers/TemplatesController.php
  13. 1
    1
      app/controllers/ThreeYearPlanController.php
  14. 1
    1
      app/controllers/TransformativeActionsController.php
  15. 56
    0
      app/database/migrations/2022_02_03_135359_create_transformative_typ_outcome.php
  16. 42
    0
      app/database/migrations/2022_02_03_193908_create_transformative_action_status.php
  17. 32
    0
      app/database/migrations/2022_02_04_040351_add_submit_in_typ_program.php
  18. 0
    0
      app/database/unusedMigrations/2021_06_15_235911_create_annual_report_transformative_table.php
  19. 0
    0
      app/database/unusedMigrations/2022_01_19_100041_add_deleted_at_objectives.php
  20. 1
    1
      app/models/Activity.php
  21. 7
    3
      app/models/Course.php
  22. 3
    3
      app/models/Outcome.php
  23. 9
    2
      app/routes.php
  24. 2
    2
      app/views/global/view-three-year-plan.blade.php
  25. 60
    45
      app/views/local/managers/admins/new_assessment_report.blade.php
  26. 1
    1
      app/views/local/managers/admins/objectives.blade.php
  27. 1
    1
      app/views/local/managers/pCoords/_navigation.blade.php
  28. 52
    43
      app/views/local/managers/pCoords/new_assessment_report.blade.php
  29. 1
    1
      app/views/local/managers/pCoords/objectives.blade.php
  30. 1
    1
      app/views/local/managers/sCoords/_navigation.blade.php
  31. 54
    41
      app/views/local/managers/sCoords/new_assessment_report.blade.php
  32. 3
    3
      app/views/local/managers/sCoords/objectives.blade.php
  33. 818
    560
      app/views/local/managers/shared/annual-plans.blade.php
  34. 18
    7
      app/views/local/managers/shared/annual_report.blade.php
  35. 22
    17
      app/views/local/managers/shared/rubric_list.blade.php
  36. 53
    45
      app/views/local/professors/_navigation.blade.php
  37. 2
    2
      app/views/local/professors/assessment.blade.php
  38. 73
    9
      app/views/local/professors/compare_activities.blade.php
  39. 55
    44
      app/views/local/professors/new_assessment_report.blade.php

+ 1
- 1
app/controllers/ActivitiesController.php 查看文件

@@ -1002,4 +1002,4 @@ class ActivitiesController extends \BaseController
1002 1002
 
1003 1003
         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'));
1004 1004
     }
1005
-}
1005
+}

+ 109
- 11
app/controllers/AnnualPlansController.php 查看文件

@@ -42,8 +42,10 @@ class AnnualPlansController extends \BaseController
42 42
 
43 43
   public function viewAllPlans($program_id)
44 44
   {
45
-    $title = "Annual Plans";
46
-    $annual_plans = DB::select("select semester_start, semester_end, program_id, annual_plans.id, academic_year from annual_plans, annual_cycle   where annual_plans.annual_cycle_id = annual_cycle.id and program_id ={$program_id} order by id desc");
45
+    $program = Program::find($program_id);
46
+    $title = "Annual Plans for " . $program->name;
47
+
48
+    $annual_plans = DB::select("select semester_start, semester_end, program_id, annual_plans.id, academic_year from annual_plans, annual_cycle   where annual_plans.annual_cycle_id = annual_cycle.id and program_id ={$program_id} order by semester_start desc");
47 49
 
48 50
 
49 51
     return View::make('local.managers.shared.view-annual-plans', compact('title', 'program_id', 'annual_plans'));
@@ -132,7 +134,8 @@ class AnnualPlansController extends \BaseController
132 134
 
133 135
   public function showPlan($program_id, $typ_id = null)
134 136
   {
135
-    $title = "Annual Plans";
137
+    $program = Program::find($program_id);
138
+    $title = "Annual Plans for " . $program->name;
136 139
     //$typ_parts = DB::select("select * from typ_parts");
137 140
 
138 141
     //     $current_typ = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'))[0];
@@ -145,7 +148,7 @@ class AnnualPlansController extends \BaseController
145 148
     }
146 149
 
147 150
 
148
-    $program = Program::where('id', '=', $program_id)->first();
151
+    //$program = Program::where('id', '=', $program_id)->first();
149 152
 
150 153
     //Dame los annual plans que esten dentro del three year plan
151 154
 
@@ -153,7 +156,7 @@ class AnnualPlansController extends \BaseController
153 156
     $annual_plans = DB::table('annual_cycle')
154 157
       ->join('annual_plans', 'annual_cycle_id', '=', 'annual_cycle.id')
155 158
       ->where('program_id', $program_id)
156
-      ->orderBy('semester_start')
159
+      ->orderBy('semester_start', 'desc')
157 160
       ->get();
158 161
     /*$annual_plans = DB::select("
159 162
     
@@ -193,6 +196,7 @@ class AnnualPlansController extends \BaseController
193 196
     }*/
194 197
     //$alltyp = DB::select('select * from three_year_plan order by id desc');
195 198
     //$current_typ = $current_typ->id;
199
+
196 200
     return View::make('local.managers.shared.annual-plans', compact('title', 'annual_plans', 'current_typ', 'program', 'outcomes', 'allSemesterOrder', 'alltyp'));
197 201
   }
198 202
 
@@ -211,7 +215,10 @@ class AnnualPlansController extends \BaseController
211 215
 
212 216
 
213 217
       ->where('program_id', $an_plan->program_id)
214
-      ->where('semester_id', $an_plan->semester_start)
218
+      ->where(function ($query) use (&$an_plan) {
219
+        $query->where('semester_id', $an_plan->semester_start)
220
+          ->orWhere('semester_id', $an_plan->semester_end);
221
+      })
215 222
       ->select('typ_program.*')
216 223
       ->first();
217 224
     Log::info(array($an_plan));
@@ -222,9 +229,27 @@ class AnnualPlansController extends \BaseController
222 229
 
223 230
     $json_to_send = [];
224 231
     $json_to_send["annual_plans"] = $an_plan;
225
-    $json_to_send["outcomes"]["first"] = DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id = {$an_plan->semester_start} and typ_program_id = {$current_typ_program->id})");
232
+
233
+    $json_to_send["outcomes"]["first"] = DB::table('outcomes')
234
+      ->join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
235
+      ->where('semester_id', $an_plan->semester_start)
236
+      ->where('typ_program_id', $current_typ_program->id)
237
+      ->select('outcomes.*', 'typ_semester_outcome.id as typ_semester_outcome_id')
238
+      ->get();
239
+
240
+    //DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id = {$an_plan->semester_start} and typ_program_id = {$current_typ_program->id})");
226 241
     $json_to_send["allSemesterOrder"]["first"] = DB::select("select * from semesters where id = {$an_plan->semester_start}")[0];
227
-    $json_to_send["outcomes"]["second"] = DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id ={$an_plan->semester_end} and typ_program_id  = {$current_typ_program->id})");
242
+    $json_to_send["outcomes"]["second"] = DB::table('outcomes')
243
+      ->join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
244
+      ->where('semester_id', $an_plan->semester_end)
245
+      ->where('typ_program_id', $current_typ_program->id)
246
+      ->select('outcomes.*', 'typ_semester_outcome.id as typ_semester_outcome_id')
247
+      ->get();
248
+
249
+    //DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id ={$an_plan->semester_end} and typ_program_id  = {$current_typ_program->id})");
250
+
251
+
252
+
228 253
     $json_to_send["allSemesterOrder"]["second"] = DB::select("select * from semesters where id = {$an_plan->semester_end}")[0];
229 254
     return json_encode($json_to_send);
230 255
   }
@@ -241,7 +266,7 @@ class AnnualPlansController extends \BaseController
241 266
     $typ_info = array();
242 267
     $semester = DB::select("select * from semesters where id=?", array(Input::get('semester')))[0];
243 268
 
244
-
269
+    $typ_semester_outcome_id = Input::get('typ_semester_outcome_id');
245 270
     //$typ_info['courses'] = DB::select("select * from courses where id in (select course_id from typ_semester_courses where typ_semester_outcome_id in (select id from typ_semester_outcome where semester_id ={$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id} )and outcome_id = ?))", array(Input::get('id')));
246 271
     //foreach ($typ_info['courses'] as $course) {
247 272
     //  $typ_info['courses_objective'][$course->id] = DB::select("select * from objectives where id in (select objective_id from typ_semester_objectives where typ_semester_course_id in (select id from typ_semester_courses where typ_semester_outcome_id in (select id from typ_semester_outcome where semester_id = {$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id}))and course_id ={$course->id}))");
@@ -256,7 +281,28 @@ class AnnualPlansController extends \BaseController
256 281
     //  $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where id in (select criterion_id from criterion_objective_outcome where outcome_id = ? and objective_id = {$objective->id})", array(Input::get('id')));
257 282
     //}
258 283
     $annual_plan = DB::select("select annual_plans.id from annual_plans, annual_cycle where annual_plans.annual_cycle_id = annual_cycle.id and (semester_start = {$semester->id} or semester_end ={$semester->id}) and program_id ={$program_id}")[0];
259
-    $typ_info['expected_target'] = DB::select("select * from target_outcomes_program where program_id = {$program_id} and semester_id = {$semester->id}");
284
+    //$typ_info['expected_target'] = DB::select("select * from target_outcomes_program where program_id = {$program_id} and semester_id = {$semester->id}");
285
+    $typ_info['expected_target'] = DB::table('target_outcomes_program')
286
+      ->where('program_id', $program_id)
287
+      ->where('semester_id', $semester->id)
288
+      ->first();
289
+    if (!$typ_info['expected_target']) {
290
+      DB::beginTransaction();
291
+
292
+      DB::table('target_outcomes_program')->insert(
293
+        array(
294
+          'program_id' => $program_id,
295
+          'semester_id' => $semester->id,
296
+          'expected_target' => 70.00
297
+        )
298
+      );
299
+      DB::commit();
300
+      $typ_info['expected_target'] = DB::table('target_outcomes_program')
301
+        ->where('program_id', $program_id)
302
+        ->where('semester_id', $semester->id)
303
+        ->first();
304
+    }
305
+
260 306
     $typ_info['objectives'] = DB::select("select * from objectives where id in (select objective_id from typ_semester_objectives where typ_semester_outcome_id in(select id from typ_semester_outcome where outcome_id = ? and semester_id = {$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id})))", array(Input::get('id')));
261 307
     $typ_info['transformative_actions'] = DB::select("select * from transformative_actions where by_professor =0 and is_custom=0");
262 308
     foreach ($typ_info['objectives'] as $objective) {
@@ -297,6 +343,21 @@ class AnnualPlansController extends \BaseController
297 343
     $typ_info['annual_plan'] = $annual_plan;
298 344
     Log::info($typ_info);
299 345
 
346
+    $typ_info['transformative_actions_for_outcome'] = DB::table('transformative_actions')
347
+      ->join('transformative_typ_outcome', 'transformative_typ_outcome.trans_id', '=', 'transformative_actions.id')
348
+      ->where('transformative_typ_outcome.typ_semester_outcome_id', $typ_semester_outcome_id)
349
+      ->get();
350
+    $typ_info['categories'] = "<option value='0'>Nothing Selected</option>";
351
+
352
+    $types = DB::table('transformative_actions')
353
+      ->select('type_of_TA')
354
+      ->where('type_of_TA', '<>', '')
355
+      ->distinct()
356
+      ->get();
357
+    foreach ($types as $type) {
358
+      $typ_info['categories'] .= "<option value = '" . $type->type_of_TA . "'>" . $type->type_of_TA . "</option>";
359
+    }
360
+    $typ_info['categories'] .= '<option value ="new"> New Type of Transformative Action</option>';
300 361
     return json_encode($typ_info);
301 362
   }
302 363
   public function deleteTA()
@@ -615,7 +676,7 @@ class AnnualPlansController extends \BaseController
615 676
     $outcome->outcome_program_goal = DB::table('target_outcomes_program')
616 677
       ->where('program_id', $program_id)
617 678
       ->where('semester_id', $semester_id)
618
-      ->first()->expected_target;
679
+      ->first();
619 680
 
620 681
     foreach ($outcome->objectives as $index => $objective) {
621 682
       $objective->courses = Objective::getPlanReport($objective);
@@ -623,4 +684,41 @@ class AnnualPlansController extends \BaseController
623 684
 
624 685
     return $outcome;
625 686
   }
687
+
688
+  public function fetchObjectiveInfo()
689
+  {
690
+    $typ_objective_id = Input::get('typ_objective_id');
691
+    $courses = DB::table('typ_semester_courses')
692
+      ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
693
+
694
+      ->select('courses.code', 'courses.number', 'courses.name', 'typ_semester_courses.id as typ_semester_course_id')
695
+      ->where('typ_semester_objective_id', $typ_objective_id)
696
+      ->distinct()
697
+      ->get();
698
+    foreach ($courses as $course) {
699
+      /*$course->criteria_scale = DB::table('annual_plan_objective')
700
+        ->join('criteria', 'criteria.id', '=', 'annual_plan_objective.criteria_id')
701
+        ->join('criterion_scale', 'criterion_scale.criterion_id', '=', 'criteria.id')
702
+        ->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
703
+        ->select('criterion_scale.*', 'scales.*')
704
+        ->where('typ_semester_course_id', $course->typ_semester_course_id)
705
+        ->orderBy('position', 'ASC')
706
+        ->get();*/
707
+      $course->criteria = DB::table('annual_plan_objective')
708
+        ->join('criteria', 'criteria.id', '=', 'annual_plan_objective.criteria_id')
709
+        ->where('typ_semester_course_id', $course->typ_semester_course_id)
710
+        ->select('criteria.*')
711
+        ->get();
712
+      foreach ($course->criteria as $criterion) {
713
+        $criterion->scales = DB::table('criteria')
714
+          ->join('criterion_scale', 'criterion_scale.criterion_id', '=', 'criteria.id')
715
+          ->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
716
+          ->select('criterion_scale.*', 'scales.*')
717
+          ->where('criteria.id', $criterion->id)
718
+          ->orderBy('position', 'ASC')
719
+          ->get();
720
+      }
721
+    }
722
+    return $courses;
723
+  }
626 724
 }

+ 1
- 1
app/controllers/CoursesController.php 查看文件

@@ -535,4 +535,4 @@ CoursesController extends \BaseController
535 535
         } else {
536 536
         }
537 537
     }
538
-}
538
+}

+ 1
- 1
app/controllers/CriteriaController.php 查看文件

@@ -1073,4 +1073,4 @@ class CriteriaController extends \BaseController
1073 1073
                 break;
1074 1074
         }
1075 1075
     }
1076
-}
1076
+}

+ 4
- 0
app/controllers/Objective2Controller.php 查看文件

@@ -129,7 +129,11 @@ class Objective2Controller extends \BaseController
129 129
 		$program_id = Input::get('program_fetch');
130 130
 		$outcome_id = Input::get('outcome_fetch');
131 131
 		$json = array();
132
+
133
+
132 134
 		$json['objective'] = DB::select("SELECT * FROM `objectives` where id in (select objective_id from objective_outcome where outcome_id ={$outcome_id}) and id in (select objective_id from objective_program where program_id = {$program_id})");
135
+		Log::info('En mi sueño');
136
+		Log::info($json);
133 137
 		return json_encode($json);
134 138
 	}
135 139
 	public function delete()

+ 5
- 15
app/controllers/OutcomesController.php 查看文件

@@ -1053,10 +1053,10 @@ class OutcomesController extends \BaseController
1053 1053
 
1054 1054
     public function annualReport($program_id)
1055 1055
     {
1056
-        $title = "Program Courses Report";
1056
+        $title = "Program Annual Report";
1057 1057
 
1058 1058
 
1059
-        $annual_plans = $annual_plans = DB::select("
1059
+        $annual_plans = DB::select("
1060 1060
     
1061 1061
         select 
1062 1062
           academic_year, 
@@ -1067,19 +1067,9 @@ class OutcomesController extends \BaseController
1067 1067
           annual_cycle.*
1068 1068
         from annual_plans 
1069 1069
         join annual_cycle on annual_cycle_id = annual_cycle.id 
1070
-        where program_id = 110 
1071
-        and(
1072
-          semester_start in(
1073
-            select semester_id 
1074
-            from typ_semester_outcome 
1075
-            join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
1076
-            where program_id = {$program_id} )
1077
-          or semester_end in(
1078
-            select semester_id 
1079
-            from typ_semester_outcome 
1080
-            join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
1081
-            where program_id = {$program_id} )
1082
-          )
1070
+        where program_id = {$program_id} 
1071
+        and
1072
+        annual_plans.is_submitted =1
1083 1073
           order by semester_start desc");
1084 1074
         $program = DB::table('programs')
1085 1075
             ->where('id', $program_id)

+ 12
- 12
app/controllers/ProfessorsController.php 查看文件

@@ -23,7 +23,7 @@ class ProfessorsController extends \BaseController
23 23
             ->orderBy('name', 'ASC')->get();
24 24
         $outcomeCount = count($outcomes);
25 25
 
26
-Log::info($grouped_courses);
26
+        Log::info($grouped_courses);
27 27
         $grouped_outcomes_achieved_results = array();
28 28
         $grouped_outcomes_attempted_results = array();
29 29
         $grouped_sections = array();
@@ -39,15 +39,15 @@ Log::info($grouped_courses);
39 39
 
40 40
             // Find sections belonging to user with identifier of one course
41 41
             $sections = Course::with('program')
42
-            	->where('user_id', Auth::user()->id)
42
+                ->where('user_id', Auth::user()->id)
43 43
                 ->where('code', $grouped_course->code)
44 44
                 ->whereIn('semester_id', Session::get('semesters_ids'))
45 45
                 ->where('number', $grouped_course->number)
46 46
                 ->where('semester_id', $grouped_course->semester_id)
47 47
                 ->get();
48 48
 
49
-// 			        Log::info($sections);
50
-			        
49
+            // 			        Log::info($sections);
50
+
51 51
             // For each of the professor's course sections, add the attempted and achieved criteria per outcome
52 52
             foreach ($sections as $section) {
53 53
 
@@ -97,15 +97,15 @@ Log::info($grouped_courses);
97 97
         $program_courses = Course::where('program_id', '=', $program->id)->whereIn('semester_id', Session::get('semesters_ids'))->get();
98 98
         $semesters = Session::get('semesters_ids');
99 99
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
100
-        $semesters2 = Semester::whereIn('id',Session::get('semesters_ids'))->get();
100
+        $semesters2 = Semester::whereIn('id', Session::get('semesters_ids'))->get();
101 101
 
102
-//         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
103
-//         	->where('level','=',)
104
-//             ->whereNull('deleted_at')
105
-//             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
106
-//             ->orderBy('name', 'ASC')->get();
102
+        //         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
103
+        //         	->where('level','=',)
104
+        //             ->whereNull('deleted_at')
105
+        //             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
106
+        //             ->orderBy('name', 'ASC')->get();
107 107
         $outcomes = Outcome::active_by_semesters($semesters2, $program->is_graduate);
108
-	    $outcomeCount = count($outcomes);
108
+        $outcomeCount = count($outcomes);
109 109
         $outcomes_achieved = [];
110 110
         $outcomes_attempted = [];
111 111
 
@@ -169,4 +169,4 @@ Log::info($grouped_courses);
169 169
 
170 170
         return View::make('local.managers.shared.general_studies_overview', compact('title', 'outcomes', 'schools', 'program_packs'));
171 171
     }
172
-}
172
+}

+ 1
- 1
app/controllers/ProgramsController.php 查看文件

@@ -552,4 +552,4 @@ class ProgramsController extends \BaseController
552 552
     //Log::info('id:' . Input::get('id'));
553 553
     return School::find(Input::get('id'))->programs;
554 554
   }
555
-}
555
+}

+ 6
- 6
app/controllers/RubricsController.php 查看文件

@@ -33,8 +33,8 @@ class RubricsController extends \BaseController
33 33
         $outcomes = Outcome::orderBy('name', 'ASC')->get();
34 34
         $criteria = Criterion::orderBy('name', 'ASC')->get();
35 35
         $rubric = $activity->rubric;
36
-//         $draft=$activity->draft;
37
-//         Log::info("*****".$activity);
36
+        //         $draft=$activity->draft;
37
+        //         Log::info("*****".$activity);
38 38
 
39 39
 
40 40
 
@@ -319,15 +319,15 @@ class RubricsController extends \BaseController
319 319
     {
320 320
         $activity = Activity::find($activity_id);
321 321
         // Get activity's course
322
-//         Log::info("actv".$activity);
322
+        //         Log::info("actv".$activity);
323 323
         $course = Course::where('id', '=', $activity->course_id)->firstOrFail();
324
-//         Log::info("user".$course->user_id);
324
+        //         Log::info("user".$course->user_id);
325 325
 
326 326
         // If activity does not belong to the requesting user, display 403
327 327
         if ($course->user_id != Auth::id())
328 328
             App::abort('403', 'Access Forbidden');
329
-//         Log::info("rubric".$activity->rubric);
330
-// exit();
329
+        //         Log::info("rubric".$activity->rubric);
330
+        // exit();
331 331
         $rubric = Rubric::where('id', '=', $activity->rubric[0]->id)->firstOrFail();
332 332
         $rubric_criterion = DB::table('criteria')
333 333
             ->join('rubric_criterion', 'rubric_criterion.criterion_id', '=', 'criteria.id')

+ 208
- 225
app/controllers/SchoolCoordinatorsController.php 查看文件

@@ -5,7 +5,7 @@ class SchoolCoordinatorsController extends \BaseController
5 5
 
6 6
     private function participatingPrograms($school)
7 7
     {
8
-         return DB::table('programs')
8
+        return DB::table('programs')
9 9
             ->join('courses', 'courses.program_id', '=', 'programs.id')
10 10
             ->join('activities', 'activities.course_id', '=', 'courses.id')
11 11
             ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
@@ -16,27 +16,27 @@ class SchoolCoordinatorsController extends \BaseController
16 16
             ->whereIn('semester_id', Session::get('semesters_ids'))
17 17
             ->lists('id');
18 18
 
19
-//        return DB::table('programs')
20
-//             ->join('courses', 'courses.program_id', '=', 'programs.id')
21
-//             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
22
-//             ->addSelect('courses.semester_id')
23
-//             ->where('school_id', $school->id)
24
-//             ->whereIn('semester_id', Session::get('semesters_ids'))
25
-//             ->lists('id');
19
+        //        return DB::table('programs')
20
+        //             ->join('courses', 'courses.program_id', '=', 'programs.id')
21
+        //             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
22
+        //             ->addSelect('courses.semester_id')
23
+        //             ->where('school_id', $school->id)
24
+        //             ->whereIn('semester_id', Session::get('semesters_ids'))
25
+        //             ->lists('id');
26 26
     }
27 27
 
28 28
     public function overview()
29 29
     {
30 30
         ini_set('memory_limit', '256M');
31 31
         DB::connection()->disableQueryLog();
32
-//         $school = School::find($id);
32
+        //         $school = School::find($id);
33 33
         $school = Auth::user()->school;
34 34
         $id = $school->id;
35 35
 
36 36
         $title = $school->name;
37 37
         $schools = School::all();
38 38
 
39
-        $semesters = Semester::whereIn('id',Session::get('semesters_ids'))->get();
39
+        $semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
40 40
 
41 41
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
42 42
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
@@ -92,31 +92,25 @@ class SchoolCoordinatorsController extends \BaseController
92 92
             ->orderBy('courses.semester_id')
93 93
             ->get();
94 94
 
95
-		foreach($undergrad_grouped_courses as $key=>$courses)
96
-		{
97
-			$undergrad_grouped_courses[$key]->outcomes_attempted=NULL;	
98
-			$coursesT=Course::where('courses.code',$courses->code)->where('courses.number',$courses->number)->where('courses.semester_id',$courses->semester_id)->get();
99
-			foreach($coursesT as $course)
100
-    		{
101
-				if($course->isAssessed())
102
-				{
103
-					$undergrad_grouped_courses[$key]->outcomes_attempted=true;
104
-				}
105
-			}
106
-    	}
107
-
108
-		foreach($grad_grouped_courses as $key=>$courses)
109
-		{
110
-			$grad_grouped_courses[$key]->outcomes_attempted=NULL;	
111
-			$coursesT=Course::where('courses.code',$courses->code)->where('courses.number',$courses->number)->where('courses.semester_id',$courses->semester_id)->get();
112
-			foreach($coursesT as $course)
113
-    		{
114
-				if($course->isAssessed())
115
-				{
116
-					$grad_grouped_courses[$key]->outcomes_attempted=true;
117
-				}
118
-			}
119
-    	}
95
+        foreach ($undergrad_grouped_courses as $key => $courses) {
96
+            $undergrad_grouped_courses[$key]->outcomes_attempted = NULL;
97
+            $coursesT = Course::where('courses.code', $courses->code)->where('courses.number', $courses->number)->where('courses.semester_id', $courses->semester_id)->get();
98
+            foreach ($coursesT as $course) {
99
+                if ($course->isAssessed()) {
100
+                    $undergrad_grouped_courses[$key]->outcomes_attempted = true;
101
+                }
102
+            }
103
+        }
104
+
105
+        foreach ($grad_grouped_courses as $key => $courses) {
106
+            $grad_grouped_courses[$key]->outcomes_attempted = NULL;
107
+            $coursesT = Course::where('courses.code', $courses->code)->where('courses.number', $courses->number)->where('courses.semester_id', $courses->semester_id)->get();
108
+            foreach ($coursesT as $course) {
109
+                if ($course->isAssessed()) {
110
+                    $grad_grouped_courses[$key]->outcomes_attempted = true;
111
+                }
112
+            }
113
+        }
120 114
 
121 115
         // Fetch programs with participation
122 116
         $participating_programs = $this->participatingPrograms($school);
@@ -135,14 +129,13 @@ class SchoolCoordinatorsController extends \BaseController
135 129
         foreach ($school->programs as $program) {
136 130
             foreach ($program->courses as $course) {
137 131
 
138
-	            if (!$course->program->is_graduate){
139
-    	            $undergrad_school_sections_count += 1;
140
-    	        	if($course->isAssessed())$undergrad_assessed_sections_count += 1;
141
-    	        }
142
-        	    else {
143
-            	    $grad_school_sections_count += 1;
144
-            		if($course->isAssessed())$grad_assessed_sections_count += 1;
145
-           		}
132
+                if (!$course->program->is_graduate) {
133
+                    $undergrad_school_sections_count += 1;
134
+                    if ($course->isAssessed()) $undergrad_assessed_sections_count += 1;
135
+                } else {
136
+                    $grad_school_sections_count += 1;
137
+                    if ($course->isAssessed()) $grad_assessed_sections_count += 1;
138
+                }
146 139
             }
147 140
         }
148 141
 
@@ -152,37 +145,33 @@ class SchoolCoordinatorsController extends \BaseController
152 145
 
153 146
         // For each outcome 
154 147
         foreach ($outcomes_undergrad as $outcome) {
155
-//         	$attempted_outcomes_per_undergrad_program[$outcome->id]=0;
156
-//         	$achieved_outcomes_per_undergrad_program[$outcome->id]=0;
157
-        	$attemptedUndergradProgramsPerOutcome[$outcome->id]=0;
158
-        	$achievedUndergradProgramsPerOutcome[$outcome->id]=0;
159
-        	$programs_attempted_in_school[$outcome->id]=$outcome->programs_attempted_in_school($semesters, $school->id);
160
-//         	var_dump($programs_attempted_in_school);exit();
161
-        	foreach($programs_attempted_in_school[$outcome->id] as $program_id)
162
-        	{
163
-//         		var_dump($program_id->id);exit();
164
-				$program = DB::table('programs')->where('id', '=', $program_id->id)->first();
165
-
166
-        		if(!$program->is_graduate)
167
-        		{
168
-        			$attemptedUndergradProgramsPerOutcome[$outcome->id]++;
169
-        			$programC=Program::where('id', '=', $program_id->id)->first();
170
-//         			var_dump($programC);exit();
171
-					if($programC->achieved_outcome($outcome->id,$semesters))
172
-					{
173
-						$achievedUndergradProgramsPerOutcome[$outcome->id]++;
174
-					}
175
-        		}
176
-        	}
177
- 			$undergrad_outcomes_attempted[$outcome->id]=$outcome->attempted_by_school($semesters, $school->id,0);
178
- 			$undergrad_outcomes_achieved[$outcome->id]=$outcome->achieved_by_school($semesters, $school->id,0);
179
- 			
148
+            //         	$attempted_outcomes_per_undergrad_program[$outcome->id]=0;
149
+            //         	$achieved_outcomes_per_undergrad_program[$outcome->id]=0;
150
+            $attemptedUndergradProgramsPerOutcome[$outcome->id] = 0;
151
+            $achievedUndergradProgramsPerOutcome[$outcome->id] = 0;
152
+            $programs_attempted_in_school[$outcome->id] = $outcome->programs_attempted_in_school($semesters, $school->id);
153
+            //         	var_dump($programs_attempted_in_school);exit();
154
+            foreach ($programs_attempted_in_school[$outcome->id] as $program_id) {
155
+                //         		var_dump($program_id->id);exit();
156
+                $program = DB::table('programs')->where('id', '=', $program_id->id)->first();
157
+
158
+                if (!$program->is_graduate) {
159
+                    $attemptedUndergradProgramsPerOutcome[$outcome->id]++;
160
+                    $programC = Program::where('id', '=', $program_id->id)->first();
161
+                    //         			var_dump($programC);exit();
162
+                    if ($programC->achieved_outcome($outcome->id, $semesters)) {
163
+                        $achievedUndergradProgramsPerOutcome[$outcome->id]++;
164
+                    }
165
+                }
166
+            }
167
+            $undergrad_outcomes_attempted[$outcome->id] = $outcome->attempted_by_school($semesters, $school->id, 0);
168
+            $undergrad_outcomes_achieved[$outcome->id] = $outcome->achieved_by_school($semesters, $school->id, 0);
169
+
180 170
             // For each program with courses that do assessment
181 171
             $programs_with_courses = Program::with(array('courses' => function ($query) {
182 172
                 //                 $query->whereNotNull('outcomes_attempted');
183 173
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
184 174
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
185
-
186 175
         }
187 176
 
188 177
         /**
@@ -191,43 +180,39 @@ class SchoolCoordinatorsController extends \BaseController
191 180
 
192 181
         // For each outcome 
193 182
         foreach ($outcomes_grad as $outcome) {
194
-//         	$attempted_outcomes_per_grad_program[$outcome->id]=0;
195
-        	$achieved_outcomes_per_grad_program[$outcome->id]=0;
196
-        	$attemptedGradProgramsPerOutcome[$outcome->id]=0;
197
-        	$achievedGradProgramsPerOutcome[$outcome->id]=0;
198
- 			$grad_outcomes_attempted[$outcome->id]=$outcome->attempted_by_school($semesters, $school->id,1);
199
- 			$grad_outcomes_achieved[$outcome->id]=$outcome->achieved_by_school($semesters, $school->id,1);
200
-           // For each program with courses that do assessment
201
-        	foreach($programs_attempted_in_school[$outcome->id] as $program_id)
202
-        	{
203
-//         		var_dump($program_id->id);exit();
204
-				$program = DB::table('programs')
205
-                        ->where('id', '=', $program_id->id)
206
-                        ->first();
207
-//         		$program=Program::where('id', $program_id->id);
208
-//         		var_dump($program);exit();
209
-        		if($program->is_graduate)
210
-        		{
211
-        			$attemptedGradProgramsPerOutcome[$outcome->id]++;
212
-        			$programC=Program::where('id', '=', $program_id->id)->first();
213
-//         			var_dump($programC);exit();
214
-					if($programC->achieved_outcome($outcome->id,$semesters))
215
-					{
216
-						$achievedGradProgramsPerOutcome[$outcome->id]++;
217
-					}
218
-        		}
219
-        	}
183
+            //         	$attempted_outcomes_per_grad_program[$outcome->id]=0;
184
+            $achieved_outcomes_per_grad_program[$outcome->id] = 0;
185
+            $attemptedGradProgramsPerOutcome[$outcome->id] = 0;
186
+            $achievedGradProgramsPerOutcome[$outcome->id] = 0;
187
+            $grad_outcomes_attempted[$outcome->id] = $outcome->attempted_by_school($semesters, $school->id, 1);
188
+            $grad_outcomes_achieved[$outcome->id] = $outcome->achieved_by_school($semesters, $school->id, 1);
189
+            // For each program with courses that do assessment
190
+            foreach ($programs_attempted_in_school[$outcome->id] as $program_id) {
191
+                //         		var_dump($program_id->id);exit();
192
+                $program = DB::table('programs')
193
+                    ->where('id', '=', $program_id->id)
194
+                    ->first();
195
+                //         		$program=Program::where('id', $program_id->id);
196
+                //         		var_dump($program);exit();
197
+                if ($program->is_graduate) {
198
+                    $attemptedGradProgramsPerOutcome[$outcome->id]++;
199
+                    $programC = Program::where('id', '=', $program_id->id)->first();
200
+                    //         			var_dump($programC);exit();
201
+                    if ($programC->achieved_outcome($outcome->id, $semesters)) {
202
+                        $achievedGradProgramsPerOutcome[$outcome->id]++;
203
+                    }
204
+                }
205
+            }
220 206
             $programs_with_courses = Program::with(array('courses' => function ($query) {
221 207
                 //                 $query->whereNotNull('outcomes_attempted');
222 208
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
223 209
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
224
-
225 210
         }
226 211
         if ($school->id == 13) {
227
-//             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
212
+            //             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
228 213
             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
229 214
         } else {
230
-//             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
215
+            //             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
231 216
             return View::make('local.managers.shared.school', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
232 217
         }
233 218
     }
@@ -377,48 +362,47 @@ class SchoolCoordinatorsController extends \BaseController
377 362
 
378 363
         foreach ($school->programs as $program) {
379 364
             foreach ($program->courses as $course) {
380
-                        if (!$course->program->is_graduate){
381
-                $undergrad_school_sections_count += 1;
382
-            	if($course->isAssessed())$undergrad_assessed_sections_count += 1;
383
-//             	            Log::info("aqui".$course);
365
+                if (!$course->program->is_graduate) {
366
+                    $undergrad_school_sections_count += 1;
367
+                    if ($course->isAssessed()) $undergrad_assessed_sections_count += 1;
368
+                    //             	            Log::info("aqui".$course);
384 369
 
385
-            }
386
-            else {
387
-                $grad_school_sections_count += 1;
388
-            	if($course->isAssessed())$grad_assessed_sections_count += 1;
389
-//             	            	            Log::info("aqui".$course);
370
+                } else {
371
+                    $grad_school_sections_count += 1;
372
+                    if ($course->isAssessed()) $grad_assessed_sections_count += 1;
373
+                    //             	            	            Log::info("aqui".$course);
390 374
 
391
-            }
392
-// 
393
-//                 if (!$course->program->is_graduate) {
394
-//                     if ($course_outcomes_achieved = $course->outcomes_ach()) {
395
-//                         //$course_outcomes_achieved = $course->outcomes_ach();
396
-//                         $course_outcomes_attempted = $course->outcomes_att();
397
-//                         foreach ($course_outcomes_attempted as $i => $score) {
398
-// 
399
-//                             $undergrad_outcomes_attempted[$i] += $score;
400
-//                         }
401
-//                         foreach ($course_outcomes_achieved as $i => $score) {
402
-//                             $undergrad_outcomes_achieved[$i] += $score;
403
-//                         }
404
-//                         $undergrad_assessed_sections_count += 1;
405
-//                     }
406
-//                     $undergrad_school_sections_count += 1;
407
-//                 } else {
408
-//                     if ($course_outcomes_achieved = $course->outcomes_ach()) {
409
-//                         //$course_outcomes_achieved = $course->outcomes_ach();
410
-//                         $course_outcomes_attempted = $course->outcomes_att();
411
-//                         foreach ($course_outcomes_attempted as $i => $score) {
412
-// 
413
-//                             $grad_outcomes_attempted[$i] += $score;
414
-//                         }
415
-//                         foreach ($course_outcomes_achieved as $i => $score) {
416
-//                             $grad_outcomes_achieved[$i] += $score;
417
-//                         }
418
-//                         $grad_assessed_sections_count += 1;
419
-//                     }
420
-//                     $grad_school_sections_count += 1;
421
-//                 }
375
+                }
376
+                // 
377
+                //                 if (!$course->program->is_graduate) {
378
+                //                     if ($course_outcomes_achieved = $course->outcomes_ach()) {
379
+                //                         //$course_outcomes_achieved = $course->outcomes_ach();
380
+                //                         $course_outcomes_attempted = $course->outcomes_att();
381
+                //                         foreach ($course_outcomes_attempted as $i => $score) {
382
+                // 
383
+                //                             $undergrad_outcomes_attempted[$i] += $score;
384
+                //                         }
385
+                //                         foreach ($course_outcomes_achieved as $i => $score) {
386
+                //                             $undergrad_outcomes_achieved[$i] += $score;
387
+                //                         }
388
+                //                         $undergrad_assessed_sections_count += 1;
389
+                //                     }
390
+                //                     $undergrad_school_sections_count += 1;
391
+                //                 } else {
392
+                //                     if ($course_outcomes_achieved = $course->outcomes_ach()) {
393
+                //                         //$course_outcomes_achieved = $course->outcomes_ach();
394
+                //                         $course_outcomes_attempted = $course->outcomes_att();
395
+                //                         foreach ($course_outcomes_attempted as $i => $score) {
396
+                // 
397
+                //                             $grad_outcomes_attempted[$i] += $score;
398
+                //                         }
399
+                //                         foreach ($course_outcomes_achieved as $i => $score) {
400
+                //                             $grad_outcomes_achieved[$i] += $score;
401
+                //                         }
402
+                //                         $grad_assessed_sections_count += 1;
403
+                //                     }
404
+                //                     $grad_school_sections_count += 1;
405
+                //                 }
422 406
             }
423 407
         }
424 408
 
@@ -433,16 +417,16 @@ class SchoolCoordinatorsController extends \BaseController
433 417
         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
434 418
 
435 419
         // Fetch programs with participation for the school
436
-        
437
-//         $participating_undergrad_programs = DB::table('programs')
438
-//             ->join('courses', 'courses.program_id', '=', 'programs.id')
439
-//             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
440
-//             ->addSelect('courses.semester_id')
441
-//             ->whereIn('semester_id', Session::get('semesters_ids'))
442
-//             ->where('is_graduate', 0)
443
-//             ->where('school_id', $school->id)
444
-//             ->groupBy('id')
445
-//             ->get();
420
+
421
+        //         $participating_undergrad_programs = DB::table('programs')
422
+        //             ->join('courses', 'courses.program_id', '=', 'programs.id')
423
+        //             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
424
+        //             ->addSelect('courses.semester_id')
425
+        //             ->whereIn('semester_id', Session::get('semesters_ids'))
426
+        //             ->where('is_graduate', 0)
427
+        //             ->where('school_id', $school->id)
428
+        //             ->groupBy('id')
429
+        //             ->get();
446 430
 
447 431
         $output = array();
448 432
 
@@ -463,43 +447,43 @@ class SchoolCoordinatorsController extends \BaseController
463 447
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
464 448
 
465 449
             foreach ($programs_with_courses as $program) {
466
-              if(in_array($program->id,$participating_programs)){
467
-               // To acummulate all criteria for one program
468
-                $achieved_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
469
-                $attempted_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
470
-
471
-                //Flag for counting programs
472
-                $flag = false;
473
-
474
-                // For each course in the program
475
-                foreach ($program->courses as $course) {
476
-                    // If the outcome in question is being evaluated
477
-                    $course_outcomes_attempted2 = $course->outcomes_att(); //json_decode($course->outcomes_attempted, true);
478
-                    $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
479
-                    if (
480
-                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
481
-                        && $course_outcomes_attempted2[$outcome->id] > 0
482
-                    ) {
483
-                        $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
484
-                        $attempted_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
485
-
486
-                        // Add one to the programs assessing, if it wasn't added before
487
-                        if (!$flag) {
488
-                            $attemptedUndergradProgramsPerOutcome[$outcome->id] += 1;
489
-                            $flag = true;
450
+                if (in_array($program->id, $participating_programs)) {
451
+                    // To acummulate all criteria for one program
452
+                    $achieved_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
453
+                    $attempted_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
454
+
455
+                    //Flag for counting programs
456
+                    $flag = false;
457
+
458
+                    // For each course in the program
459
+                    foreach ($program->courses as $course) {
460
+                        // If the outcome in question is being evaluated
461
+                        $course_outcomes_attempted2 = $course->outcomes_att(); //json_decode($course->outcomes_attempted, true);
462
+                        $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
463
+                        if (
464
+                            array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
465
+                            && $course_outcomes_attempted2[$outcome->id] > 0
466
+                        ) {
467
+                            $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
468
+                            $attempted_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
469
+
470
+                            // Add one to the programs assessing, if it wasn't added before
471
+                            if (!$flag) {
472
+                                $attemptedUndergradProgramsPerOutcome[$outcome->id] += 1;
473
+                                $flag = true;
474
+                            }
490 475
                         }
491
-                    }
492 476
 
493
-                    // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_undergrad_program);
494
-                    // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
477
+                        // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_undergrad_program);
478
+                        // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
495 479
 
480
+                    }
481
+                    //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
482
+                    if ($attempted_outcomes_per_undergrad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_undergrad_program[$outcome->id] / $attempted_outcomes_per_undergrad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
483
+                        $achievedUndergradProgramsPerOutcome[$outcome->id] += 1;
484
+                        // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
485
+                    }
496 486
                 }
497
-                //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
498
-                if ($attempted_outcomes_per_undergrad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_undergrad_program[$outcome->id] / $attempted_outcomes_per_undergrad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
499
-                    $achievedUndergradProgramsPerOutcome[$outcome->id] += 1;
500
-                    // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
501
-                }
502
-            }
503 487
             }
504 488
         }
505 489
 
@@ -514,15 +498,15 @@ class SchoolCoordinatorsController extends \BaseController
514 498
         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
515 499
 
516 500
         // Fetch programs with participation for the school
517
-//         $participating_grad_programs = DB::table('programs')
518
-//             ->join('courses', 'courses.program_id', '=', 'programs.id')
519
-//             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
520
-//             ->addSelect('courses.semester_id')
521
-//             ->whereIn('semester_id', Session::get('semesters_ids'))
522
-//             ->where('is_graduate', 1)
523
-//             ->where('school_id', $school->id)
524
-//             ->groupBy('id')
525
-//             ->get();
501
+        //         $participating_grad_programs = DB::table('programs')
502
+        //             ->join('courses', 'courses.program_id', '=', 'programs.id')
503
+        //             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
504
+        //             ->addSelect('courses.semester_id')
505
+        //             ->whereIn('semester_id', Session::get('semesters_ids'))
506
+        //             ->where('is_graduate', 1)
507
+        //             ->where('school_id', $school->id)
508
+        //             ->groupBy('id')
509
+        //             ->get();
526 510
 
527 511
         $output = array();
528 512
 
@@ -543,47 +527,46 @@ class SchoolCoordinatorsController extends \BaseController
543 527
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
544 528
 
545 529
             foreach ($programs_with_courses as $program) {
546
-             if(in_array($program->id,$participating_programs)){
547
-                // To acummulate all criteria for one program
548
-                $achieved_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
549
-                $attempted_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
550
-
551
-                //Flag for counting programs
552
-                $flag = false;
553
-
554
-                // For each course in the program
555
-                foreach ($program->courses as $course) {
556
-                    // If the outcome in question is being evaluated
557
-                    $course_outcomes_attempted2 = $course->outcomes_att();  // json_decode($course->outcomes_attempted, true);
558
-                    $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
559
-                    if (
560
-                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
561
-                        && $course_outcomes_attempted2[$outcome->id] > 0
562
-                    ) {
563
-                        $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
564
-                        $attempted_outcomes_per_grad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
565
-
566
-                        // Add one to the programs assessing, if it wasn't added before
567
-                        if (!$flag) {
568
-                            $attemptedGradProgramsPerOutcome[$outcome->id] += 1;
569
-                            $flag = true;
530
+                if (in_array($program->id, $participating_programs)) {
531
+                    // To acummulate all criteria for one program
532
+                    $achieved_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
533
+                    $attempted_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
534
+
535
+                    //Flag for counting programs
536
+                    $flag = false;
537
+
538
+                    // For each course in the program
539
+                    foreach ($program->courses as $course) {
540
+                        // If the outcome in question is being evaluated
541
+                        $course_outcomes_attempted2 = $course->outcomes_att();  // json_decode($course->outcomes_attempted, true);
542
+                        $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
543
+                        if (
544
+                            array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
545
+                            && $course_outcomes_attempted2[$outcome->id] > 0
546
+                        ) {
547
+                            $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
548
+                            $attempted_outcomes_per_grad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
549
+
550
+                            // Add one to the programs assessing, if it wasn't added before
551
+                            if (!$flag) {
552
+                                $attemptedGradProgramsPerOutcome[$outcome->id] += 1;
553
+                                $flag = true;
554
+                            }
570 555
                         }
571
-                    }
572 556
 
573
-                    // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_grad_program);
574
-                    // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
557
+                        // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_grad_program);
558
+                        // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
575 559
 
576
-                }
577
-                //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
578
-                if ($attempted_outcomes_per_grad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_grad_program[$outcome->id] / $attempted_outcomes_per_grad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
579
-                    $achievedGradProgramsPerOutcome[$outcome->id] += 1;
580
-                    // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
560
+                    }
561
+                    //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
562
+                    if ($attempted_outcomes_per_grad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_grad_program[$outcome->id] / $attempted_outcomes_per_grad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
563
+                        $achievedGradProgramsPerOutcome[$outcome->id] += 1;
564
+                        // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
565
+                    }
581 566
                 }
582 567
             }
583
- }
584 568
         }
585
-//         return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
569
+        //         return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
586 570
         return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
587 571
     }
588
-
589 572
 }

+ 265
- 287
app/controllers/SchoolsController.php 查看文件

@@ -16,13 +16,13 @@ class SchoolsController extends \BaseController
16 16
             ->whereIn('semester_id', Session::get('semesters_ids'))
17 17
             ->lists('id');
18 18
 
19
-//         return DB::table('programs')
20
-//             ->join('courses', 'courses.program_id', '=', 'programs.id')
21
-//             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
22
-//             ->addSelect('courses.semester_id')
23
-//             ->where('school_id', $school->id)
24
-//             ->whereIn('semester_id', Session::get('semesters_ids'))
25
-//             ->lists('id');
19
+        //         return DB::table('programs')
20
+        //             ->join('courses', 'courses.program_id', '=', 'programs.id')
21
+        //             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
22
+        //             ->addSelect('courses.semester_id')
23
+        //             ->where('school_id', $school->id)
24
+        //             ->whereIn('semester_id', Session::get('semesters_ids'))
25
+        //             ->lists('id');
26 26
     }
27 27
 
28 28
     public function show($id)
@@ -33,7 +33,7 @@ class SchoolsController extends \BaseController
33 33
         $title = $school->name;
34 34
         $schools = School::all();
35 35
 
36
-        $semesters = Semester::whereIn('id',Session::get('semesters_ids'))->get();
36
+        $semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
37 37
 
38 38
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
39 39
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
@@ -88,32 +88,26 @@ class SchoolsController extends \BaseController
88 88
             ->orderBy('courses.number')
89 89
             ->orderBy('courses.semester_id')
90 90
             ->get();
91
-            
92
-		foreach($undergrad_grouped_courses as $key=>$courses)
93
-		{
94
-			$undergrad_grouped_courses[$key]->outcomes_attempted=NULL;	
95
-			$coursesT=Course::where('courses.code',$courses->code)->where('courses.number',$courses->number)->where('courses.semester_id',$courses->semester_id)->get();
96
-			foreach($coursesT as $course)
97
-    		{
98
-				if($course->isAssessed())
99
-				{
100
-					$undergrad_grouped_courses[$key]->outcomes_attempted=true;
101
-				}
102
-			}
103
-    	}
104
-
105
-		foreach($grad_grouped_courses as $key=>$courses)
106
-		{
107
-			$grad_grouped_courses[$key]->outcomes_attempted=NULL;	
108
-			$coursesT=Course::where('courses.code',$courses->code)->where('courses.number',$courses->number)->where('courses.semester_id',$courses->semester_id)->get();
109
-			foreach($coursesT as $course)
110
-    		{
111
-				if($course->isAssessed())
112
-				{
113
-					$grad_grouped_courses[$key]->outcomes_attempted=true;
114
-				}
115
-			}
116
-    	}
91
+
92
+        foreach ($undergrad_grouped_courses as $key => $courses) {
93
+            $undergrad_grouped_courses[$key]->outcomes_attempted = NULL;
94
+            $coursesT = Course::where('courses.code', $courses->code)->where('courses.number', $courses->number)->where('courses.semester_id', $courses->semester_id)->get();
95
+            foreach ($coursesT as $course) {
96
+                if ($course->isAssessed()) {
97
+                    $undergrad_grouped_courses[$key]->outcomes_attempted = true;
98
+                }
99
+            }
100
+        }
101
+
102
+        foreach ($grad_grouped_courses as $key => $courses) {
103
+            $grad_grouped_courses[$key]->outcomes_attempted = NULL;
104
+            $coursesT = Course::where('courses.code', $courses->code)->where('courses.number', $courses->number)->where('courses.semester_id', $courses->semester_id)->get();
105
+            foreach ($coursesT as $course) {
106
+                if ($course->isAssessed()) {
107
+                    $grad_grouped_courses[$key]->outcomes_attempted = true;
108
+                }
109
+            }
110
+        }
117 111
 
118 112
         // Fetch programs with participation
119 113
         $participating_programs = $this->participatingPrograms($school);
@@ -131,14 +125,13 @@ class SchoolsController extends \BaseController
131 125
         foreach ($school->programs as $program) {
132 126
             foreach ($program->courses as $course) {
133 127
 
134
-	            if (!$course->program->is_graduate){
135
-    	            $undergrad_school_sections_count += 1;
136
-    	        	if($course->isAssessed())$undergrad_assessed_sections_count += 1;
137
-    	        }
138
-        	    else {
139
-            	    $grad_school_sections_count += 1;
140
-            		if($course->isAssessed())$grad_assessed_sections_count += 1;
141
-           		}
128
+                if (!$course->program->is_graduate) {
129
+                    $undergrad_school_sections_count += 1;
130
+                    if ($course->isAssessed()) $undergrad_assessed_sections_count += 1;
131
+                } else {
132
+                    $grad_school_sections_count += 1;
133
+                    if ($course->isAssessed()) $grad_assessed_sections_count += 1;
134
+                }
142 135
             }
143 136
         }
144 137
 
@@ -148,37 +141,33 @@ class SchoolsController extends \BaseController
148 141
 
149 142
         // For each outcome 
150 143
         foreach ($outcomes_undergrad as $outcome) {
151
-//         	$attempted_outcomes_per_undergrad_program[$outcome->id]=0;
152
-//         	$achieved_outcomes_per_undergrad_program[$outcome->id]=0;
153
-        	$attemptedUndergradProgramsPerOutcome[$outcome->id]=0;
154
-        	$achievedUndergradProgramsPerOutcome[$outcome->id]=0;
155
-        	$programs_attempted_in_school[$outcome->id]=$outcome->programs_attempted_in_school($semesters, $school->id);
156
-//         	var_dump($programs_attempted_in_school);exit();
157
-        	foreach($programs_attempted_in_school[$outcome->id] as $program_id)
158
-        	{
159
-//         		var_dump($program_id->id);exit();
160
-				$program = DB::table('programs')->where('id', '=', $program_id->id)->first();
161
-
162
-        		if(!$program->is_graduate)
163
-        		{
164
-        			$attemptedUndergradProgramsPerOutcome[$outcome->id]++;
165
-        			$programC=Program::where('id', '=', $program_id->id)->first();
166
-//         			var_dump($programC);exit();
167
-					if($programC->achieved_outcome($outcome->id,$semesters))
168
-					{
169
-						$achievedUndergradProgramsPerOutcome[$outcome->id]++;
170
-					}
171
-        		}
172
-        	}
173
- 			$undergrad_outcomes_attempted[$outcome->id]=$outcome->attempted_by_school($semesters, $school->id,0);
174
- 			$undergrad_outcomes_achieved[$outcome->id]=$outcome->achieved_by_school($semesters, $school->id,0);
175
- 			
144
+            //         	$attempted_outcomes_per_undergrad_program[$outcome->id]=0;
145
+            //         	$achieved_outcomes_per_undergrad_program[$outcome->id]=0;
146
+            $attemptedUndergradProgramsPerOutcome[$outcome->id] = 0;
147
+            $achievedUndergradProgramsPerOutcome[$outcome->id] = 0;
148
+            $programs_attempted_in_school[$outcome->id] = $outcome->programs_attempted_in_school($semesters, $school->id);
149
+            //         	var_dump($programs_attempted_in_school);exit();
150
+            foreach ($programs_attempted_in_school[$outcome->id] as $program_id) {
151
+                //         		var_dump($program_id->id);exit();
152
+                $program = DB::table('programs')->where('id', '=', $program_id->id)->first();
153
+
154
+                if (!$program->is_graduate) {
155
+                    $attemptedUndergradProgramsPerOutcome[$outcome->id]++;
156
+                    $programC = Program::where('id', '=', $program_id->id)->first();
157
+                    //         			var_dump($programC);exit();
158
+                    if ($programC->achieved_outcome($outcome->id, $semesters)) {
159
+                        $achievedUndergradProgramsPerOutcome[$outcome->id]++;
160
+                    }
161
+                }
162
+            }
163
+            $undergrad_outcomes_attempted[$outcome->id] = $outcome->attempted_by_school($semesters, $school->id, 0);
164
+            $undergrad_outcomes_achieved[$outcome->id] = $outcome->achieved_by_school($semesters, $school->id, 0);
165
+
176 166
             // For each program with courses that do assessment
177 167
             $programs_with_courses = Program::with(array('courses' => function ($query) {
178 168
                 //                 $query->whereNotNull('outcomes_attempted');
179 169
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
180 170
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
181
-
182 171
         }
183 172
 
184 173
         /**
@@ -187,43 +176,39 @@ class SchoolsController extends \BaseController
187 176
 
188 177
         // For each outcome 
189 178
         foreach ($outcomes_grad as $outcome) {
190
-//         	$attempted_outcomes_per_grad_program[$outcome->id]=0;
191
-        	$achieved_outcomes_per_grad_program[$outcome->id]=0;
192
-        	$attemptedGradProgramsPerOutcome[$outcome->id]=0;
193
-        	$achievedGradProgramsPerOutcome[$outcome->id]=0;
194
- 			$grad_outcomes_attempted[$outcome->id]=$outcome->attempted_by_school($semesters, $school->id,1);
195
- 			$grad_outcomes_achieved[$outcome->id]=$outcome->achieved_by_school($semesters, $school->id,1);
196
-           // For each program with courses that do assessment
197
-        	foreach($programs_attempted_in_school[$outcome->id] as $program_id)
198
-        	{
199
-//         		var_dump($program_id->id);exit();
200
-				$program = DB::table('programs')
201
-                        ->where('id', '=', $program_id->id)
202
-                        ->first();
203
-//         		$program=Program::where('id', $program_id->id);
204
-//         		var_dump($program);exit();
205
-        		if($program->is_graduate)
206
-        		{
207
-        			$attemptedGradProgramsPerOutcome[$outcome->id]++;
208
-        			$programC=Program::where('id', '=', $program_id->id)->first();
209
-//         			var_dump($programC);exit();
210
-					if($programC->achieved_outcome($outcome->id,$semesters))
211
-					{
212
-						$achievedGradProgramsPerOutcome[$outcome->id]++;
213
-					}
214
-        		}
215
-        	}
179
+            //         	$attempted_outcomes_per_grad_program[$outcome->id]=0;
180
+            $achieved_outcomes_per_grad_program[$outcome->id] = 0;
181
+            $attemptedGradProgramsPerOutcome[$outcome->id] = 0;
182
+            $achievedGradProgramsPerOutcome[$outcome->id] = 0;
183
+            $grad_outcomes_attempted[$outcome->id] = $outcome->attempted_by_school($semesters, $school->id, 1);
184
+            $grad_outcomes_achieved[$outcome->id] = $outcome->achieved_by_school($semesters, $school->id, 1);
185
+            // For each program with courses that do assessment
186
+            foreach ($programs_attempted_in_school[$outcome->id] as $program_id) {
187
+                //         		var_dump($program_id->id);exit();
188
+                $program = DB::table('programs')
189
+                    ->where('id', '=', $program_id->id)
190
+                    ->first();
191
+                //         		$program=Program::where('id', $program_id->id);
192
+                //         		var_dump($program);exit();
193
+                if ($program->is_graduate) {
194
+                    $attemptedGradProgramsPerOutcome[$outcome->id]++;
195
+                    $programC = Program::where('id', '=', $program_id->id)->first();
196
+                    //         			var_dump($programC);exit();
197
+                    if ($programC->achieved_outcome($outcome->id, $semesters)) {
198
+                        $achievedGradProgramsPerOutcome[$outcome->id]++;
199
+                    }
200
+                }
201
+            }
216 202
             $programs_with_courses = Program::with(array('courses' => function ($query) {
217 203
                 //                 $query->whereNotNull('outcomes_attempted');
218 204
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
219 205
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
220
-
221 206
         }
222 207
         if ($school->id == 13) {
223
-//             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
208
+            //             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
224 209
             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
225 210
         } else {
226
-//             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
211
+            //             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
227 212
             return View::make('local.managers.shared.school', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
228 213
         }
229 214
     }
@@ -236,11 +221,11 @@ class SchoolsController extends \BaseController
236 221
         $title = $school->name;
237 222
         $schools = School::all();
238 223
 
239
-//         $outcomes = Outcome::orderBy('name', 'asc')->get();
240
-//         $outcomeCount = Outcome::all()->count();
241
-        $semesters = Semester::whereIn('id',Session::get('semesters_ids'))->get();
242
-// var_dump($semesters);
243
-// exit();
224
+        //         $outcomes = Outcome::orderBy('name', 'asc')->get();
225
+        //         $outcomeCount = Outcome::all()->count();
226
+        $semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
227
+        // var_dump($semesters);
228
+        // exit();
244 229
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
245 230
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
246 231
 
@@ -304,57 +289,56 @@ class SchoolsController extends \BaseController
304 289
          * Calculate how many sections are doing assessment
305 290
          */
306 291
 
307
-//         $undergrad_outcomes_achieved = array_fill(1, $outcomeCount, 0);
308
-//         $undergrad_outcomes_attempted = array_fill(1, $outcomeCount, 0);
292
+        //         $undergrad_outcomes_achieved = array_fill(1, $outcomeCount, 0);
293
+        //         $undergrad_outcomes_attempted = array_fill(1, $outcomeCount, 0);
309 294
         $undergrad_assessed_sections_count = 0;
310 295
         $undergrad_school_sections_count = 0;
311 296
 
312
-//         $grad_outcomes_achieved = array_fill(1, $outcomeCount, 0);
313
-//         $grad_outcomes_attempted = array_fill(1, $outcomeCount, 0);
297
+        //         $grad_outcomes_achieved = array_fill(1, $outcomeCount, 0);
298
+        //         $grad_outcomes_attempted = array_fill(1, $outcomeCount, 0);
314 299
         $grad_assessed_sections_count = 0;
315 300
         $grad_school_sections_count = 0;
316 301
 
317 302
         foreach ($school->programs as $program) {
318 303
             foreach ($program->courses as $course) {
319
-//             	            Log::info("aqui".$course);
304
+                //             	            Log::info("aqui".$course);
320 305
 
321
-            if (!$course->program->is_graduate){
322
-                $undergrad_school_sections_count += 1;
323
-            	if($course->isAssessed())$undergrad_assessed_sections_count += 1;
324
-//             	            Log::info("aqui".$course);
306
+                if (!$course->program->is_graduate) {
307
+                    $undergrad_school_sections_count += 1;
308
+                    if ($course->isAssessed()) $undergrad_assessed_sections_count += 1;
309
+                    //             	            Log::info("aqui".$course);
325 310
 
326
-            }
327
-            else {
328
-                $grad_school_sections_count += 1;
329
-            	if($course->isAssessed())$grad_assessed_sections_count += 1;
330
-//             	            	            Log::info("aqui".$course);
311
+                } else {
312
+                    $grad_school_sections_count += 1;
313
+                    if ($course->isAssessed()) $grad_assessed_sections_count += 1;
314
+                    //             	            	            Log::info("aqui".$course);
331 315
 
332
-            }
316
+                }
317
+
318
+                //                 if (!$course->program->is_graduate) {
319
+                //                     if ($course->outcomes_achieved != NULL) {
320
+                //                         $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
321
+                //                         $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
322
+                //                         for ($i = 1; $i <= count($undergrad_outcomes_attempted); $i++) {
323
+                //                             $undergrad_outcomes_achieved[$i] += $course_outcomes_achieved[$i];
324
+                //                             $undergrad_outcomes_attempted[$i] += $course_outcomes_attempted[$i];
325
+                //                         }
326
+                //                         $undergrad_assessed_sections_count += 1;
327
+                //                     }
328
+                //                     $undergrad_school_sections_count += 1;
329
+                //                 } else {
330
+                //                     if ($course->outcomes_achieved != NULL) {
331
+                //                         $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
332
+                //                         $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
333
+                //                         for ($i = 1; $i <= count($grad_outcomes_attempted); $i++) {
334
+                //                             $grad_outcomes_achieved[$i] += $course_outcomes_achieved[$i];
335
+                //                             $grad_outcomes_attempted[$i] += $course_outcomes_attempted[$i];
336
+                //                         }
337
+                //                         $grad_assessed_sections_count += 1;
338
+                //                     }
339
+                //                     $grad_school_sections_count += 1;
340
+                //                 }
333 341
 
334
-//                 if (!$course->program->is_graduate) {
335
-//                     if ($course->outcomes_achieved != NULL) {
336
-//                         $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
337
-//                         $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
338
-//                         for ($i = 1; $i <= count($undergrad_outcomes_attempted); $i++) {
339
-//                             $undergrad_outcomes_achieved[$i] += $course_outcomes_achieved[$i];
340
-//                             $undergrad_outcomes_attempted[$i] += $course_outcomes_attempted[$i];
341
-//                         }
342
-//                         $undergrad_assessed_sections_count += 1;
343
-//                     }
344
-//                     $undergrad_school_sections_count += 1;
345
-//                 } else {
346
-//                     if ($course->outcomes_achieved != NULL) {
347
-//                         $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
348
-//                         $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
349
-//                         for ($i = 1; $i <= count($grad_outcomes_attempted); $i++) {
350
-//                             $grad_outcomes_achieved[$i] += $course_outcomes_achieved[$i];
351
-//                             $grad_outcomes_attempted[$i] += $course_outcomes_attempted[$i];
352
-//                         }
353
-//                         $grad_assessed_sections_count += 1;
354
-//                     }
355
-//                     $grad_school_sections_count += 1;
356
-//                 }
357
-                
358 342
             }
359 343
         }
360 344
 
@@ -363,50 +347,47 @@ class SchoolsController extends \BaseController
363 347
          */
364 348
 
365 349
         // Number of programs that achieved a particular learning outcome
366
-//         $achievedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
350
+        //         $achievedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
367 351
 
368 352
         // Number of programs that attempted a particular learning outcome
369
-//         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
353
+        //         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
370 354
 
371 355
         // Fetch programs with participation for the school
372
-//         $participating_undergrad_programs = DB::table('programs')
373
-//             ->join('courses', 'courses.program_id', '=', 'programs.id')
374
-//             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
375
-//             ->addSelect('courses.semester_id')
376
-//             ->whereIn('semester_id', Session::get('semesters_ids'))
377
-//             ->where('is_graduate', 0)
378
-//             ->where('school_id', $school->id)
379
-//             ->groupBy('id')
380
-//             ->get();
356
+        //         $participating_undergrad_programs = DB::table('programs')
357
+        //             ->join('courses', 'courses.program_id', '=', 'programs.id')
358
+        //             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
359
+        //             ->addSelect('courses.semester_id')
360
+        //             ->whereIn('semester_id', Session::get('semesters_ids'))
361
+        //             ->where('is_graduate', 0)
362
+        //             ->where('school_id', $school->id)
363
+        //             ->groupBy('id')
364
+        //             ->get();
381 365
 
382 366
         $output = array();
383 367
 
384 368
 
385 369
         // For each outcome 
386 370
         foreach ($outcomes_undergrad as $outcome) {
387
-//         	$attempted_outcomes_per_undergrad_program[$outcome->id]=0;
388
-        	$achieved_outcomes_per_undergrad_program[$outcome->id]=0;
389
-        	$attemptedUndergradProgramsPerOutcome[$outcome->id]=0;
390
-        	$achievedUndergradProgramsPerOutcome[$outcome->id]=0;
391
-        	$programs_attempted_in_school[$outcome->id]=$outcome->programs_attempted_in_school($semesters, $school->id);
392
-//         	var_dump($programs_attempted_in_school);exit();
393
-        	foreach($programs_attempted_in_school[$outcome->id] as $program_id)
394
-        	{
395
-//         		var_dump($program_id->id);exit();
396
-				$program = DB::table('programs')
397
-                        ->where('id', '=', $program_id->id)
398
-                        ->first();
399
-//         		$program=Program::where('id', $program_id->id);
400
-//         		var_dump($program);exit();
401
-        		if(!$program->is_graduate)
402
-        		{
403
-        			$attemptedUndergradProgramsPerOutcome[$outcome->id]++;
404
-        			
405
-        		}
406
-        	}
407
- 			$undergrad_outcomes_attempted[$outcome->id]=$outcome->attempted_by_school($semesters, $school->id,0);
408
- 			$undergrad_outcomes_achieved[$outcome->id]=$outcome->achieved_by_school($semesters, $school->id,0);
409
- 			
371
+            //         	$attempted_outcomes_per_undergrad_program[$outcome->id]=0;
372
+            $achieved_outcomes_per_undergrad_program[$outcome->id] = 0;
373
+            $attemptedUndergradProgramsPerOutcome[$outcome->id] = 0;
374
+            $achievedUndergradProgramsPerOutcome[$outcome->id] = 0;
375
+            $programs_attempted_in_school[$outcome->id] = $outcome->programs_attempted_in_school($semesters, $school->id);
376
+            //         	var_dump($programs_attempted_in_school);exit();
377
+            foreach ($programs_attempted_in_school[$outcome->id] as $program_id) {
378
+                //         		var_dump($program_id->id);exit();
379
+                $program = DB::table('programs')
380
+                    ->where('id', '=', $program_id->id)
381
+                    ->first();
382
+                //         		$program=Program::where('id', $program_id->id);
383
+                //         		var_dump($program);exit();
384
+                if (!$program->is_graduate) {
385
+                    $attemptedUndergradProgramsPerOutcome[$outcome->id]++;
386
+                }
387
+            }
388
+            $undergrad_outcomes_attempted[$outcome->id] = $outcome->attempted_by_school($semesters, $school->id, 0);
389
+            $undergrad_outcomes_achieved[$outcome->id] = $outcome->achieved_by_school($semesters, $school->id, 0);
390
+
410 391
             // For each program with courses that do assessment
411 392
             $programs_with_courses = Program::with(array('courses' => function ($query) {
412 393
                 //                 $query->whereNotNull('outcomes_attempted');
@@ -414,46 +395,46 @@ class SchoolsController extends \BaseController
414 395
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
415 396
 
416 397
             foreach ($programs_with_courses as $program) {
417
-            if(in_array($program->id,$participating_programs)){
418
-                // To acummulate all criteria for one program
419
-//                 $achieved_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
420
-//                 $attempted_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
421
-
422
-                //Flag for counting programs
423
-                $flag = false;
424
-
425
-                // For each course in the program
426
- //                foreach ($program->courses as $course) {
427
-//                 if($course->isAssessed()){
428
-//                     // If the outcome in question is being evaluated
429
-//                     $course_outcomes_attempted2 = $course->outcomes_att();
430
-//                     //                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
431
-//                     //                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
432
-//                     $course_outcomes_achieved2 = $course->outcomes_ach();
433
-//                     if (
434
-//                         array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
435
-//                         && $course_outcomes_attempted2[$outcome->id] > 0
436
-//                     ) {
437
-//                         $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
438
-// //                         $attempted_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
439
-// 
440
-//                         // Add one to the programs assessing, if it wasn't added before
441
-//                         if (!$flag) {
442
-//                             $attemptedUndergradProgramsPerOutcome[$outcome->id] += 1;
443
-//                             $flag = true;
444
-//                         }
445
-//                     }
446
-// 
447
-//                     // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_undergrad_program);
448
-//                     // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
449
-// 				}
450
-//                 }
451
-                //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
452
-//                 if ($attempted_outcomes_per_undergrad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_undergrad_program[$outcome->id] / $attempted_outcomes_per_undergrad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
453
-//                     $achievedUndergradProgramsPerOutcome[$outcome->id] += 1;
454
-//                     // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
455
-//                 }
456
-            }
398
+                if (in_array($program->id, $participating_programs)) {
399
+                    // To acummulate all criteria for one program
400
+                    //                 $achieved_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
401
+                    //                 $attempted_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
402
+
403
+                    //Flag for counting programs
404
+                    $flag = false;
405
+
406
+                    // For each course in the program
407
+                    //                foreach ($program->courses as $course) {
408
+                    //                 if($course->isAssessed()){
409
+                    //                     // If the outcome in question is being evaluated
410
+                    //                     $course_outcomes_attempted2 = $course->outcomes_att();
411
+                    //                     //                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
412
+                    //                     //                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
413
+                    //                     $course_outcomes_achieved2 = $course->outcomes_ach();
414
+                    //                     if (
415
+                    //                         array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
416
+                    //                         && $course_outcomes_attempted2[$outcome->id] > 0
417
+                    //                     ) {
418
+                    //                         $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
419
+                    // //                         $attempted_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
420
+                    // 
421
+                    //                         // Add one to the programs assessing, if it wasn't added before
422
+                    //                         if (!$flag) {
423
+                    //                             $attemptedUndergradProgramsPerOutcome[$outcome->id] += 1;
424
+                    //                             $flag = true;
425
+                    //                         }
426
+                    //                     }
427
+                    // 
428
+                    //                     // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_undergrad_program);
429
+                    //                     // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
430
+                    // 				}
431
+                    //                 }
432
+                    //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
433
+                    //                 if ($attempted_outcomes_per_undergrad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_undergrad_program[$outcome->id] / $attempted_outcomes_per_undergrad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
434
+                    //                     $achievedUndergradProgramsPerOutcome[$outcome->id] += 1;
435
+                    //                     // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
436
+                    //                 }
437
+                }
457 438
             }
458 439
         }
459 440
 
@@ -462,101 +443,98 @@ class SchoolsController extends \BaseController
462 443
          */
463 444
 
464 445
         // Number of programs that achieved a particular learning outcome
465
-//         $achievedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
446
+        //         $achievedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
466 447
 
467 448
         // Number of programs that attempted a particular learning outcome
468
-//         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
469
-// 
449
+        //         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
450
+        // 
470 451
         // Fetch programs with participation for the school
471
-//         $participating_grad_programs = DB::table('programs')
472
-//             ->join('courses', 'courses.program_id', '=', 'programs.id')
473
-//             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
474
-//             ->addSelect('courses.semester_id')
475
-//             ->whereIn('semester_id', Session::get('semesters_ids'))
476
-//             ->where('is_graduate', 1)
477
-//             ->where('school_id', $school->id)
478
-//             ->groupBy('id')
479
-//             ->get();
452
+        //         $participating_grad_programs = DB::table('programs')
453
+        //             ->join('courses', 'courses.program_id', '=', 'programs.id')
454
+        //             ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
455
+        //             ->addSelect('courses.semester_id')
456
+        //             ->whereIn('semester_id', Session::get('semesters_ids'))
457
+        //             ->where('is_graduate', 1)
458
+        //             ->where('school_id', $school->id)
459
+        //             ->groupBy('id')
460
+        //             ->get();
480 461
 
481 462
         $output = array();
482 463
 
483 464
 
484 465
         // For each outcome 
485 466
         foreach ($outcomes_grad as $outcome) {
486
-//         	$attempted_outcomes_per_grad_program[$outcome->id]=0;
487
-        	$achieved_outcomes_per_grad_program[$outcome->id]=0;
488
-        	$attemptedGradProgramsPerOutcome[$outcome->id]=0;
489
-        	$achievedGradProgramsPerOutcome[$outcome->id]=0;
490
- 			$grad_outcomes_attempted[$outcome->id]=$outcome->attempted_by_school($semesters, $school->id,1);
491
- 			$grad_outcomes_achieved[$outcome->id]=$outcome->achieved_by_school($semesters, $school->id,1);
492
-           // For each program with courses that do assessment
493
-        	foreach($programs_attempted_in_school[$outcome->id] as $program_id)
494
-        	{
495
-//         		var_dump($program_id->id);exit();
496
-				$program = DB::table('programs')
497
-                        ->where('id', '=', $program_id->id)
498
-                        ->first();
499
-//         		$program=Program::where('id', $program_id->id);
500
-//         		var_dump($program);exit();
501
-        		if($program->is_graduate)
502
-        		{
503
-        			$attemptedGradProgramsPerOutcome[$outcome->id]++;
504
-        			
505
-        		}
506
-        	}
467
+            //         	$attempted_outcomes_per_grad_program[$outcome->id]=0;
468
+            $achieved_outcomes_per_grad_program[$outcome->id] = 0;
469
+            $attemptedGradProgramsPerOutcome[$outcome->id] = 0;
470
+            $achievedGradProgramsPerOutcome[$outcome->id] = 0;
471
+            $grad_outcomes_attempted[$outcome->id] = $outcome->attempted_by_school($semesters, $school->id, 1);
472
+            $grad_outcomes_achieved[$outcome->id] = $outcome->achieved_by_school($semesters, $school->id, 1);
473
+            // For each program with courses that do assessment
474
+            foreach ($programs_attempted_in_school[$outcome->id] as $program_id) {
475
+                //         		var_dump($program_id->id);exit();
476
+                $program = DB::table('programs')
477
+                    ->where('id', '=', $program_id->id)
478
+                    ->first();
479
+                //         		$program=Program::where('id', $program_id->id);
480
+                //         		var_dump($program);exit();
481
+                if ($program->is_graduate) {
482
+                    $attemptedGradProgramsPerOutcome[$outcome->id]++;
483
+                }
484
+            }
507 485
             $programs_with_courses = Program::with(array('courses' => function ($query) {
508 486
                 //                 $query->whereNotNull('outcomes_attempted');
509 487
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
510 488
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
511 489
 
512 490
             foreach ($programs_with_courses as $program) {
513
-             if(in_array($program->id,$participating_programs)){
514
-               // To acummulate all criteria for one program
515
-//                 $achieved_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
516
-//                 $attempted_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
517
-
518
-                //Flag for counting programs
519
-                $flag = false;
520
-
521
-                // For each course in the program
522
-                foreach ($program->courses as $course) {
523
-                if($course->isAssessed()){
524
-                    // If the outcome in question is being evaluated
525
-                    //                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
526
-                    $course_outcomes_attempted2 = ($course->outcomes_att());
527
-                    $course_outcomes_achieved2 = ($course->outcomes_ach());
528
-                    //                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
529
-                    if (
530
-                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
531
-                        && $course_outcomes_attempted2[$outcome->id] > 0
532
-                    ) {
533
-                        $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
534
-                        $attempted_outcomes_per_grad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
535
-
536
-                        // Add one to the programs assessing, if it wasn't added before
537
-                        if (!$flag) {
538
-                            $attemptedGradProgramsPerOutcome[$outcome->id] += 1;
539
-                            $flag = true;
491
+                if (in_array($program->id, $participating_programs)) {
492
+                    // To acummulate all criteria for one program
493
+                    //                 $achieved_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
494
+                    //                 $attempted_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
495
+
496
+                    //Flag for counting programs
497
+                    $flag = false;
498
+
499
+                    // For each course in the program
500
+                    foreach ($program->courses as $course) {
501
+                        if ($course->isAssessed()) {
502
+                            // If the outcome in question is being evaluated
503
+                            //                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
504
+                            $course_outcomes_attempted2 = ($course->outcomes_att());
505
+                            $course_outcomes_achieved2 = ($course->outcomes_ach());
506
+                            //                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
507
+                            if (
508
+                                array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
509
+                                && $course_outcomes_attempted2[$outcome->id] > 0
510
+                            ) {
511
+                                $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
512
+                                $attempted_outcomes_per_grad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
513
+
514
+                                // Add one to the programs assessing, if it wasn't added before
515
+                                if (!$flag) {
516
+                                    $attemptedGradProgramsPerOutcome[$outcome->id] += 1;
517
+                                    $flag = true;
518
+                                }
519
+                            }
520
+
521
+                            // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_grad_program);
522
+                            // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
540 523
                         }
541 524
                     }
542
-
543
-                    // $output[] = 'ACHIEVED: '.$program->name.'-'.json_encode($achieved_outcomes_per_grad_program);
544
-                    // $output[] = 'ATTEMPTED: '.$program->name.'-'.json_encode($attempted_outcomes_per_program);
545
-			}
546
-                }
547
-                //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
548
-                if ($attempted_outcomes_per_grad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_grad_program[$outcome->id] / $attempted_outcomes_per_grad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
549
-                    $achievedGradProgramsPerOutcome[$outcome->id] += 1;
550
-                    // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
525
+                    //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
526
+                    if ($attempted_outcomes_per_grad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_grad_program[$outcome->id] / $attempted_outcomes_per_grad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
527
+                        $achievedGradProgramsPerOutcome[$outcome->id] += 1;
528
+                        // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
529
+                    }
551 530
                 }
552
-           }
553 531
             }
554 532
         }
555 533
         if ($school->id == 13) {
556
-//             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
534
+            //             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
557 535
             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
558 536
         } else {
559
-//             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
537
+            //             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
560 538
             return View::make('local.managers.shared.school', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
561 539
         }
562 540
     }

+ 42
- 3
app/controllers/TemplatesController.php 查看文件

@@ -6,6 +6,38 @@ class TemplatesController extends \BaseController
6 6
 	/**
7 7
 	 * List all templates, grouped by program
8 8
 	 */
9
+	public function ProfIndex()
10
+	{
11
+		$title = 'Rubric List';
12
+
13
+
14
+		$role = Auth::user()->role;
15
+		$program_id = DB::table("program_user")
16
+			->where('user_id', Auth::user()->id)
17
+			->lists('program_id')[0];
18
+		$school_id = DB::table('programs')
19
+			->where('id', $program_id)
20
+			->lists('school_id')[0];
21
+
22
+
23
+		$templates = Template::orderBy('name')
24
+			->whereNull("school_id")
25
+			->orWhere(function ($query) use (&$school_id) {
26
+				$query->where('school_id', $school_id)
27
+					->whereNull('program_id');
28
+			})
29
+			->orWhere(function ($query) use (&$program_id, &$school_id) {
30
+				$query->where('school_id', $school_id)
31
+					->where('program_id', $program_id);
32
+			})
33
+
34
+
35
+			->get();
36
+
37
+
38
+
39
+		return View::make('local.managers.shared.rubric_list', compact('title', 'global_templates', 'schools', 'templates', 'role'));
40
+	}
9 41
 	public function index()
10 42
 	{
11 43
 		$title = 'Rubric List';
@@ -29,6 +61,7 @@ class TemplatesController extends \BaseController
29 61
 					->get();
30 62
 				break;
31 63
 			case 3:
64
+			case 4:
32 65
 				$program_id = DB::table("program_user")
33 66
 					->where('user_id', Auth::user()->id)
34 67
 					->lists('program_id')[0];
@@ -39,13 +72,19 @@ class TemplatesController extends \BaseController
39 72
 
40 73
 				$templates = Template::orderBy('name')
41 74
 					->whereNull("school_id")
42
-					->orWhere('school_id', $school_id)
43
-					->orWhere('program_id', $program_id)
75
+					->orWhere(function ($query) use (&$school_id) {
76
+						$query->where('school_id', $school_id)
77
+							->whereNull('program_id');
78
+					})
79
+					->orWhere(function ($query) use (&$program_id, &$school_id) {
80
+						$query->where('school_id', $school_id)
81
+							->where('program_id', $program_id);
82
+					})
44 83
 
45 84
 					->get();
46 85
 				break;
47 86
 		}
48
-		$templates = Template::orderBy('name')->get();
87
+		//$templates = Template::orderBy('name')->get();
49 88
 
50 89
 		return View::make('local.managers.shared.rubric_list', compact('title', 'global_templates', 'schools', 'templates', 'role'));
51 90
 	}

+ 1
- 1
app/controllers/ThreeYearPlanController.php 查看文件

@@ -631,4 +631,4 @@ class ThreeYearPlanController extends \BaseController
631 631
 
632 632
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
633 633
   }
634
-}
634
+}

+ 1
- 1
app/controllers/TransformativeActionsController.php 查看文件

@@ -1404,4 +1404,4 @@ class TransformativeActionsController extends \BaseController
1404 1404
     }
1405 1405
     return $grouped_courses;
1406 1406
   }
1407
-}
1407
+}

+ 56
- 0
app/database/migrations/2022_02_03_135359_create_transformative_typ_outcome.php 查看文件

@@ -0,0 +1,56 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class CreateTransformativeTypOutcome extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('transformative_typ_outcome', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->integer('trans_id')->unsigned();
19
+			$table->integer('typ_semester_outcome_id')->unsigned();
20
+			$table->foreign('trans_id')
21
+				->references('id')
22
+				->on('transformative_actions')
23
+				->onDelete('cascade')
24
+				->onUpdate('cascade');
25
+			$table->foreign('typ_semester_outcome_id')
26
+				->references('id')
27
+				->on('typ_semester_outcome')
28
+				->onDelete('cascade')
29
+				->onUpdate('cascade');
30
+			$table->integer('proposing_coordinator_id')->unsigned();
31
+			$table->foreign('proposing_coordinator_id')
32
+				->references('id')
33
+				->on('users')
34
+				->onDelete('restrict')
35
+				->onUpdate('restrict');
36
+
37
+
38
+
39
+			$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
40
+			$table->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP'));
41
+			$table->timestamp('deleted_at')->default(DB::raw('CURRENT_TIMESTAMP'));
42
+			//$table->softDeletes()->default(DB::raw('CURRENT_TIMESTAMP'));
43
+
44
+		});
45
+	}
46
+
47
+	/**
48
+	 * Reverse the migrations.
49
+	 *
50
+	 * @return void
51
+	 */
52
+	public function down()
53
+	{
54
+		Schema::drop('transformative_typ_outcome');
55
+	}
56
+}

+ 42
- 0
app/database/migrations/2022_02_03_193908_create_transformative_action_status.php 查看文件

@@ -0,0 +1,42 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class CreateTransformativeActionStatus extends Migration
7
+{
8
+
9
+	public function up()
10
+	{
11
+		Schema::create('transformative_action_status', function (Blueprint $table) {
12
+			$table->increments('id');
13
+			$table->boolean('accomplished');
14
+			$table->boolean('it_was_useful')->default(0);
15
+
16
+			$table->integer('trans_id')->unsigned();
17
+			$table->foreign('trans_id')
18
+				->references('id')
19
+				->on('transformative_actions')
20
+				->onDelete('cascade')
21
+				->onUpdate('cascade');
22
+
23
+			$table->integer('supervised_coordinator_id')->unsigned();
24
+			$table->foreign('supervised_coordinator_id')
25
+				->references('id')
26
+				->on('users')
27
+				->onDelete('restrict')
28
+				->onUpdate('restrict');
29
+			$table->text('comments')->nullable();
30
+		});
31
+	}
32
+
33
+	/**
34
+	 * Reverse the migrations.
35
+	 *
36
+	 * @return void
37
+	 */
38
+	public function down()
39
+	{
40
+		Schema::drop('transformative_action_status');
41
+	}
42
+}

+ 32
- 0
app/database/migrations/2022_02_04_040351_add_submit_in_typ_program.php 查看文件

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class AddSubmitInTypProgram extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::table('courses', function (Blueprint $table) {
17
+			$table->boolean('is_submitted');
18
+		});
19
+	}
20
+
21
+	/**
22
+	 * Reverse the migrations.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function down()
27
+	{
28
+		Schema::table('courses', function (Blueprint $table) {
29
+			$table->dropColumn('is_submitted');
30
+		});
31
+	}
32
+}

app/database/migrations/2021_06_15_235911_create_annual_report_transformative_table.php → app/database/unusedMigrations/2021_06_15_235911_create_annual_report_transformative_table.php 查看文件


app/database/migrations/2022_01_19_100041_add_deleted_at_objectives.php → app/database/unusedMigrations/2022_01_19_100041_add_deleted_at_objectives.php 查看文件


+ 1
- 1
app/models/Activity.php 查看文件

@@ -414,4 +414,4 @@ class Activity extends Eloquent
414 414
     //return json_decode($this->outcomes_attempted, true);
415 415
     return $outcomes_attempted;
416 416
   }
417
-}
417
+}

+ 7
- 3
app/models/Course.php 查看文件

@@ -181,9 +181,11 @@ class Course extends Eloquent
181 181
   public static function getStudentReportForOutcome($course_code = null)
182 182
   {
183 183
     if ($course_code) {
184
+      Log::info('entré');
184 185
       $criteria_id = DB::table('annual_plan_objective')
185 186
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
186 187
         ->lists('criteria_id');
188
+      Log::info($criteria_id);
187 189
       $program = Program::where('id', $course_code->program_id)->first();
188 190
       // // Log::info($program->code);
189 191
       if ($program->code == "") {
@@ -232,10 +234,12 @@ class Course extends Eloquent
232 234
 
233 235
 
234 236
       //Log::info($criteria_id);
237
+      Log::info('los courseCode');
238
+      Log::info(array($course_code));
239
+      Log::info('los programas');
240
+      Log::info($program_ids);
235 241
 
236
-      //Log::info($program_ids);
237
-
238
-      //Log::info($table_per_student->toSql());
242
+      Log::info($table_per_student->toSql());
239 243
       $students = $table_per_student->get();
240 244
 
241 245
 

+ 3
- 3
app/models/Outcome.php 查看文件

@@ -221,7 +221,7 @@ class Outcome extends Eloquent
221 221
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
222 222
 			->distinct()
223 223
 			->get();
224
-			
224
+
225 225
 		$conteo = 0;
226 226
 		foreach ($criteria as $criterion) {
227 227
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
@@ -268,7 +268,7 @@ class Outcome extends Eloquent
268 268
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
269 269
 			->distinct()
270 270
 			->get();
271
-			
271
+
272 272
 		$conteo = 0;
273 273
 		foreach ($criteria as $criterion) {
274 274
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
@@ -315,7 +315,7 @@ class Outcome extends Eloquent
315 315
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
316 316
 			->distinct()
317 317
 			->get();
318
-			
318
+
319 319
 		$conteo = 0;
320 320
 		foreach ($criteria as $criterion) {
321 321
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);

+ 9
- 2
app/routes.php 查看文件

@@ -166,7 +166,10 @@ Route::group(array('before' => 'auth|has_access'), function () {
166 166
     /**
167 167
      * Shared Routes
168 168
      */
169
-
169
+    Route::post('fetchObjectiveInfo', array(
170
+        'as' => 'fetchObjectiveInfo',
171
+        'uses' => 'AnnualPlansController@fetchObjectiveInfo'
172
+    ));
170 173
     Route::get('selectAnnualProgram', array(
171 174
         'as' => 'selectAnnualProgram',
172 175
         'uses' => 'AnnualPlansController@selectProgramPlan'
@@ -260,6 +263,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
260 263
         'as' => 'fetchRubricCriterion',
261 264
         'uses' => 'RubricsController@fetchRubricCriterion'
262 265
     ));
266
+    Route::post('fetchObjectives', 'Objective2Controller@fetchAllObjectives');
263 267
 
264 268
     // Load a rubric template
265 269
     Route::post('loadTemplate', array('uses' => 'TemplatesController@fetch'));
@@ -321,7 +325,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
321 325
         Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
322 326
 
323 327
         Route::get('learning-outcomes', 'OutcomesController@index');
324
-        Route::post('fetchObjectives', 'Objective2Controller@fetchAllObjectives');
328
+        //Route::post('fetchObjectives', 'Objective2Controller@fetchAllObjectives');
325 329
         // TODO: Change later
326 330
         Route::get('new-learning-outcomes', 'OutcomesController@newIndex');
327 331
 
@@ -528,6 +532,9 @@ Route::group(array('before' => 'auth|has_access'), function () {
528 532
      * Professor Routes
529 533
      */
530 534
     Route::group(array('prefix' => 'professor', 'before' => 'prof'), function () {
535
+
536
+
537
+        Route::get('templateForProfessor', 'TemplatesController@ProfIndex');
531 538
         Route::post('program', array('before' => 'csrf', 'uses' => 'ProfessorsController@program'));
532 539
         Route::get('activities/{activity_id}/rubrics', 'RubricsController@newRubric');
533 540
         Route::get('activities/{activity_id}/other_method', 'RubricsController@newOtherMethod');

+ 2
- 2
app/views/global/view-three-year-plan.blade.php 查看文件

@@ -104,7 +104,7 @@
104 104
         @endforeach
105 105
       </div>
106 106
       <br>
107
-      <div>
107
+    </div>
108 108
         <button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
109 109
 
110 110
 <!-- Modal -->
@@ -139,7 +139,7 @@
139 139
   </div>
140 140
 </div>
141 141
       </div>
142
-    </div>
142
+   
143 143
 
144 144
     <div class="col-md-9">
145 145
       <div class="btn-group pull-right">

+ 60
- 45
app/views/local/managers/admins/new_assessment_report.blade.php 查看文件

@@ -58,14 +58,14 @@
58 58
                                     <?php
59 59
                                     
60 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();*/
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 69
                                     
70 70
                                     $sections_evaluating = Course::has('activities')
71 71
                                     
@@ -165,36 +165,7 @@
165 165
                                             </p>
166 166
 
167 167
                                             <br>
168
-                                            <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
169
-                                            <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
170
-                                            @if ($formative_actions)
171
-                                                <p style="display: inline;">
172
-                                                    <strong>{{ $formative_actions[0]->at_text }}:
173
-                                                    </strong>
174
-
175
-                                                    <i>{{ $formative_actions[0]->description }}
176
-                                                    </i>
177
-                                                </p>
178
-                                                <br>
179
-                                                <h5>Formative Action's Associated
180
-                                                    Criteria: </h5>
181
-                                                <ul>
182
-                                                    @foreach ($formative_actions as $criteria)
183
-                                                        <li> <i>{{ $criteria->name }} <i></li>
184
-
185
-                                                    @endforeach
186
-                                                </ul>
187 168
 
188
-                                            @else
189
-                                                <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
190
-
191
-                                            @endif
192
-                                            @if ($activity->assessment_comments != null)
193
-
194
-                                                <h5 style="display: inline; margin:30px;">Assessment Comments</h5>
195
-                                                <p style="display: inline;">{{ $activity->assessment_comments }}</p>
196
-                                            @endif
197
-                                            <br>
198 169
                                             <table class='table table-striped table-condensed datatable'>
199 170
                                                 <thead>
200 171
                                                     <tr>
@@ -211,7 +182,7 @@
211 182
                                                             %
212 183
                                                         </th>
213 184
                                                         <th>
214
-                                                            Outcomes
185
+                                                            Learning Outcomes
215 186
                                                         </th>
216 187
                                                     </tr>
217 188
                                                 </thead>
@@ -253,7 +224,7 @@
253 224
 
254 225
                                                                 @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
255 226
 
256
-                                                                    {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
227
+                                                                    <?php echo $outcome->name . "\n\n\n <br>"; ?>
257 228
 
258 229
 
259 230
 
@@ -266,17 +237,56 @@
266 237
                                                 </tbody>
267 238
 
268 239
                                             </table>
240
+                                            <br>
241
+                                            <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
242
+                                            <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
243
+                                            @if ($formative_actions)
244
+                                                <p style="display: inline;">
245
+                                                    <u>{{ $formative_actions[0]->at_text }}:
246
+                                                    </u>
247
+
248
+                                                    <i>{{ $formative_actions[0]->description }}
249
+                                                    </i>
250
+                                                </p>
251
+                                                <br>
252
+                                                <h5 style="display: inline; margin:30px;">Formative Action's Associated
253
+                                                    Criteria: </h5>
254
+                                                <ul style="margin:30px;">
255
+                                                    @foreach ($formative_actions as $criteria)
256
+                                                        <li> <i>{{ $criteria->name }} <i></li>
257
+
258
+                                                    @endforeach
259
+                                                </ul>
260
+
261
+
262
+
263
+                                            @endif
264
+                                            <br>
265
+                                            <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
266
+                                            @if ($activity->assessment_comments != null)
267
+
268
+
269
+                                                <p style="display: inline;">{{ $activity->assessment_comments }}</p>
270
+                                            @endif
271
+                                            <br>
269 272
                                             <hr>
270 273
                                             <br>
271 274
 
272 275
                                             <h4>Performance of Students by Learning Outcome</h4>
273
-                                            <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
276
+                                            <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
277
+                                            <p style="display: inline;">{{ $activity->name }}
278
+                                                <strong>({{ $activity->date }})</strong>
279
+                                            </p>
280
+                                            <br>
281
+
282
+                                            <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
274 283
                                             <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
275 284
                                             </p>
276 285
                                             <br>
277
-                                            <h5 style="display: inline; margin:30px;">Expected percent of students achieving
286
+                                            <h5 style="display: inline; margin:30px;">Expected percent of students
287
+                                                achieving
278 288
                                                 the
279
-                                                target by outcome: </h5>
289
+                                                target by learning outcome: </h5>
280 290
                                             <p style="display: inline;"> <i>
281 291
                                                     <?php
282 292
                                                     $expected = DB::table('target_outcomes_program')
@@ -286,6 +296,9 @@
286 296
                                                     if (!$expected) {
287 297
                                                         $expected = 'It has not been defined in the annual plan';
288 298
                                                     }
299
+                                                    else{
300
+                                            $expected = $expected->expected_target;
301
+                                        }
289 302
                                                     ?>
290 303
                                                     {{ $expected }}
291 304
                                                 </i>
@@ -295,7 +308,7 @@
295 308
                                                 <thead>
296 309
                                                     <tr>
297 310
                                                         <th>
298
-                                                            Outcome
311
+                                                            Learning Outcome
299 312
                                                         </th>
300 313
                                                         <th>
301 314
                                                             Number of Students Assessed
@@ -322,11 +335,13 @@
322 335
                                                                 {{ $outcome->achieved }}
323 336
                                                             </td>
324 337
                                                             @if ($outcome->percentage >= $expected)
325
-                                                                <td class="col-md-1 success">{{ $outcome->percentage }}%
338
+                                                                <td class="col-md-1 success">
339
+                                                                    {{ $outcome->percentage }}%
326 340
                                                                 </td>
327 341
 
328 342
                                                             @else
329
-                                                                <td class="col-md-1 danger">{{ $outcome->percentage }}%
343
+                                                                <td class="col-md-1 danger">
344
+                                                                    {{ $outcome->percentage }}%
330 345
                                                                 </td>
331 346
 
332 347
                                                             @endif

+ 1
- 1
app/views/local/managers/admins/objectives.blade.php 查看文件

@@ -101,7 +101,7 @@
101 101
                         <div class="form-group">
102 102
                             <label>Associated Outcome</label>
103 103
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
104
-                            <select id="'assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
104
+                            <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
105 105
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
106 106
                                 @foreach ($outcomes as $outcome)
107 107
                                     <option value="{{ $outcome->id }}">

+ 1
- 1
app/views/local/managers/pCoords/_navigation.blade.php 查看文件

@@ -69,7 +69,7 @@
69 69
 
70 70
             </li>
71 71
             <li><a href="{{ URL::action('OutcomesController@annualReport', Auth::user()->programs[0]->id) }}">Annual
72
-                    Results</a></li>
72
+                    Report</a></li>
73 73
 
74 74
             <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Formative Actions') }}
75 75
 

+ 52
- 43
app/views/local/managers/pCoords/new_assessment_report.blade.php 查看文件

@@ -44,14 +44,14 @@
44 44
                         <?php
45 45
                         
46 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();*/
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 55
                         
56 56
                         $sections_evaluating = Course::has('activities')
57 57
                         
@@ -144,36 +144,7 @@
144 144
                                     </p>
145 145
 
146 146
                                     <br>
147
-                                    <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
148
-                                    <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
149
-                                    @if ($formative_actions)
150
-                                        <p style="display: inline;"> <strong>{{ $formative_actions[0]->at_text }}:
151
-                                            </strong>
152
-
153
-                                            <i>{{ $formative_actions[0]->description }}
154
-                                            </i>
155
-                                        </p>
156
-                                        <br>
157
-                                        <h5>Formative Action's Associated
158
-                                            Criteria: </h5>
159
-                                        <ul>
160
-                                            @foreach ($formative_actions as $criteria)
161
-                                                <li> <i>{{ $criteria->name }} <i></li>
162
-
163
-                                            @endforeach
164
-                                        </ul>
165 147
 
166
-                                    @else
167
-                                        <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
168
-
169
-                                    @endif
170
-
171
-                                    @if ($activity->assessment_comments != null)
172
-
173
-                                        <h5 style="display: inline; margin:30px;">Assessment Comments</h5>
174
-                                        <p style="display: inline;">{{ $activity->assessment_comments }}</p>
175
-                                    @endif
176
-                                    <br>
177 148
                                     <table class='table table-striped table-condensed datatable'>
178 149
                                         <thead>
179 150
                                             <tr>
@@ -190,7 +161,7 @@
190 161
                                                     %
191 162
                                                 </th>
192 163
                                                 <th>
193
-                                                    Outcomes
164
+                                                    Learning Outcomes
194 165
                                                 </th>
195 166
                                             </tr>
196 167
                                         </thead>
@@ -232,7 +203,7 @@
232 203
 
233 204
                                                         @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
234 205
 
235
-                                                            {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
206
+                                                            <?php echo $outcome->name . "\n\n\n <br>"; ?>
236 207
 
237 208
 
238 209
 
@@ -245,16 +216,52 @@
245 216
                                         </tbody>
246 217
 
247 218
                                     </table>
219
+                                    <br>
220
+                                    <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
221
+                                    <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
222
+                                    @if ($formative_actions)
223
+                                        <p style="display: inline;">
224
+                                            <u>{{ $formative_actions[0]->at_text }}:
225
+                                            </u>
226
+
227
+                                            <i>{{ $formative_actions[0]->description }}
228
+                                            </i>
229
+                                        </p>
230
+                                        <br>
231
+                                        <h5 style="display: inline; margin:30px;">Formative Action's Associated
232
+                                            Criteria: </h5>
233
+                                        <ul style="margin:30px;">
234
+                                            @foreach ($formative_actions as $criteria)
235
+                                                <li> <i>{{ $criteria->name }} <i></li>
236
+
237
+                                            @endforeach
238
+                                        </ul>
239
+
240
+
241
+                                    @endif
242
+                                    <br>
243
+                                    <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
244
+                                    @if ($activity->assessment_comments != null)
245
+
246
+
247
+                                        <p style="display: inline;">{{ $activity->assessment_comments }}</p>
248
+                                    @endif
249
+                                    <br>
248 250
                                     <hr>
249 251
                                     <br>
250 252
 
251 253
                                     <h4>Performance of Students by Learning Outcome</h4>
252
-                                    <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
254
+                                    <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
255
+                                    <p style="display: inline;">{{ $activity->name }}
256
+                                        <strong>({{ $activity->date }})</strong>
257
+                                    </p>
258
+                                    <br>
259
+                                    <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
253 260
                                     <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
254 261
                                     </p>
255 262
                                     <br>
256 263
                                     <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
257
-                                        target by outcome: </h5>
264
+                                        target by learning outcome: </h5>
258 265
                                     <p style="display: inline;"> <i>
259 266
                                             <?php
260 267
                                             $expected = DB::table('target_outcomes_program')
@@ -264,7 +271,9 @@
264 271
                                             if (!$expected) {
265 272
                                                 $expected = 'It has not been defined in the annual plan';
266 273
                                             }
267
-                                            
274
+                                            else{
275
+                                            $expected = $expected->expected_target;
276
+                                        }
268 277
                                             ?>
269 278
                                             {{ $expected }}
270 279
                                         </i>
@@ -274,7 +283,7 @@
274 283
                                         <thead>
275 284
                                             <tr>
276 285
                                                 <th>
277
-                                                    Outcome
286
+                                                    Learning Outcome
278 287
                                                 </th>
279 288
                                                 <th>
280 289
                                                     Number of Students Assessed

+ 1
- 1
app/views/local/managers/pCoords/objectives.blade.php 查看文件

@@ -115,7 +115,7 @@
115 115
                         <div class="form-group">
116 116
                             <label>Associated Outcome</label>
117 117
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
118
-                            <select id="'assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
118
+                            <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
119 119
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
120 120
                                 @foreach ($outcomes as $outcome)
121 121
                                     <option value="{{ $outcome->id }}">

+ 1
- 1
app/views/local/managers/sCoords/_navigation.blade.php 查看文件

@@ -52,7 +52,7 @@
52 52
                         </li>
53 53
 
54 54
                     @endif
55
-                    <li>{{ HTML::linkAction('AnnualPlansController@selectProgramPlan', 'Annual Results') }}</li>
55
+                    <li>{{ HTML::linkAction('AnnualPlansController@selectProgramPlan', 'Annual Reports') }}</li>
56 56
                     <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Formative Actions') }}
57 57
 
58 58
                 </ul>

+ 54
- 41
app/views/local/managers/sCoords/new_assessment_report.blade.php 查看文件

@@ -56,14 +56,14 @@
56 56
                                 <?php
57 57
                                 
58 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();*/
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 67
                                 
68 68
                                 $sections_evaluating = Course::has('activities')
69 69
                                 
@@ -159,35 +159,7 @@
159 159
                                                 %</i>
160 160
                                         </p>
161 161
 
162
-                                        <br>
163
-                                        <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
164
-                                        <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
165
-                                        @if ($formative_actions)
166
-                                            <p style="display: inline;"> <strong>{{ $formative_actions[0]->at_text }}:
167
-                                                </strong>
168
-
169
-                                                <i>{{ $formative_actions[0]->description }}
170
-                                                </i>
171
-                                            </p>
172
-                                            <br>
173
-                                            <h5>Formative Action's Associated
174
-                                                Criteria: </h5>
175
-                                            <ul>
176
-                                                @foreach ($formative_actions as $criteria)
177
-                                                    <li> <i>{{ $criteria->name }} <i></li>
178
-
179
-                                                @endforeach
180
-                                            </ul>
181
-
182
-                                        @else
183
-                                            <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
184 162
 
185
-                                        @endif
186
-                                        @if ($activity->assessment_comments != null)
187
-
188
-                                            <h5 style="display: inline; margin:30px;">Assessment Comments</h5>
189
-                                            <p style="display: inline;">{{ $activity->assessment_comments }}</p>
190
-                                        @endif
191 163
                                         <br>
192 164
                                         <table class='table table-striped table-condensed datatable'>
193 165
                                             <thead>
@@ -205,7 +177,7 @@
205 177
                                                         %
206 178
                                                     </th>
207 179
                                                     <th>
208
-                                                        Outcomes
180
+                                                        Learning Outcomes
209 181
                                                     </th>
210 182
                                                 </tr>
211 183
                                             </thead>
@@ -247,7 +219,7 @@
247 219
 
248 220
                                                             @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
249 221
 
250
-                                                                {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
222
+                                                                <?php echo $outcome->name . "\n\n\n <br>"; ?>
251 223
 
252 224
 
253 225
 
@@ -260,16 +232,54 @@
260 232
                                             </tbody>
261 233
 
262 234
                                         </table>
235
+
236
+                                        <br>
237
+                                        <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
238
+                                        <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
239
+                                        @if ($formative_actions)
240
+                                            <p style="display: inline;"> <u>{{ $formative_actions[0]->at_text }}:
241
+                                                </u>
242
+
243
+                                                <i>{{ $formative_actions[0]->description }}
244
+                                                </i>
245
+                                            </p>
246
+                                            <br>
247
+                                            <h5 style="display: inline; margin:30px;">Formative Action's Associated
248
+                                                Criteria: </h5>
249
+                                            <ul style="margin:30px;">
250
+                                                @foreach ($formative_actions as $criteria)
251
+                                                    <li> <i>{{ $criteria->name }} <i></li>
252
+
253
+                                                @endforeach
254
+                                            </ul>
255
+
256
+
257
+
258
+                                        @endif
259
+                                        <br>
260
+                                        <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
261
+                                        @if ($activity->assessment_comments != null)
262
+
263
+
264
+                                            <p style="display: inline;">{{ $activity->assessment_comments }}</p>
265
+                                        @endif
263 266
                                         <hr>
264 267
                                         <br>
265 268
 
269
+
270
+
266 271
                                         <h4>Performance of Students by Learning Outcome</h4>
267
-                                        <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
272
+                                        <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
273
+                                        <p style="display: inline;">{{ $activity->name }}
274
+                                            <strong>({{ $activity->date }})</strong>
275
+                                        </p>
276
+                                        <br>
277
+                                        <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
268 278
                                         <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
269 279
                                         </p>
270 280
                                         <br>
271 281
                                         <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
272
-                                            target by outcome: </h5>
282
+                                            target by learning outcome: </h5>
273 283
                                         <p style="display: inline;"> <i>
274 284
                                                 <?php
275 285
                                                 $expected = DB::table('target_outcomes_program')
@@ -279,6 +289,9 @@
279 289
                                                 if (!$expected) {
280 290
                                                     $expected = 'It has not been defined in the annual plan';
281 291
                                                 }
292
+                                                else{
293
+                                            $expected = $expected->expected_target;
294
+                                        }
282 295
                                                 ?>
283 296
                                                 {{ $expected }}
284 297
                                             </i>
@@ -288,7 +301,7 @@
288 301
                                             <thead>
289 302
                                                 <tr>
290 303
                                                     <th>
291
-                                                        Outcome
304
+                                                        Learning Outcome
292 305
                                                     </th>
293 306
                                                     <th>
294 307
                                                         Number of Students Assessed

+ 3
- 3
app/views/local/managers/sCoords/objectives.blade.php 查看文件

@@ -103,7 +103,7 @@
103 103
                         <div class="form-group">
104 104
                             <label>Associated Outcome</label>
105 105
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
106
-                            <select id="'assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
106
+                            <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
107 107
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
108 108
                                 @foreach ($outcomes as $outcome)
109 109
                                     <option value="{{ $outcome->id }}">
@@ -233,8 +233,8 @@
233 233
 
234 234
 
235 235
         function fetchAllObjectives(program, outcome) {
236
-            var program_id_fetch = $('#' + program).find(':selected').val();
237
-            var outcome_fetch = $('#' + outcome).find(':selected').val();
236
+            var program_id_fetch = $('#' + program).val();
237
+            var outcome_fetch = $('#' + outcome).val();
238 238
             $.post(
239 239
                 "{{ URL::action('Objective2Controller@fetchAllObjectives') }}", {
240 240
                     program_fetch: program_id_fetch,

+ 818
- 560
app/views/local/managers/shared/annual-plans.blade.php
文件差異過大導致無法顯示
查看文件


+ 18
- 7
app/views/local/managers/shared/annual_report.blade.php 查看文件

@@ -113,13 +113,15 @@
113 113
             var name = $(li).data('outcome-name');
114 114
             var semester_id = $(li).data('semester-id');
115 115
             var annual_plan_id = $(li).data('annual-plan');
116
+            var typ_semester_outcome_id = $(li).data('typ-semester-outcome-id');
116 117
             $('#theChange').data('annual-plan', annual_plan);
117 118
             $.post(
118 119
                 "{{ URL::action('AnnualPlansController@fetchReportWithOutcome') }}", {
119 120
                     semester_id: semester_id,
120 121
                     outcome_id: outcome_id,
121 122
                     program_id: {{ $program->id }},
122
-                    annual_plan_id: annual_plan_id
123
+                    annual_plan_id: annual_plan_id,
124
+                    typ_semester_outcome_id: typ_semester_outcome_id
123 125
                 },
124 126
                 function(outcome) {
125 127
                     if (outcome.objectives) {
@@ -129,11 +131,17 @@
129 131
                         $('#allLists').empty();
130 132
                         $('#levelTabs').empty();
131 133
                         $('.no-outcome').hide();
134
+                        if(outcome.outcome_program_goal){
135
+                            outcome.outcome_program_goal = outcome.outcome_program_goal.expected_target;
136
+                        }
137
+                        else{
138
+                            outcome.outcome_program_goal ='It has not been defined';
139
+                        }
132 140
                         var outcomeHTML = "<h4>Performance of Students by Learning Outcome</h4>" +
133
-                            '<h5 style = "display: inline; margin:30px;">Target by outcome: </h5>' +
141
+                            '<h5 style = "display: inline; margin:30px;">Target learning by learning outcome: </h5>' +
134 142
                             '<p  style = "display: inline;"> <i>>= ' + outcome.expected_outcome +
135 143
                             ' of the attempts</i>' + '</p>' +
136
-                            '<br><h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by outcome: </h5>' +
144
+                            '<br><h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by learning outcome: </h5>' +
137 145
                             '<p  style = "display: inline;"> <i>' + outcome.outcome_program_goal + '</i></p>';
138 146
                         $('#outcomeInfo').html('<p class="outcome-definition">' + outcome.definition + '</p>' +
139 147
                             outcomeHTML);
@@ -302,7 +310,7 @@
302 310
 
303 311
                         if (students_attempted) {
304 312
                             studentPercentage = ((students_achieved / students_attempted) * 100).toFixed(2);
305
-                            if (studentPercentage >= outcome.outcome_program_goal) {
313
+                            if (parseFloat(studentPercentage) >= parseFloat(outcome.outcome_program_goal)) {
306 314
                                 FinalReport = "<br><p><strong>The students achieved the Learning Outcome with " +
307 315
                                     studentPercentage + "% of students achieving.</strong></p>";
308 316
                             } else {
@@ -518,6 +526,7 @@
518 526
                         'class': 'list-group',
519 527
                         'id': 'list'
520 528
                     });
529
+                    if(json.outcomes.first){
521 530
                     header5 = $('<h5/>', {
522 531
                         'style': "padding-left: 10px"
523 532
                     }).html("First Semester");
@@ -526,13 +535,15 @@
526 535
                     for (outcome in json.outcomes.first) {
527 536
                         list +=
528 537
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
529
-                            json.annual_plans.id + "' data-semester-id = '" + json.allSemesterOrder.first.id +
538
+                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"' data-semester-id = '" + json.allSemesterOrder.first.id +
530 539
                             "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" + json
531 540
                             .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[outcome]
532 541
                             .name + " </li>";
533 542
 
534 543
                     }
535 544
                     div.append(list);
545
+                    }
546
+                    if(json.outcomes.second){
536 547
                     header4 = $('<h5/>', {
537 548
                         'style': "padding-left: 10px"
538 549
                     }).html("Second Semester");
@@ -541,13 +552,13 @@
541 552
                     for (outcome in json.outcomes.second) {
542 553
                         list +=
543 554
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
544
-                            json.annual_plans.id + "' data-semester-id = '" + json.allSemesterOrder.second.id +
555
+                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"'data-semester-id = '" + json.allSemesterOrder.second.id +
545 556
                             "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" + json
546 557
                             .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
547 558
                                 outcome].name + " </li>";
548 559
 
549 560
                     }
550
-                    div.append(list);
561
+                    div.append(list);}
551 562
                     html = div[0].innerHTML;
552 563
 
553 564
                     $("#allOutcomes").html(div[0].innerHTML);

+ 22
- 17
app/views/local/managers/shared/rubric_list.blade.php 查看文件

@@ -1,14 +1,16 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-@if($role==1)
5
-@include('local.managers.admins._navigation')
6
-@elseif($role==2)
7
-@include('local.managers.sCoords._navigation')
8
-@elseif($role==3)
9
-@include('local.managers.pCoords._navigation')
10
-@endif
11
-   
4
+    @if ($role == 1)
5
+        @include('local.managers.admins._navigation')
6
+    @elseif($role == 2)
7
+        @include('local.managers.sCoords._navigation')
8
+    @elseif($role == 3)
9
+        @include('local.managers.pCoords._navigation')
10
+    @elseif($role == 4)
11
+        @include('local.professors._navigation')
12
+    @endif
13
+
12 14
 @stop
13 15
 
14 16
 @section('main')
@@ -24,17 +26,20 @@
24 26
             </thead>
25 27
             <tfoot>
26 28
                 <tr class="column-search">
27
-                    <td><input class="column-search-bar form-control" type="text" placeholder="Buscar" aria-label="search rubric name"/></td>
28
-                    <td><select class="column-search-select form-control" aria-label="select associated school"><option value=""></option></select></td>
29
+                    <td><input class="column-search-bar form-control" type="text" placeholder="Buscar"
30
+                            aria-label="search rubric name" /></td>
31
+                    <td><select class="column-search-select form-control" aria-label="select associated school">
32
+                            <option value=""></option>
33
+                        </select></td>
29 34
                 </tr>
30 35
             </tfoot>
31 36
             <tbody>
32
-                @foreach($templates as $template)
37
+                @foreach ($templates as $template)
33 38
                     <tr>
34
-                        <td>{{ HTML::linkAction('TemplatesController@show', $template->name, array($template->id)) }}</td>
39
+                        <td>{{ HTML::linkAction('TemplatesController@show', $template->name, [$template->id]) }}</td>
35 40
                         <td>
36
-                            @if($template->school)
37
-                                {{$template->school->name}}
41
+                            @if ($template->school)
42
+                                {{ $template->school->name }}
38 43
                             @else
39 44
                                 All (global)
40 45
                             @endif
@@ -48,7 +53,7 @@
48 53
 
49 54
 @section('included-js')
50 55
 
51
-<!-- Datatables -->
52
-@include('global._datatables_js')
56
+    <!-- Datatables -->
57
+    @include('global._datatables_js')
53 58
 
54
-@stop
59
+@stop

+ 53
- 45
app/views/local/professors/_navigation.blade.php 查看文件

@@ -1,49 +1,57 @@
1 1
 <div class="navbar navbar-inverse navbar-static-top">
2
-  <div class="container-fluid">
3
-    <!--<div class="navbar-header">
4
-      {{ HTML::linkAction('ProfessorsController@overview', 'Online Learning Assessment System · Professor', array() ,array('class'=>'navbar-brand')) }}
2
+    <div class="container-fluid">
3
+        <!--<div class="navbar-header">
4
+      {{ HTML::linkAction('ProfessorsController@overview', 'Online Learning Assessment System · Professor', [], ['class' => 'navbar-brand']) }}
5 5
       <span></span>
6 6
     </div>-->
7
-    <ul class="nav navbar-nav navbar-right">
8
-      <li>{{ HTML::linkAction('ProfessorsController@overview', 'My Courses') }}</li>
9
-      {{-- la linea siguiente comentada es lo que habia originalmente. tanto la linea como este comentario se pueden borrar --}}
10
-      {{-- <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li> --}}
11
-      {{--<li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>--}}
12
-      <li class="dropdown">
13
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
14
-        <ul class="dropdown-menu" role="menu">
15
-          <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
16
-          <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
7
+        <ul class="nav navbar-nav navbar-right">
8
+            <li>{{ HTML::linkAction('ProfessorsController@overview', 'My Courses') }}</li>
9
+            {{-- la linea siguiente comentada es lo que habia originalmente. tanto la linea como este comentario se pueden borrar --}}
10
+            {{-- <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li> --}}
11
+            {{-- <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li> --}}
12
+            <li class="dropdown">
13
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning
14
+                    and Criterias<span class="caret"></span></a>
15
+                <ul class="dropdown-menu" role="menu">
16
+                    <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
17
+                    <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
18
+                </ul>
19
+            </li>
20
+            @if (count(Auth::user()->courses))
21
+                <li class="dropdown">
22
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
23
+                        aria-expanded="false">Sections<span class="caret"></span></a>
24
+                    <ul class="dropdown-menu" role="menu">
25
+                        @foreach ($courses as $course)
26
+                            <li> {{ HTML::linkAction('CoursesController@show', $course->code . $course->number . '-' . $course->section . ' (' . $course->semester->code . ')', ['id' => $course->id]) }}
27
+                            </li>
28
+                        @endforeach
29
+                    </ul>
30
+                </li>
31
+            @endif
32
+            <li> {{ HTML::linkAction('ProfessorsController@program', 'Program') }}</li>
33
+            <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'Results') }}</li>
34
+            <li>{{ HTML::linkAction('TemplatesController@ProfIndex', 'Rubric List') }}</li>
35
+            <li class="dropdown">
36
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span
37
+                        class="caret"></span></a>
38
+                <ul class="dropdown-menu" role="menu">
39
+                    <li>{{ HTML::linkAction('FeedbackController@create', 'Feedback') }}</li>
40
+                    <!-- <li><a href="{{ asset('files/OLAS-intro.pdf') }}">Introduction to OLAS</a></li> -->
41
+                    <li><a href="{{ asset('files/intro-avaluo.pdf') }}">Introduction to Assessment</a></li>
42
+                    <li><a
43
+                            href="http://oeae.uprrp.edu/wp-content/uploads/2019/01/Brochure-de-OLAS-rev.-agosto-2018.pdf">Brochure</a>
44
+                    </li>
45
+                </ul>
46
+            </li>
47
+            <li class="dropdown">
48
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
49
+                    aria-expanded="false">Account<span class="caret"></span></a>
50
+                <ul class="dropdown-menu" role="menu">
51
+                    <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
52
+                    <li>{{ HTML::linkAction('AuthController@logout', 'Log out (' . Auth::user()->email . ')') }}</li>
53
+                </ul>
54
+            </li>
17 55
         </ul>
18
-      </li>
19
-      @if(count(Auth::user()->courses))
20
-      <li class="dropdown">
21
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Sections<span class="caret"></span></a>
22
-        <ul class="dropdown-menu" role="menu">
23
-          @foreach ($courses as $course)
24
-          <li> {{ HTML::linkAction('CoursesController@show', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</li>
25
-          @endforeach
26
-        </ul>
27
-      </li>
28
-      @endif
29
-      <li> {{ HTML::linkAction('ProfessorsController@program', 'Program') }}</li>
30
-      <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'Results') }}</li>
31
-      <li class="dropdown">
32
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span class="caret"></span></a>
33
-        <ul class="dropdown-menu" role="menu">
34
-          <li>{{ HTML::linkAction('FeedbackController@create', 'Feedback') }}</li>
35
-          <!-- <li><a href="{{ asset('files/OLAS-intro.pdf') }}">Introduction to OLAS</a></li> -->
36
-          <li><a href="{{ asset('files/intro-avaluo.pdf') }}">Introduction to Assessment</a></li>
37
-          <li><a href="http://oeae.uprrp.edu/wp-content/uploads/2019/01/Brochure-de-OLAS-rev.-agosto-2018.pdf">Brochure</a></li>
38
-        </ul>
39
-      </li>
40
-      <li class="dropdown">
41
-        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Account<span class="caret"></span></a>
42
-        <ul class="dropdown-menu" role="menu">
43
-          <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
44
-          <li>{{ HTML::linkAction('AuthController@logout', 'Log out ('.Auth::user()->email.')') }}</li>
45
-        </ul>
46
-      </li>
47
-    </ul>
48
-  </div>
49
-</div>
56
+    </div>
57
+</div>

+ 2
- 2
app/views/local/professors/assessment.blade.php 查看文件

@@ -63,7 +63,7 @@
63 63
                     <li>If a student dropped the class, select "N/A" (Not Applicable) for all columns in that student's row.</li>
64 64
                     <li>Cells with "N/A" <strong>will not</strong> be used to determine whether a criterion is achieved. Only scores from 0 to {{$rubric->max_score}} will be considered for this purpose.</li>
65 65
                     <li>For this activity, <strong>at least one score must be from 1-{{$rubric->max_score}}.</strong> Otherwise, the 'Publish Assessment' and 'Save as Draft' buttons will be <strong>disabled</strong>. If you want to delete previously saved scores, go back to the activity and click the "Delete Assessment" button.</li>
66
-
66
+                    <li>If some criterion has more weight on the student's final percentage, you can add it in the 'Weight' box above the criterion but be sure that the sum of criteria weights is equal to 100 (or aproximates it).
67 67
                 </ul>
68 68
             </div>
69 69
 
@@ -84,7 +84,7 @@
84 84
                     <li>Si un estudiante se dio de baja, seleccione "N/A" (No Aplica) en todas las columnas de la fila de ese estudiante.</li>
85 85
                     <li>Las celdas con "N/A" <strong>no</strong> serán utilizadas para determinar si un criterio se alcanzó o no. Solamente las puntuaciones del 0 al {{$rubric->max_score}} serán consideradas.</li>
86 86
                     <li>Para esta actividad, <strong>al menos una puntuación deber ser del 1 al {{$rubric->max_score}}.</strong> De otra manera, el botón para guardar <strong>se desactivará</strong>. Si quiere borrar los resultados del avalúo, vuelva a la actividad y oprima el botón que dice "Delete Assessment".</li>
87
-
87
+                    <li>Si algún criterio tiene más peso en el porcentaje final del estudiante, puedes añadirlo en la caja de "Weight" arriba del criterio deseado, pero debe asegurarse que la suma de los criterios sea igual a cien, o se aproxime. 
88 88
 
89 89
                 </ul>
90 90
             </div>

+ 73
- 9
app/views/local/professors/compare_activities.blade.php 查看文件

@@ -185,7 +185,7 @@
185 185
                                 %
186 186
                             </th>
187 187
                             <th>
188
-                                Outcomes
188
+                                Learning Outcomes
189 189
                             </th>
190 190
                         </tr>
191 191
                     </thead>
@@ -240,16 +240,46 @@
240 240
                     </tbody>
241 241
 
242 242
                 </table>
243
+
244
+                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
245
+                <?php $formative_actions = $activity_1->formativeActionsWithCriteria(); ?>
246
+                @if ($formative_actions)
247
+                    <p style="display: inline;"> <u>{{ $formative_actions[0]->at_text }}:
248
+                        </u>
249
+
250
+                        <i>{{ $formative_actions[0]->description }}
251
+                        </i>
252
+                    </p>
253
+                    <br>
254
+                    <h5 style="display: inline; margin:30px;">Formative Action's Associated
255
+                        Criteria: </h5>
256
+                    <ul style=" margin:30px;">
257
+                        @foreach ($formative_actions as $criteria)
258
+                            <li> <i>{{ $criteria->name }} <i></li>
259
+
260
+                        @endforeach
261
+                    </ul>
262
+                @endif
263
+                <br>
264
+
265
+                <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
266
+                @if ($activity_1->assessment_comments != null)
267
+
268
+
269
+                    <p style="display: inline;">{{ $activity_1->assessment_comments }}</p>
270
+                @endif
243 271
                 <hr>
244 272
                 <br>
245 273
 
246 274
                 <h4>Performance of Students by Learning Outcome</h4>
247
-                <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
275
+
276
+                <h5 style="text-align: center;">{{ $activity_1->name }} </h5>
277
+                <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
248 278
                 <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
249 279
                 </p>
250 280
                 <br>
251 281
                 <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
252
-                    target by outcome: </h5>
282
+                    target by learning outcome: </h5>
253 283
                 <p style="display: inline;"> <i>
254 284
                         <?php
255 285
                         $expected = DB::table('target_outcomes_program')
@@ -259,6 +289,9 @@
259 289
                         if (!$expected) {
260 290
                             $expected = 'It has not been defined in the annual plan';
261 291
                         }
292
+                        else{
293
+                                            $expected = $expected->expected_target;
294
+                                        }
262 295
                         
263 296
                         ?>
264 297
                         {{ $expected }}
@@ -270,7 +303,7 @@
270 303
                     <thead>
271 304
                         <tr>
272 305
                             <th>
273
-                                Outcome
306
+                                Learning Outcome
274 307
                             </th>
275 308
                             <th>
276 309
                                 Number of Students Assessed
@@ -370,6 +403,7 @@
370 403
                 <br>
371 404
                 <br>
372 405
                 <h4>Performance of Students by Learning Outcome Criteria</h4>
406
+                <h5 style="text-align: center;">{{ $activity_2->name }} </h5>
373 407
                 <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
374 408
                 <p style="display: inline;"> <i>{{ $activity_2->rubric[0]->expected_points }} or more</i>
375 409
                 </p>
@@ -395,7 +429,7 @@
395 429
                                 %
396 430
                             </th>
397 431
                             <th>
398
-                                Outcomes
432
+                                Learning Outcomes
399 433
                             </th>
400 434
                         </tr>
401 435
                     </thead>
@@ -437,7 +471,7 @@
437 471
 
438 472
                                     @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
439 473
 
440
-                                        {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
474
+                                        <?php echo $outcome->name . "\n\n\n <br>"; ?>
441 475
 
442 476
 
443 477
 
@@ -450,16 +484,43 @@
450 484
                     </tbody>
451 485
 
452 486
                 </table>
487
+
488
+                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
489
+                <?php $formative_actions = $activity_2->formativeActionsWithCriteria(); ?>
490
+                @if ($formative_actions)
491
+                    <p style="display: inline;"> <u>{{ $formative_actions[0]->at_text }}:
492
+                        </u>
493
+
494
+                        <i>{{ $formative_actions[0]->description }}
495
+                        </i>
496
+                    </p>
497
+                    <br>
498
+                    <h5 style="display: inline; margin:30px;">Formative Action's Associated
499
+                        Criteria: </h5>
500
+                    <ul style=" margin:30px;">
501
+                        @foreach ($formative_actions as $criteria)
502
+                            <li> <i>{{ $criteria->name }} <i></li>
503
+
504
+                        @endforeach
505
+                    </ul>
506
+                @endif
507
+                <br>
508
+                <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
509
+                @if ($activity_2->assessment_comments != null)
510
+
511
+
512
+                    <p style="display: inline;">{{ $activity_2->assessment_comments }}</p>
513
+                @endif
453 514
                 <hr>
454 515
                 <br>
455 516
 
456 517
                 <h4>Performance of Students by Learning Outcome</h4>
457
-                <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
518
+                <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
458 519
                 <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
459 520
                 </p>
460 521
                 <br>
461 522
                 <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
462
-                    target by outcome: </h5>
523
+                    target by learning outcome: </h5>
463 524
                 <p style="display: inline;"> <i>
464 525
                         <?php
465 526
                         $expected = DB::table('target_outcomes_program')
@@ -469,6 +530,9 @@
469 530
                         if (!$expected) {
470 531
                             $expected = 'It has not been defined in the annual plan';
471 532
                         }
533
+                        else{
534
+                                            $expected = $expected->expected_target;
535
+                                        }
472 536
                         ?>
473 537
                         {{ $expected }}
474 538
                     </i>
@@ -478,7 +542,7 @@
478 542
                     <thead>
479 543
                         <tr>
480 544
                             <th>
481
-                                Outcome
545
+                                Learning Outcome
482 546
                             </th>
483 547
                             <th>
484 548
                                 Number of Students Assessed

+ 55
- 44
app/views/local/professors/new_assessment_report.blade.php 查看文件

@@ -49,14 +49,14 @@
49 49
                     <?php
50 50
                     
51 51
                     /*$sections_evaluating = Course::has('activities')
52
-                                                                                       ->whereNotNull('outcomes_attempted')
53
-                                                                                       ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
54
-                                                                                       ->with(array('activities'=>function($query) use(&$outcome){
55
-                                                                                           $query->whereNotNull('outcomes_attempted');
56
-                                                                                           $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
57
-                                                                                       ->where('code', $course->code)->where('number',$course->number)
58
-                                                                                       ->whereIn('semester_id', Session::get('semesters_ids'))
59
-                                                                                       ->get();*/
52
+                                                                                                                                                                                                                                                                                                                                       ->whereNotNull('outcomes_attempted')
53
+                                                                                                                                                                                                                                                                                                                                       ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
54
+                                                                                                                                                                                                                                                                                                                                       ->with(array('activities'=>function($query) use(&$outcome){
55
+                                                                                                                                                                                                                                                                                                                                           $query->whereNotNull('outcomes_attempted');
56
+                                                                                                                                                                                                                                                                                                                                           $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
57
+                                                                                                                                                                                                                                                                                                                                       ->where('code', $course->code)->where('number',$course->number)
58
+                                                                                                                                                                                                                                                                                                                                       ->whereIn('semester_id', Session::get('semesters_ids'))
59
+                                                                                                                                                                                                                                                                                                                                       ->get();*/
60 60
                     
61 61
                     $sections_evaluating = Course::has('activities')
62 62
                     
@@ -152,35 +152,7 @@
152 152
                                 </p>
153 153
 
154 154
                                 <br>
155
-                                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
156
-                                <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
157
-                                @if ($formative_actions)
158
-                                    <p style="display: inline;"> <strong>{{ $formative_actions[0]->at_text }}:
159
-                                        </strong>
160
-
161
-                                        <i>{{ $formative_actions[0]->description }}
162
-                                        </i>
163
-                                    </p>
164
-                                    <br>
165
-                                    <h5>Formative Action's Associated
166
-                                        Criteria: </h5>
167
-                                    <ul>
168
-                                        @foreach ($formative_actions as $criteria)
169
-                                            <li> <i>{{ $criteria->name }} <i></li>
170 155
 
171
-                                        @endforeach
172
-                                    </ul>
173
-
174
-                                @else
175
-                                    <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
176
-
177
-                                @endif
178
-                                @if ($activity->assessment_comments != null)
179
-
180
-                                    <h5 style="display: inline; margin:30px;">Assessment Comments</h5>
181
-                                    <p style="display: inline;">{{ $activity->assessment_comments }}</p>
182
-                                @endif
183
-                                <br>
184 156
 
185 157
                                 <table class='table table-striped table-condensed datatable'>
186 158
                                     <thead>
@@ -198,7 +170,7 @@
198 170
                                                 %
199 171
                                             </th>
200 172
                                             <th>
201
-                                                Outcomes
173
+                                                Learning Outcomes
202 174
                                             </th>
203 175
                                         </tr>
204 176
                                     </thead>
@@ -248,7 +220,7 @@
248 220
 
249 221
                                                     @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
250 222
 
251
-                                                        {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
223
+                                                        <?php echo $outcome->name . "\n\n\n <br>"; ?>
252 224
 
253 225
 
254 226
 
@@ -261,16 +233,50 @@
261 233
                                     </tbody>
262 234
 
263 235
                                 </table>
236
+                                <br>
237
+                                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
238
+                                <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
239
+                                @if ($formative_actions)
240
+                                    <p style="display: inline;"> <u>{{ $formative_actions[0]->at_text }}:
241
+                                        </u>
242
+
243
+                                        <i>{{ $formative_actions[0]->description }}
244
+                                        </i>
245
+                                    </p>
246
+                                    <br>
247
+                                    <h5 style="display: inline; margin:30px;">Formative Action's Associated
248
+                                        Criteria: </h5>
249
+                                    <ul style="margin:30px;">
250
+                                        @foreach ($formative_actions as $criteria)
251
+                                            <li> <i>{{ $criteria->name }} <i></li>
252
+
253
+                                        @endforeach
254
+                                    </ul>
255
+                                @endif
256
+                                <br>
257
+
258
+                                <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
259
+                                @if ($activity->assessment_comments != null)
260
+
261
+
262
+                                    <p style="display: inline;">{{ $activity->assessment_comments }}</p>
263
+                                @endif
264
+                                <br>
264 265
                                 <hr>
265 266
                                 <br>
266 267
 
267 268
                                 <h4>Performance of Students by Learning Outcome</h4>
268
-                                <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
269
+                                <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5><br>
270
+                                <p style="display: inline;">{{ $activity->name }}
271
+                                    <strong>({{ $activity->date }})</strong>
272
+                                </p>
273
+                                <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
269 274
                                 <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
270 275
                                 </p>
271 276
                                 <br>
272
-                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the target
273
-                                    by outcome: </h5>
277
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
278
+                                    target
279
+                                    by learning outcome: </h5>
274 280
                                 <p style="display: inline;"> <i>
275 281
                                         <?php
276 282
                                         $expected = DB::table('target_outcomes_program')
@@ -278,7 +284,11 @@
278 284
                                             ->where('semester_id', $course->semester_id)
279 285
                                             ->first(); //->expected_target;
280 286
                                         if (!$expected) {
281
-                                            $expected = 'It has not been defined in the annual plan';
287
+                                            
288
+                                             $expected = 'It has not been defined in the annual plan';
289
+                                        }
290
+                                        else{
291
+                                            $expected = $expected->expected_target;
282 292
                                         }
283 293
                                         
284 294
                                         ?>
@@ -290,7 +300,7 @@
290 300
                                     <thead>
291 301
                                         <tr>
292 302
                                             <th>
293
-                                                Outcome
303
+                                                Learning Outcome
294 304
                                             </th>
295 305
                                             <th>
296 306
                                                 Number of Students Assessed
@@ -342,8 +352,9 @@
342 352
 
343 353
 
344 354
 
345
-                            @endforeach
346 355
 
356
+
357
+                            @endforeach
347 358
                         @endforeach
348 359
                     </div>
349 360