Browse Source

Quitar los logs

parent
commit
b9e910470c
33 changed files with 746 additions and 785 deletions
  1. 15
    15
      app/controllers/ActivitiesController.php
  2. 26
    26
      app/controllers/AnnualPlansController.php
  3. 2
    2
      app/controllers/CoursesController.php
  4. 12
    12
      app/controllers/CriteriaController.php
  5. 10
    10
      app/controllers/Objective2Controller.php
  6. 5
    5
      app/controllers/OutcomesController.php
  7. 14
    14
      app/controllers/ProfessorsController.php
  8. 30
    30
      app/controllers/ProgramCoordinatorsController.php
  9. 5
    5
      app/controllers/ProgramsController.php
  10. 15
    15
      app/controllers/RubricsController.php
  11. 208
    225
      app/controllers/SchoolCoordinatorsController.php
  12. 265
    287
      app/controllers/SchoolsController.php
  13. 3
    3
      app/controllers/StudentsController.php
  14. 4
    4
      app/controllers/TemplatesController.php
  15. 9
    9
      app/controllers/ThreeYearPlanController.php
  16. 16
    16
      app/controllers/TransformativeActionsController.php
  17. 31
    31
      app/controllers/UsersController.php
  18. 5
    5
      app/models/Activity.php
  19. 26
    26
      app/models/Course.php
  20. 3
    3
      app/models/Objective.php
  21. 5
    5
      app/models/Outcome.php
  22. 2
    2
      app/models/Program.php
  23. 3
    3
      app/views/global/view-learning-outcomes-criteria.blade.php
  24. 5
    5
      app/views/local/managers/admins/assessment_report.blade.php
  25. 1
    1
      app/views/local/managers/admins/new_assessment_report.blade.php
  26. 1
    1
      app/views/local/managers/pCoords/new_assessment_report.blade.php
  27. 2
    2
      app/views/local/managers/pCoords/overview.blade.php
  28. 1
    1
      app/views/local/managers/sCoords/new_assessment_report.blade.php
  29. 3
    3
      app/views/local/managers/shared/limited-course.blade.php
  30. 8
    8
      app/views/local/professors/assessment_report.blade.php
  31. 2
    2
      app/views/local/professors/compare_activities.blade.php
  32. 2
    2
      app/views/local/professors/new_assessment_report.blade.php
  33. 7
    7
      app/views/local/professors/overview.blade.php

+ 15
- 15
app/controllers/ActivitiesController.php View File

137
             $active_semesters[] = $active_semester->id;
137
             $active_semesters[] = $active_semester->id;
138
         }
138
         }
139
 
139
 
140
-        Log::info($active_semesters);
140
+        //Log::info($active_semesters);
141
         // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
141
         // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
142
         $title = $course->code . $course->number . '-' . $course->section . ': ' . htmlspecialchars($activity->name, ENT_QUOTES) . ' <span class="small attention">(' . $course->semester->code . ')</span>';
142
         $title = $course->code . $course->number . '-' . $course->section . ': ' . htmlspecialchars($activity->name, ENT_QUOTES) . ' <span class="small attention">(' . $course->semester->code . ')</span>';
143
 
143
 
170
             $outcomes_attempted = [];
170
             $outcomes_attempted = [];
171
         }
171
         }
172
 
172
 
173
-        Log::info($outcomes_achieved);
174
-        Log::info($outcomes_achieved);
173
+        //Log::info($outcomes_achieved);
174
+        //Log::info($outcomes_achieved);
175
 
175
 
176
 
176
 
177
 
177
 
273
                     $activity_id = Input::get('activity_id');
273
                     $activity_id = Input::get('activity_id');
274
                     $student_data = json_decode(Input::get('student_info'));
274
                     $student_data = json_decode(Input::get('student_info'));
275
                     $weights = json_decode(Input::get('weights'));
275
                     $weights = json_decode(Input::get('weights'));
276
-                    Log::info(json_encode($weights));
277
-                    Log::info(json_encode($student_data));
276
+                    //Log::info(json_encode($weights));
277
+                    //Log::info(json_encode($student_data));
278
 
278
 
279
                     foreach ($student_data as $index => $student_dict) {
279
                     foreach ($student_data as $index => $student_dict) {
280
                         $student_id = $student_dict->studentId;
280
                         $student_id = $student_dict->studentId;
303
                     }
303
                     }
304
                     $activity_draft = Input::get('draft');
304
                     $activity_draft = Input::get('draft');
305
                     $activity_diagnostic = Input::get('diagnostic');
305
                     $activity_diagnostic = Input::get('diagnostic');
306
-                    Log::info(json_encode($weights));
306
+                    //Log::info(json_encode($weights));
307
                     foreach ($weights as $act_crit => $weigh) {
307
                     foreach ($weights as $act_crit => $weigh) {
308
                         DB::update("update activity_criterion set weight = {$weigh} where id = {$act_crit}");
308
                         DB::update("update activity_criterion set weight = {$weigh} where id = {$act_crit}");
309
                     }
309
                     }
505
                 return action('ActivitiesController@show', array(Input::get('activity_id')));
505
                 return action('ActivitiesController@show', array(Input::get('activity_id')));
506
             }
506
             }
507
         } catch (Exception $e) {
507
         } catch (Exception $e) {
508
-            Log::info('e:' . $e);
508
+            //Log::info('e:' . $e);
509
             echo $e->getMessage();
509
             echo $e->getMessage();
510
             Session::flash('status', 'danger');
510
             Session::flash('status', 'danger');
511
             Session::flash('message', 'Error saving assessment. Try again later.');
511
             Session::flash('message', 'Error saving assessment. Try again later.');
815
             ->addSelect('activity_criterion.activity_id', 'activity_criterion.weight', 'activity_criterion.id as activity_criterion_id')
815
             ->addSelect('activity_criterion.activity_id', 'activity_criterion.weight', 'activity_criterion.id as activity_criterion_id')
816
             ->addSelect('rubric_criterion.rubric_id', 'rubric_criterion.id as rubric_criterion_id')
816
             ->addSelect('rubric_criterion.rubric_id', 'rubric_criterion.id as rubric_criterion_id')
817
             ->get();
817
             ->get();
818
-        Log::info("EN mi cuarto o o o");
819
-        Log::info($rubric_criterion);
818
+        //Log::info("EN mi cuarto o o o");
819
+        //Log::info($rubric_criterion);
820
 
820
 
821
         foreach ($rubric_criterion as $index => $crit) {
821
         foreach ($rubric_criterion as $index => $crit) {
822
             $crit->scales = DB::table('scales')
822
             $crit->scales = DB::table('scales')
830
 
830
 
831
         // Get results
831
         // Get results
832
         $activity_criterion_ids = DB::table('activity_criterion')->where("activity_id", '=', $activity->id)->lists('id');
832
         $activity_criterion_ids = DB::table('activity_criterion')->where("activity_id", '=', $activity->id)->lists('id');
833
-        Log::info($activity_criterion_ids);
833
+        //Log::info($activity_criterion_ids);
834
         $assessments = DB::table('assessments')
834
         $assessments = DB::table('assessments')
835
             ->join('students', 'assessments.student_id', '=', 'students.id')
835
             ->join('students', 'assessments.student_id', '=', 'students.id')
836
             ->whereIn('activity_criterion_id', $activity_criterion_ids)
836
             ->whereIn('activity_criterion_id', $activity_criterion_ids)
837
             ->orderBy('assessments.id', 'asc')->get();
837
             ->orderBy('assessments.id', 'asc')->get();
838
-        Log::info($assessments);
838
+        //Log::info($assessments);
839
         // Decode the scores (blade workaround)
839
         // Decode the scores (blade workaround)
840
         $scores_array = array();
840
         $scores_array = array();
841
 
841
 
905
         }*/
905
         }*/
906
         // Get results
906
         // Get results
907
         $activity_criterion_ids = DB::table('activity_criterion')->where("activity_id", '=', $activity->id)->lists('id');
907
         $activity_criterion_ids = DB::table('activity_criterion')->where("activity_id", '=', $activity->id)->lists('id');
908
-        Log::info($activity_criterion_ids);
908
+        //Log::info($activity_criterion_ids);
909
         $assessments = DB::table('assessments')
909
         $assessments = DB::table('assessments')
910
             ->join('students', 'assessments.student_id', '=', 'students.id')
910
             ->join('students', 'assessments.student_id', '=', 'students.id')
911
             ->whereIn('activity_criterion_id', $activity_criterion_ids)
911
             ->whereIn('activity_criterion_id', $activity_criterion_ids)
912
             ->orderBy('assessments.id', 'asc')->get();
912
             ->orderBy('assessments.id', 'asc')->get();
913
-        Log::info($assessments);
913
+        //Log::info($assessments);
914
         // Decode the scores (blade workaround)
914
         // Decode the scores (blade workaround)
915
         $scores_array = array();
915
         $scores_array = array();
916
 
916
 
952
 
952
 
953
         $semesters = DB::table('semesters')->where('id', $course->semester_id)->orderBy('start', 'ASC')->first();
953
         $semesters = DB::table('semesters')->where('id', $course->semester_id)->orderBy('start', 'ASC')->first();
954
 
954
 
955
-        Log::info($active_semesters);
955
+        //Log::info($active_semesters);
956
         // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
956
         // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
957
         $title = $course->code . $course->number . '-' . $course->section . ': ' . htmlspecialchars($activity_1->name, ENT_QUOTES) . ' <span class="small attention">(' . $course->semester->code . ')</span>';
957
         $title = $course->code . $course->number . '-' . $course->section . ': ' . htmlspecialchars($activity_1->name, ENT_QUOTES) . ' <span class="small attention">(' . $course->semester->code . ')</span>';
958
         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
958
         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
1002
 
1002
 
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'));
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
+}

+ 26
- 26
app/controllers/AnnualPlansController.php View File

180
       )
180
       )
181
       order by semester_start desc");*/
181
       order by semester_start desc");*/
182
     // $annual_plans = DB::select("select academic_year, semester_start, semester_end, program_id, annual_plans.id as id from annual_plans, annual_cycle where program_id = {$program_id} and annual_cycle.id = annual_plans.annual_cycle_id order by annual_plans.id desc ");
182
     // $annual_plans = DB::select("select academic_year, semester_start, semester_end, program_id, annual_plans.id as id from annual_plans, annual_cycle where program_id = {$program_id} and annual_cycle.id = annual_plans.annual_cycle_id order by annual_plans.id desc ");
183
-    // Log::info($annual_plans);
183
+    // //Log::info($annual_plans);
184
     $outcomes = array();
184
     $outcomes = array();
185
     $allSemesterOrder = array();
185
     $allSemesterOrder = array();
186
-    Log::info($annual_plans);
186
+    //Log::info($annual_plans);
187
     /*foreach ($annual_plans as $an_plan) {
187
     /*foreach ($annual_plans as $an_plan) {
188
-      Log::info($an_plan->id);
188
+      //Log::info($an_plan->id);
189
       $outcomes[$an_plan->id]["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 in (select id from typ_program where program_id ={$an_plan->program_id} and three_year_plan_id ={$current_typ->id} ))");
189
       $outcomes[$an_plan->id]["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 in (select id from typ_program where program_id ={$an_plan->program_id} and three_year_plan_id ={$current_typ->id} ))");
190
       $allSemesterOrder[$an_plan->id]["first"] = DB::select("select * from semesters where id = {$an_plan->semester_start}")[0];
190
       $allSemesterOrder[$an_plan->id]["first"] = DB::select("select * from semesters where id = {$an_plan->semester_start}")[0];
191
       $outcomes[$an_plan->id]["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 in (select id from typ_program where program_id ={$an_plan->program_id} and three_year_plan_id = {$current_typ->id} ))");
191
       $outcomes[$an_plan->id]["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 in (select id from typ_program where program_id ={$an_plan->program_id} and three_year_plan_id = {$current_typ->id} ))");
198
 
198
 
199
   public function fetchInfo()
199
   public function fetchInfo()
200
   {
200
   {
201
-    Log::info(Input::get('id'));
201
+    //Log::info(Input::get('id'));
202
     $an_plan = DB::table("annual_plans")
202
     $an_plan = DB::table("annual_plans")
203
       ->join('annual_cycle', 'annual_cycle.id', '=', 'annual_plans.annual_cycle_id')
203
       ->join('annual_cycle', 'annual_cycle.id', '=', 'annual_plans.annual_cycle_id')
204
       ->where('annual_plans.id', '=', Input::get('id'))
204
       ->where('annual_plans.id', '=', Input::get('id'))
214
       ->where('semester_id', $an_plan->semester_start)
214
       ->where('semester_id', $an_plan->semester_start)
215
       ->select('typ_program.*')
215
       ->select('typ_program.*')
216
       ->first();
216
       ->first();
217
-    Log::info(array($an_plan));
218
-    Log::info(array($current_typ_program));
217
+    //Log::info(array($an_plan));
218
+    //Log::info(array($current_typ_program));
219
 
219
 
220
     //DB::select("select * from typ_program where program_id = {$an_plan->program_id} and three_year_plan_id in (select id from three_year_plan where year_start <= {$years[0]} and year_end>= {$years[1]})")[0];
220
     //DB::select("select * from typ_program where program_id = {$an_plan->program_id} and three_year_plan_id in (select id from three_year_plan where year_start <= {$years[0]} and year_end>= {$years[1]})")[0];
221
 
221
 
285
       $typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.name, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id  from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and 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})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
285
       $typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.name, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id  from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and 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})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
286
 
286
 
287
       $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome where outcome_id = ? and objective_id = {$objective->id})", array(Input::get('id')));
287
       $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome where outcome_id = ? and objective_id = {$objective->id})", array(Input::get('id')));
288
-      Log::info($typ_info['criteria'][$objective->id]);
288
+      //Log::info($typ_info['criteria'][$objective->id]);
289
       $typ_info['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and 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')));
289
       $typ_info['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and 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')));
290
-      Log::info($typ_info['typ_objective_id'][$objective->id]);
290
+      //Log::info($typ_info['typ_objective_id'][$objective->id]);
291
       $typ_info['typ_objective_id'][$objective->id] = $typ_info['typ_objective_id'][$objective->id][0];
291
       $typ_info['typ_objective_id'][$objective->id] = $typ_info['typ_objective_id'][$objective->id][0];
292
 
292
 
293
-      Log::info($typ_info['typ_objective_id'][$objective->id]->id);
294
-      Log::info($annual_plan->id);
293
+      //Log::info($typ_info['typ_objective_id'][$objective->id]->id);
294
+      //Log::info($annual_plan->id);
295
       //  $typ_info['annual_plans_transformative'][$objective->id] = DB::select(
295
       //  $typ_info['annual_plans_transformative'][$objective->id] = DB::select(
296
       //    "select trans_id from annual_plan_transformative
296
       //    "select trans_id from annual_plan_transformative
297
       //     where annual_plan_id={$annual_plan->id} 
297
       //     where annual_plan_id={$annual_plan->id} 
316
       }
316
       }
317
     }
317
     }
318
     $typ_info['annual_plan'] = $annual_plan;
318
     $typ_info['annual_plan'] = $annual_plan;
319
-    Log::info($typ_info);
319
+    //Log::info($typ_info);
320
 
320
 
321
     return json_encode($typ_info);
321
     return json_encode($typ_info);
322
   }
322
   }
431
     foreach ($annual_plan['first']['outcomes'] as $outcomes) {
431
     foreach ($annual_plan['first']['outcomes'] as $outcomes) {
432
 
432
 
433
       $annual_plan['first']['objectives'][$outcomes->id] = 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 = {$outcomes->id} and semester_id = {$an_semesters->semester_start} and typ_program_id in (select id from typ_program where program_id ={$an_semesters->program_id})))");
433
       $annual_plan['first']['objectives'][$outcomes->id] = 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 = {$outcomes->id} and semester_id = {$an_semesters->semester_start} and typ_program_id in (select id from typ_program where program_id ={$an_semesters->program_id})))");
434
-      Log::info($outcomes->id);
435
-      Log::info($annual_plan['first']['objectives'][$outcomes->id]);
434
+      //Log::info($outcomes->id);
435
+      //Log::info($annual_plan['first']['objectives'][$outcomes->id]);
436
       foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
436
       foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
437
         $annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
437
         $annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
438
         $annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number, c.name from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
438
         $annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number, c.name from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
441
           $annual_plan['first']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
441
           $annual_plan['first']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
442
         }
442
         }
443
 
443
 
444
-        Log::info($objective->id);
444
+        //Log::info($objective->id);
445
         /*$annual_plan['first']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id})");
445
         /*$annual_plan['first']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id})");
446
         foreach ($annual_plan['first']['trans_actions'][$objective->id] as $trans) {
446
         foreach ($annual_plan['first']['trans_actions'][$objective->id] as $trans) {
447
-          Log::info($annual_plan['first']['typ_objective_id'][$objective->id]->id);
448
-          Log::info($trans->id);
449
-          Log::info($an_id);
447
+          //Log::info($annual_plan['first']['typ_objective_id'][$objective->id]->id);
448
+          //Log::info($trans->id);
449
+          //Log::info($an_id);
450
           $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id] = DB::select("select * from annual_report_transformative where annual_trans_id in (select id from annual_plan_transformative where trans_id = {$trans->id} and typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id} and annual_plan_id = {$an_id} )");
450
           $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id] = DB::select("select * from annual_report_transformative where annual_trans_id in (select id from annual_plan_transformative where trans_id = {$trans->id} and typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id} and annual_plan_id = {$an_id} )");
451
           if (count($annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id])) {
451
           if (count($annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id])) {
452
-            Log::info("entró");
452
+            //Log::info("entró");
453
             $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id][0];
453
             $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id][0];
454
           }
454
           }
455
         }*/
455
         }*/
467
         }
467
         }
468
         /*
468
         /*
469
         $annual_plan['second']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['second']['typ_objective_id'][$objective->id]->id})");
469
         $annual_plan['second']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['second']['typ_objective_id'][$objective->id]->id})");
470
-        Log::info($annual_plan['second']['typ_objective_id'][$objective->id]->id);
470
+        //Log::info($annual_plan['second']['typ_objective_id'][$objective->id]->id);
471
         foreach ($annual_plan['second']['trans_actions'][$objective->id] as $trans) {
471
         foreach ($annual_plan['second']['trans_actions'][$objective->id] as $trans) {
472
 
472
 
473
           $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id] = DB::select("select * from annual_report_transformative where annual_trans_id in (select id from annual_plan_transformative where trans_id = {$trans->id} and typ_semester_objective_id ={$annual_plan['second']['typ_objective_id'][$objective->id]->id} and annual_plan_id = {$an_id} )");
473
           $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id] = DB::select("select * from annual_report_transformative where annual_trans_id in (select id from annual_plan_transformative where trans_id = {$trans->id} and typ_semester_objective_id ={$annual_plan['second']['typ_objective_id'][$objective->id]->id} and annual_plan_id = {$an_id} )");
474
-          Log::info("lol");
474
+          //Log::info("lol");
475
           if (count($annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id])) {
475
           if (count($annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id])) {
476
-            Log::info("entró");
476
+            //Log::info("entró");
477
             $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id][0];
477
             $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id][0];
478
           }
478
           }
479
         }*/
479
         }*/
556
       ->select('courses.code', 'courses.number')
556
       ->select('courses.code', 'courses.number')
557
       ->distinct()
557
       ->distinct()
558
       ->get();
558
       ->get();
559
-    Log::info($course_codes);
559
+    //Log::info($course_codes);
560
     $all_courses_info = [];
560
     $all_courses_info = [];
561
 
561
 
562
     foreach ($course_codes as $index => $course_code) {
562
     foreach ($course_codes as $index => $course_code) {
569
         ->where('number', $course_code->number)
569
         ->where('number', $course_code->number)
570
         ->where('program_id', $program_id)
570
         ->where('program_id', $program_id)
571
         ->get();
571
         ->get();
572
-      Log::info("run number " . $index);
573
-      Log::info($courses);
572
+      //Log::info("run number " . $index);
573
+      //Log::info($courses);
574
       foreach ($courses as $course) {
574
       foreach ($courses as $course) {
575
         $all_courses_info[$course_code->code . '_' . $course_code->number][] = $course->getReportObject();
575
         $all_courses_info[$course_code->code . '_' . $course_code->number][] = $course->getReportObject();
576
       }
576
       }
606
         ->where('annual_plan_objective.typ_semester_course_id', $course_code->typ_sem_cou_id)
606
         ->where('annual_plan_objective.typ_semester_course_id', $course_code->typ_sem_cou_id)
607
         ->toSql();
607
         ->toSql();
608
 
608
 
609
-      Log::info($course_code->sections);
609
+      //Log::info($course_code->sections);
610
     }*/
610
     }*/
611
 
611
 
612
     return $all_courses_info;
612
     return $all_courses_info;
644
 
644
 
645
     return $outcome;
645
     return $outcome;
646
   }
646
   }
647
-}
647
+}

+ 2
- 2
app/controllers/CoursesController.php View File

108
         $schools = School::all();
108
         $schools = School::all();
109
 
109
 
110
         $rubrics = array();
110
         $rubrics = array();
111
-        Log::info($activities);
111
+        //Log::info($activities);
112
         foreach ($activities as $activity) {
112
         foreach ($activities as $activity) {
113
 
113
 
114
             if (!empty($activity->rubric)) {
114
             if (!empty($activity->rubric)) {
507
         } else {
507
         } else {
508
         }
508
         }
509
     }
509
     }
510
-}
510
+}

+ 12
- 12
app/controllers/CriteriaController.php View File

16
         $userProgram = Auth::user()['id'];
16
         $userProgram = Auth::user()['id'];
17
 
17
 
18
         $userProgram = DB::select("select program_user.program_id from program_user where user_id = {$userProgram}");
18
         $userProgram = DB::select("select program_user.program_id from program_user where user_id = {$userProgram}");
19
-        Log::info($userProgram);
19
+        //Log::info($userProgram);
20
         $title = "Criteria";
20
         $title = "Criteria";
21
         $outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
21
         $outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
22
 
22
 
28
     public function editSchool()
28
     public function editSchool()
29
     {
29
     {
30
         $userSchool = Auth::user()['school_id'];
30
         $userSchool = Auth::user()['school_id'];
31
-        Log::info($userSchool);
31
+        //Log::info($userSchool);
32
         $title = "Criteria";
32
         $title = "Criteria";
33
         $outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
33
         $outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
34
 
34
 
55
         $json_to_send = array();
55
         $json_to_send = array();
56
         $json_to_send['criterion'] = DB::table('criteria')->where('id', '=', Input::get('id'))->first();
56
         $json_to_send['criterion'] = DB::table('criteria')->where('id', '=', Input::get('id'))->first();
57
         $outcomeIDS = DB::table('criterion_objective_outcome')->where('criterion_id', '=', $json_to_send['criterion']->id)->lists('outcome_id');
57
         $outcomeIDS = DB::table('criterion_objective_outcome')->where('criterion_id', '=', $json_to_send['criterion']->id)->lists('outcome_id');
58
-        Log::info($outcomeIDS);
58
+        //Log::info($outcomeIDS);
59
 
59
 
60
         $json_to_send['scales'] = DB::table('criterion_scale')
60
         $json_to_send['scales'] = DB::table('criterion_scale')
61
             ->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
61
             ->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
126
                 break;
126
                 break;
127
         }
127
         }
128
         $outcome_id = Input::get('outcomeID');
128
         $outcome_id = Input::get('outcomeID');
129
-        Log::info($outcome_id);
129
+        //Log::info($outcome_id);
130
 
130
 
131
         $json = DB::table('objectives')
131
         $json = DB::table('objectives')
132
             ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
132
             ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
275
     public function isCriterionUnique($input, $existing_criterion = NULL)
275
     public function isCriterionUnique($input, $existing_criterion = NULL)
276
     {
276
     {
277
         // dd($input);
277
         // dd($input);
278
-        Log::info('isCriterionUnique');
278
+        //Log::info('isCriterionUnique');
279
 
279
 
280
         if (Input::get('program_id') != 0)
280
         if (Input::get('program_id') != 0)
281
             $program_id = $input['program_id'];
281
             $program_id = $input['program_id'];
334
 
334
 
335
         $trimmed = trim(preg_replace('/\t+/', '', Input::get('subcriteria')));
335
         $trimmed = trim(preg_replace('/\t+/', '', Input::get('subcriteria')));
336
 
336
 
337
-        Log::info('trimmed 1 -->' . $trimmed . '<--');
337
+        //Log::info('trimmed 1 -->' . $trimmed . '<--');
338
 
338
 
339
 
339
 
340
         if ($trimmed == '') {
340
         if ($trimmed == '') {
343
             $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
343
             $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
344
         }
344
         }
345
 
345
 
346
-        Log::info('trimmed 2 -->' . $trimmed . '<--');
346
+        //Log::info('trimmed 2 -->' . $trimmed . '<--');
347
 
347
 
348
 
348
 
349
         $clean_input['subcriteria'] = $trimmed;
349
         $clean_input['subcriteria'] = $trimmed;
387
 
387
 
388
         if (isset($clean_input['objective_id'][0]) && $clean_input['objective_id'][0] != '0') {
388
         if (isset($clean_input['objective_id'][0]) && $clean_input['objective_id'][0] != '0') {
389
             $objective_id = $clean_input['objective_id'][0];
389
             $objective_id = $clean_input['objective_id'][0];
390
-            Log::info('Estamos');
390
+            //Log::info('Estamos');
391
         } else {
391
         } else {
392
             $objective_id = NULL;
392
             $objective_id = NULL;
393
         }
393
         }
451
                     return Redirect::to('criteria')->withInput();
451
                     return Redirect::to('criteria')->withInput();
452
 
452
 
453
                 case 2:
453
                 case 2:
454
-                    Log::info(Input::all());
454
+                    //Log::info(Input::all());
455
                     return Redirect::to('school-criteria')->withInput();
455
                     return Redirect::to('school-criteria')->withInput();
456
 
456
 
457
                 case 3:
457
                 case 3:
642
 
642
 
643
         $trimmed = trim(preg_replace('/\t+/', '', Input::get('subcriteria')));
643
         $trimmed = trim(preg_replace('/\t+/', '', Input::get('subcriteria')));
644
 
644
 
645
-        Log::info('trimmed 1 -->' . $trimmed . '<--');
645
+        //Log::info('trimmed 1 -->' . $trimmed . '<--');
646
 
646
 
647
 
647
 
648
         if ($trimmed == '') {
648
         if ($trimmed == '') {
651
             $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
651
             $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
652
         }
652
         }
653
 
653
 
654
-        Log::info('trimmed 2 -->' . $trimmed . '<--');
654
+        //Log::info('trimmed 2 -->' . $trimmed . '<--');
655
 
655
 
656
 
656
 
657
         $clean_input['subcriteria'] = $trimmed;
657
         $clean_input['subcriteria'] = $trimmed;
1073
                 break;
1073
                 break;
1074
         }
1074
         }
1075
     }
1075
     }
1076
-}
1076
+}

+ 10
- 10
app/controllers/Objective2Controller.php View File

22
 	public function isObjectiveUnique($input, $existing_Objective = NULL)
22
 	public function isObjectiveUnique($input, $existing_Objective = NULL)
23
 	{
23
 	{
24
 
24
 
25
-		Log::info('isObjectiveUnique');
25
+		//Log::info('isObjectiveUnique');
26
 
26
 
27
 		if (Input::get('program_id') != 0)
27
 		if (Input::get('program_id') != 0)
28
 			$program_id = $input['program_id'];
28
 			$program_id = $input['program_id'];
78
 
78
 
79
 		$clean_input['outcome_id'] = Input::get('outcome');
79
 		$clean_input['outcome_id'] = Input::get('outcome');
80
 		$counter = Input::get('counter') + 0;
80
 		$counter = Input::get('counter') + 0;
81
-		Log::info($clean_input);
81
+		//Log::info($clean_input);
82
 
82
 
83
 		foreach ($clean_input['outcome_id'] as $index => $outcome_id) {
83
 		foreach ($clean_input['outcome_id'] as $index => $outcome_id) {
84
 			$clean_input['outcome_id'][$index] = trim(preg_replace('/\t+/', '', $clean_input['outcome_id'][$index]));
84
 			$clean_input['outcome_id'][$index] = trim(preg_replace('/\t+/', '', $clean_input['outcome_id'][$index]));
85
 		}
85
 		}
86
 
86
 
87
 		$clean_input['program_id'] = Input::get('program_id');
87
 		$clean_input['program_id'] = Input::get('program_id');
88
-		Log::info(Input::get('program_id'));
88
+		//Log::info(Input::get('program_id'));
89
 
89
 
90
 		return $clean_input;
90
 		return $clean_input;
91
 	}
91
 	}
98
 
98
 
99
 
99
 
100
 		$clean_input['outcome_id'] = Input::get('assoc_outcome');
100
 		$clean_input['outcome_id'] = Input::get('assoc_outcome');
101
-		Log::info(Input::all());
101
+		//Log::info(Input::all());
102
 
102
 
103
 
103
 
104
 		$clean_input['program_id'] = Input::get('program_id');
104
 		$clean_input['program_id'] = Input::get('program_id');
121
 		$json['assessment'] = DB::select("select * from assessments where activity_criterion_id  in (select id from activity_criterion where criterion_id in (select criterion_id from criterion_objective_outcome where objective_id = ?))", array(Input::get('id')));
121
 		$json['assessment'] = DB::select("select * from assessments where activity_criterion_id  in (select id from activity_criterion where criterion_id in (select criterion_id from criterion_objective_outcome where objective_id = ?))", array(Input::get('id')));
122
 
122
 
123
 		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
123
 		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
124
-		Log::info('is here');
124
+		//Log::info('is here');
125
 		return json_encode($json);
125
 		return json_encode($json);
126
 	}
126
 	}
127
 	public function fetchAllobjectives()
127
 	public function fetchAllobjectives()
306
 	public function editProgram()
306
 	public function editProgram()
307
 	{
307
 	{
308
 		$userProgram = Auth::user()['id'];
308
 		$userProgram = Auth::user()['id'];
309
-		Log::info(Auth::user());
309
+		//Log::info(Auth::user());
310
 
310
 
311
 		$userProgram = DB::select("select program_user.program_id from program_user where user_id = {$userProgram}");
311
 		$userProgram = DB::select("select program_user.program_id from program_user where user_id = {$userProgram}");
312
 
312
 
328
 	public function editSchool()
328
 	public function editSchool()
329
 	{
329
 	{
330
 		$userSchool = Auth::user()['school_id'];
330
 		$userSchool = Auth::user()['school_id'];
331
-		Log::info($userSchool);
331
+		//Log::info($userSchool);
332
 		$title = "Objective";
332
 		$title = "Objective";
333
 		$outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->get();
333
 		$outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->get();
334
 
334
 
360
 		$clean_input = $this->cleanAssocInput();
360
 		$clean_input = $this->cleanAssocInput();
361
 
361
 
362
 
362
 
363
-		Log::info(print_r($clean_input, true));
363
+		//Log::info(print_r($clean_input, true));
364
 
364
 
365
 		/** Validation rules */
365
 		/** Validation rules */
366
 		$validator = $this->makeValidator($clean_input);
366
 		$validator = $this->makeValidator($clean_input);
399
 
399
 
400
 
400
 
401
 			/** Set info */
401
 			/** Set info */
402
-			Log::info($clean_input);
402
+			//Log::info($clean_input);
403
 			$Objective->text = $clean_input['text'];
403
 			$Objective->text = $clean_input['text'];
404
 
404
 
405
 
405
 
477
 	{
477
 	{
478
 		//
478
 		//
479
 	}
479
 	}
480
-}
480
+}

+ 5
- 5
app/controllers/OutcomesController.php View File

708
                     ->join('program_criterion', 'program_criterion.program_id', '=', 'programs.id')
708
                     ->join('program_criterion', 'program_criterion.program_id', '=', 'programs.id')
709
                     ->where('criterion_id', $criteria_id->id)
709
                     ->where('criterion_id', $criteria_id->id)
710
                     ->lists('programs.name');
710
                     ->lists('programs.name');
711
-                Log::info($scales);
711
+                //Log::info($scales);
712
 
712
 
713
                 /* $scales =
713
                 /* $scales =
714
                     DB::select(
714
                     DB::select(
985
                     ->groupBy(array('code', 'number'));
985
                     ->groupBy(array('code', 'number'));
986
             }))
986
             }))
987
             ->first();
987
             ->first();
988
-        Log::info($program);
988
+        //Log::info($program);
989
 
989
 
990
 
990
 
991
         return View::make('local.managers.pCoords.new_assessment_report', compact('title', 'program'));
991
         return View::make('local.managers.pCoords.new_assessment_report', compact('title', 'program'));
996
     {
996
     {
997
         $semesters = Session::get('semesters_ids');
997
         $semesters = Session::get('semesters_ids');
998
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
998
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
999
-        Log::info($semesters->start);
999
+        //Log::info($semesters->start);
1000
         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
1000
         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
1001
             ->whereNull('deleted_at')
1001
             ->whereNull('deleted_at')
1002
             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
1002
             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
1003
             ->orderBy('name', 'ASC')->get();
1003
             ->orderBy('name', 'ASC')->get();
1004
 
1004
 
1005
-        Log::info($outcomes);
1005
+        //Log::info($outcomes);
1006
         $title = "My Courses' Assessment Reports";
1006
         $title = "My Courses' Assessment Reports";
1007
 
1007
 
1008
         return View::make('local.professors.assessment_reports', compact('title', 'outcomes'));
1008
         return View::make('local.professors.assessment_reports', compact('title', 'outcomes'));
1088
 
1088
 
1089
         return View::make('local.managers.shared.annual_report', compact('title', 'program_id', 'annual_plans', 'program'));
1089
         return View::make('local.managers.shared.annual_report', compact('title', 'program_id', 'annual_plans', 'program'));
1090
     }
1090
     }
1091
-}
1091
+}

+ 14
- 14
app/controllers/ProfessorsController.php View File

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

+ 30
- 30
app/controllers/ProgramCoordinatorsController.php View File

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

+ 5
- 5
app/controllers/ProgramsController.php View File

11
   {
11
   {
12
 
12
 
13
     $program = Program::find($id);
13
     $program = Program::find($id);
14
-    Log::info(debug_backtrace()[1]['function']);
14
+    //Log::info(debug_backtrace()[1]['function']);
15
     $title = $program->school->name . ': ' . $program->name;
15
     $title = $program->school->name . ': ' . $program->name;
16
     $program_courses = $program->courses;
16
     $program_courses = $program->courses;
17
     //     $outcomes = Outcome::orderBy('name', 'asc')->get();
17
     //     $outcomes = Outcome::orderBy('name', 'asc')->get();
378
 
378
 
379
     $semesters = Session::get('semesters_ids');
379
     $semesters = Session::get('semesters_ids');
380
     $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
380
     $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
381
-    Log::info($semesters->start);
381
+    //Log::info($semesters->start);
382
     $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
382
     $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
383
       ->whereNull('deleted_at')
383
       ->whereNull('deleted_at')
384
       ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
384
       ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
406
       if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
406
       if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
407
         //           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
407
         //           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
408
         $program_array['course_outcomes_attempted'] = $course->outcomes_att();
408
         $program_array['course_outcomes_attempted'] = $course->outcomes_att();
409
-        Log::info($program_array['course_outcomes_achieved']);
409
+        //Log::info($program_array['course_outcomes_achieved']);
410
         foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
410
         foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
411
           if (array_key_exists($i, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$i] += $program_array['course_outcomes_achieved'][$i];
411
           if (array_key_exists($i, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$i] += $program_array['course_outcomes_achieved'][$i];
412
           else $program_array['outcomes_achieved'][$i] = $program_array['course_outcomes_achieved'][$i];
412
           else $program_array['outcomes_achieved'][$i] = $program_array['course_outcomes_achieved'][$i];
496
    */
496
    */
497
   public function fetch()
497
   public function fetch()
498
   {
498
   {
499
-    //Log::info('id:' . Input::get('id'));
499
+    ////Log::info('id:' . Input::get('id'));
500
     return School::find(Input::get('id'))->programs;
500
     return School::find(Input::get('id'))->programs;
501
   }
501
   }
502
-}
502
+}

+ 15
- 15
app/controllers/RubricsController.php View File

33
         $outcomes = Outcome::orderBy('name', 'ASC')->get();
33
         $outcomes = Outcome::orderBy('name', 'ASC')->get();
34
         $criteria = Criterion::orderBy('name', 'ASC')->get();
34
         $criteria = Criterion::orderBy('name', 'ASC')->get();
35
         $rubric = $activity->rubric;
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
 
203
         $activity->save();
203
         $activity->save();
204
 
204
 
205
         // Get all the course's activities
205
         // Get all the course's activities
206
-        Log::info($activity->course);
206
+        //Log::info($activity->course);
207
         $course = Course::find($activity->course->id);
207
         $course = Course::find($activity->course->id);
208
         $activities = $course->activities;
208
         $activities = $course->activities;
209
 
209
 
215
                 break;
215
                 break;
216
             }
216
             }
217
         }
217
         }
218
-        Log::info('entré4???');
218
+        //Log::info('entré4???');
219
 
219
 
220
         //If there are still evaluated activities in the course, recalculate course outcomes
220
         //If there are still evaluated activities in the course, recalculate course outcomes
221
         /*
221
         /*
247
                     }
247
                     }
248
                 }
248
                 }
249
             }
249
             }
250
-            Log::info('entré5???');
250
+            //Log::info('entré5???');
251
             // Update course
251
             // Update course
252
             $course->outcomes_achieved = json_encode($course_outcomes_achieved);
252
             $course->outcomes_achieved = json_encode($course_outcomes_achieved);
253
             $course->outcomes_attempted = json_encode($course_outcomes_attempted);
253
             $course->outcomes_attempted = json_encode($course_outcomes_attempted);
259
 
259
 
260
         $course->save();
260
         $course->save();
261
         */
261
         */
262
-        Log::info('entré6???');
262
+        //Log::info('entré6???');
263
         DB::delete("delete from rubric_criterion where rubric_id ={$rubric->id}");
263
         DB::delete("delete from rubric_criterion where rubric_id ={$rubric->id}");
264
         DB::delete("delete from activity_criterion where activity_id = {$activity->id}");
264
         DB::delete("delete from activity_criterion where activity_id = {$activity->id}");
265
         DB::delete("delete from rubric_title where rubric_id = {$rubric->id}");
265
         DB::delete("delete from rubric_title where rubric_id = {$rubric->id}");
279
         foreach ($titles as $index => $id) {
279
         foreach ($titles as $index => $id) {
280
             DB::insert("insert into rubric_title (`rubric_id`, `title_id`, `position`) values ({$rubric->id},{$id},{$index}) ");
280
             DB::insert("insert into rubric_title (`rubric_id`, `title_id`, `position`) values ({$rubric->id},{$id},{$index}) ");
281
         }
281
         }
282
-        Log::info('entré7???');
282
+        //Log::info('entré7???');
283
 
283
 
284
         DB::commit();
284
         DB::commit();
285
 
285
 
319
     {
319
     {
320
         $activity = Activity::find($activity_id);
320
         $activity = Activity::find($activity_id);
321
         // Get activity's course
321
         // Get activity's course
322
-//         Log::info("actv".$activity);
322
+        //         //Log::info("actv".$activity);
323
         $course = Course::where('id', '=', $activity->course_id)->firstOrFail();
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
         // If activity does not belong to the requesting user, display 403
326
         // If activity does not belong to the requesting user, display 403
327
         if ($course->user_id != Auth::id())
327
         if ($course->user_id != Auth::id())
328
             App::abort('403', 'Access Forbidden');
328
             App::abort('403', 'Access Forbidden');
329
-//         Log::info("rubric".$activity->rubric);
330
-// exit();
329
+        //         //Log::info("rubric".$activity->rubric);
330
+        // exit();
331
         $rubric = Rubric::where('id', '=', $activity->rubric[0]->id)->firstOrFail();
331
         $rubric = Rubric::where('id', '=', $activity->rubric[0]->id)->firstOrFail();
332
         $rubric_criterion = DB::table('criteria')
332
         $rubric_criterion = DB::table('criteria')
333
             ->join('rubric_criterion', 'rubric_criterion.criterion_id', '=', 'criteria.id')
333
             ->join('rubric_criterion', 'rubric_criterion.criterion_id', '=', 'criteria.id')
334
             ->where('rubric_criterion.rubric_id', '=', $activity->rubric[0]->id)
334
             ->where('rubric_criterion.rubric_id', '=', $activity->rubric[0]->id)
335
             ->get();
335
             ->get();
336
-        Log::info($rubric_criterion);
336
+        //Log::info($rubric_criterion);
337
 
337
 
338
         $rubric->titles = DB::table('titles')
338
         $rubric->titles = DB::table('titles')
339
             ->join('rubric_title', 'rubric_title.title_id', '=', 'titles.id')
339
             ->join('rubric_title', 'rubric_title.title_id', '=', 'titles.id')
352
         }
352
         }
353
 
353
 
354
 
354
 
355
-        Log::info($rubric_criterion);
355
+        //Log::info($rubric_criterion);
356
 
356
 
357
         $title = $activity->name . ': ' . $rubric->name;
357
         $title = $activity->name . ': ' . $rubric->name;
358
         return View::make('local.professors.viewrubric', compact('rubric', 'activity', 'rubric_criterion', 'title', 'course'));
358
         return View::make('local.professors.viewrubric', compact('rubric', 'activity', 'rubric_criterion', 'title', 'course'));
470
 
470
 
471
     public function fetchRubricCriterion()
471
     public function fetchRubricCriterion()
472
     {
472
     {
473
-        Log::info(Input::all());
473
+        //Log::info(Input::all());
474
         $rubric = DB::table("criterion_scale")
474
         $rubric = DB::table("criterion_scale")
475
             ->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
475
             ->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
476
             ->where("criterion_id", '=', Input::get('criterion_id'))
476
             ->where("criterion_id", '=', Input::get('criterion_id'))
477
             ->orderBy('position')
477
             ->orderBy('position')
478
             ->get();
478
             ->get();
479
 
479
 
480
-        Log::info($rubric);
480
+        //Log::info($rubric);
481
 
481
 
482
         $rubric["criteria"] = DB::table("criteria")
482
         $rubric["criteria"] = DB::table("criteria")
483
 
483
 

+ 208
- 225
app/controllers/SchoolCoordinatorsController.php View File

5
 
5
 
6
     private function participatingPrograms($school)
6
     private function participatingPrograms($school)
7
     {
7
     {
8
-         return DB::table('programs')
8
+        return DB::table('programs')
9
             ->join('courses', 'courses.program_id', '=', 'programs.id')
9
             ->join('courses', 'courses.program_id', '=', 'programs.id')
10
             ->join('activities', 'activities.course_id', '=', 'courses.id')
10
             ->join('activities', 'activities.course_id', '=', 'courses.id')
11
             ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
11
             ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
16
             ->whereIn('semester_id', Session::get('semesters_ids'))
16
             ->whereIn('semester_id', Session::get('semesters_ids'))
17
             ->lists('id');
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
     public function overview()
28
     public function overview()
29
     {
29
     {
30
         ini_set('memory_limit', '256M');
30
         ini_set('memory_limit', '256M');
31
         DB::connection()->disableQueryLog();
31
         DB::connection()->disableQueryLog();
32
-//         $school = School::find($id);
32
+        //         $school = School::find($id);
33
         $school = Auth::user()->school;
33
         $school = Auth::user()->school;
34
         $id = $school->id;
34
         $id = $school->id;
35
 
35
 
36
         $title = $school->name;
36
         $title = $school->name;
37
         $schools = School::all();
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
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
41
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
42
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
42
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
92
             ->orderBy('courses.semester_id')
92
             ->orderBy('courses.semester_id')
93
             ->get();
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
         // Fetch programs with participation
115
         // Fetch programs with participation
122
         $participating_programs = $this->participatingPrograms($school);
116
         $participating_programs = $this->participatingPrograms($school);
135
         foreach ($school->programs as $program) {
129
         foreach ($school->programs as $program) {
136
             foreach ($program->courses as $course) {
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
 
145
 
153
         // For each outcome 
146
         // For each outcome 
154
         foreach ($outcomes_undergrad as $outcome) {
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
             // For each program with courses that do assessment
170
             // For each program with courses that do assessment
181
             $programs_with_courses = Program::with(array('courses' => function ($query) {
171
             $programs_with_courses = Program::with(array('courses' => function ($query) {
182
                 //                 $query->whereNotNull('outcomes_attempted');
172
                 //                 $query->whereNotNull('outcomes_attempted');
183
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
173
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
184
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
174
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
185
-
186
         }
175
         }
187
 
176
 
188
         /**
177
         /**
191
 
180
 
192
         // For each outcome 
181
         // For each outcome 
193
         foreach ($outcomes_grad as $outcome) {
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
             $programs_with_courses = Program::with(array('courses' => function ($query) {
206
             $programs_with_courses = Program::with(array('courses' => function ($query) {
221
                 //                 $query->whereNotNull('outcomes_attempted');
207
                 //                 $query->whereNotNull('outcomes_attempted');
222
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
208
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
223
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
209
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
224
-
225
         }
210
         }
226
         if ($school->id == 13) {
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
             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'));
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
         } else {
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
             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'));
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
 
362
 
378
         foreach ($school->programs as $program) {
363
         foreach ($school->programs as $program) {
379
             foreach ($program->courses as $course) {
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
         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
417
         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
434
 
418
 
435
         // Fetch programs with participation for the school
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
         $output = array();
431
         $output = array();
448
 
432
 
463
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
447
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
464
 
448
 
465
             foreach ($programs_with_courses as $program) {
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
         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
498
         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
515
 
499
 
516
         // Fetch programs with participation for the school
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
         $output = array();
511
         $output = array();
528
 
512
 
543
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
527
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
544
 
528
 
545
             foreach ($programs_with_courses as $program) {
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
         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'));
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 View File

16
             ->whereIn('semester_id', Session::get('semesters_ids'))
16
             ->whereIn('semester_id', Session::get('semesters_ids'))
17
             ->lists('id');
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
     public function show($id)
28
     public function show($id)
33
         $title = $school->name;
33
         $title = $school->name;
34
         $schools = School::all();
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
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
38
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
39
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
39
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
88
             ->orderBy('courses.number')
88
             ->orderBy('courses.number')
89
             ->orderBy('courses.semester_id')
89
             ->orderBy('courses.semester_id')
90
             ->get();
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
         // Fetch programs with participation
112
         // Fetch programs with participation
119
         $participating_programs = $this->participatingPrograms($school);
113
         $participating_programs = $this->participatingPrograms($school);
131
         foreach ($school->programs as $program) {
125
         foreach ($school->programs as $program) {
132
             foreach ($program->courses as $course) {
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
 
141
 
149
         // For each outcome 
142
         // For each outcome 
150
         foreach ($outcomes_undergrad as $outcome) {
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
             // For each program with courses that do assessment
166
             // For each program with courses that do assessment
177
             $programs_with_courses = Program::with(array('courses' => function ($query) {
167
             $programs_with_courses = Program::with(array('courses' => function ($query) {
178
                 //                 $query->whereNotNull('outcomes_attempted');
168
                 //                 $query->whereNotNull('outcomes_attempted');
179
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
169
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
180
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
170
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
181
-
182
         }
171
         }
183
 
172
 
184
         /**
173
         /**
187
 
176
 
188
         // For each outcome 
177
         // For each outcome 
189
         foreach ($outcomes_grad as $outcome) {
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
             $programs_with_courses = Program::with(array('courses' => function ($query) {
202
             $programs_with_courses = Program::with(array('courses' => function ($query) {
217
                 //                 $query->whereNotNull('outcomes_attempted');
203
                 //                 $query->whereNotNull('outcomes_attempted');
218
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
204
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
219
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
205
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
220
-
221
         }
206
         }
222
         if ($school->id == 13) {
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
             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'));
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
         } else {
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
             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'));
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
         $title = $school->name;
221
         $title = $school->name;
237
         $schools = School::all();
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
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
229
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
245
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
230
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
246
 
231
 
304
          * Calculate how many sections are doing assessment
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
         $undergrad_assessed_sections_count = 0;
294
         $undergrad_assessed_sections_count = 0;
310
         $undergrad_school_sections_count = 0;
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
         $grad_assessed_sections_count = 0;
299
         $grad_assessed_sections_count = 0;
315
         $grad_school_sections_count = 0;
300
         $grad_school_sections_count = 0;
316
 
301
 
317
         foreach ($school->programs as $program) {
302
         foreach ($school->programs as $program) {
318
             foreach ($program->courses as $course) {
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
          */
347
          */
364
 
348
 
365
         // Number of programs that achieved a particular learning outcome
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
         // Number of programs that attempted a particular learning outcome
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
         // Fetch programs with participation for the school
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
         $output = array();
366
         $output = array();
383
 
367
 
384
 
368
 
385
         // For each outcome 
369
         // For each outcome 
386
         foreach ($outcomes_undergrad as $outcome) {
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
             // For each program with courses that do assessment
391
             // For each program with courses that do assessment
411
             $programs_with_courses = Program::with(array('courses' => function ($query) {
392
             $programs_with_courses = Program::with(array('courses' => function ($query) {
412
                 //                 $query->whereNotNull('outcomes_attempted');
393
                 //                 $query->whereNotNull('outcomes_attempted');
414
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
395
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
415
 
396
 
416
             foreach ($programs_with_courses as $program) {
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
          */
443
          */
463
 
444
 
464
         // Number of programs that achieved a particular learning outcome
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
         // Number of programs that attempted a particular learning outcome
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
         // Fetch programs with participation for the school
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
         $output = array();
462
         $output = array();
482
 
463
 
483
 
464
 
484
         // For each outcome 
465
         // For each outcome 
485
         foreach ($outcomes_grad as $outcome) {
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
             $programs_with_courses = Program::with(array('courses' => function ($query) {
485
             $programs_with_courses = Program::with(array('courses' => function ($query) {
508
                 //                 $query->whereNotNull('outcomes_attempted');
486
                 //                 $query->whereNotNull('outcomes_attempted');
509
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
487
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
510
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
488
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
511
 
489
 
512
             foreach ($programs_with_courses as $program) {
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
         if ($school->id == 13) {
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
             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'));
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
         } else {
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
             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'));
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
     }

+ 3
- 3
app/controllers/StudentsController.php View File

56
 
56
 
57
 
57
 
58
           if ($assessment_score) {
58
           if ($assessment_score) {
59
-            Log::info($assessment_score->student_id);
59
+            //Log::info($assessment_score->student_id);
60
 
60
 
61
             $assessments[$activity->id]["criteria"][$ac->id] = $ac;
61
             $assessments[$activity->id]["criteria"][$ac->id] = $ac;
62
             $sum_of_score += $ac->weight * $assessment_score->score;
62
             $sum_of_score += $ac->weight * $assessment_score->score;
130
       // }
130
       // }
131
     } else
131
     } else
132
       $assessments = NULL;
132
       $assessments = NULL;
133
-    Log::info($assessments);
133
+    //Log::info($assessments);
134
 
134
 
135
     return View::make('local.professors.student', compact('student', 'course', 'title', 'assessments'));
135
     return View::make('local.professors.student', compact('student', 'course', 'title', 'assessments'));
136
   }
136
   }
239
 
239
 
240
 
240
 
241
           if ($assessment_score) {
241
           if ($assessment_score) {
242
-            Log::info($assessment_score->student_id);
242
+            //Log::info($assessment_score->student_id);
243
 
243
 
244
             $assessments[$activity->id]["criteria"][$ac->id] = $ac;
244
             $assessments[$activity->id]["criteria"][$ac->id] = $ac;
245
             $sum_of_score += $ac->weight * $assessment_score->score;
245
             $sum_of_score += $ac->weight * $assessment_score->score;

+ 4
- 4
app/controllers/TemplatesController.php View File

144
 		$json_to_send["criteria"] = DB::table("criteria")->join('template_criterion', 'template_criterion.criterion_id', '=', 'criteria.id')
144
 		$json_to_send["criteria"] = DB::table("criteria")->join('template_criterion', 'template_criterion.criterion_id', '=', 'criteria.id')
145
 			->where("template_criterion.template_id", '=', $template_id)
145
 			->where("template_criterion.template_id", '=', $template_id)
146
 			->get();
146
 			->get();
147
-		Log::info($json_to_send["criteria"]);
147
+		//Log::info($json_to_send["criteria"]);
148
 		foreach ($json_to_send['criteria'] as $criteria) {
148
 		foreach ($json_to_send['criteria'] as $criteria) {
149
 			$json_to_send['scales'][$criteria->criterion_id] = DB::table("scales")
149
 			$json_to_send['scales'][$criteria->criterion_id] = DB::table("scales")
150
 				->join('criterion_scale', 'criterion_scale.scale_id', '=', 'scales.id')
150
 				->join('criterion_scale', 'criterion_scale.scale_id', '=', 'scales.id')
348
 			->orderBy('position')
348
 			->orderBy('position')
349
 			->get();
349
 			->get();
350
 
350
 
351
-		Log::info($template_info);
351
+		//Log::info($template_info);
352
 
352
 
353
 		return json_encode($template_info);
353
 		return json_encode($template_info);
354
 	}
354
 	}
362
 	{
362
 	{
363
 		DB::beginTransaction();
363
 		DB::beginTransaction();
364
 		$template = Template::find(Input::get('id'));
364
 		$template = Template::find(Input::get('id'));
365
-		Log::info(Input::all());
365
+		//Log::info(Input::all());
366
 		$template->name = Input::get('name');
366
 		$template->name = Input::get('name');
367
 
367
 
368
 		$template->is_visible = Input::get('is_visible');
368
 		$template->is_visible = Input::get('is_visible');
537
 			return Redirect::back();
537
 			return Redirect::back();
538
 		}
538
 		}
539
 	}
539
 	}
540
-}
540
+}

+ 9
- 9
app/controllers/ThreeYearPlanController.php View File

23
 
23
 
24
         $Firstsemester = DB::table('semesters')->where('name', '=', $string)->first();
24
         $Firstsemester = DB::table('semesters')->where('name', '=', $string)->first();
25
         $secondSemester = DB::table('semesters')->where('name', '=', $string2)->first();
25
         $secondSemester = DB::table('semesters')->where('name', '=', $string2)->first();
26
-        Log::info($Firstsemester->id);
27
-        Log::info($secondSemester->id);
28
-        Log::info($typ->id);
26
+        //Log::info($Firstsemester->id);
27
+        //Log::info($secondSemester->id);
28
+        //Log::info($typ->id);
29
         DB::insert("insert into typ_semesters (typ_id, semester_id) values ({$typ->id}, {$Firstsemester->id}), ({$typ->id}, {$secondSemester->id})");
29
         DB::insert("insert into typ_semesters (typ_id, semester_id) values ({$typ->id}, {$Firstsemester->id}), ({$typ->id}, {$secondSemester->id})");
30
       }
30
       }
31
       DB::commit();
31
       DB::commit();
35
     } catch (Exception $e) {
35
     } catch (Exception $e) {
36
       Session::flash('status', 'danger');
36
       Session::flash('status', 'danger');
37
       Session::flash('message', "<p>Could not create cycle</p>");
37
       Session::flash('message', "<p>Could not create cycle</p>");
38
-      Log::info($e);
38
+      //Log::info($e);
39
       DB::rollback();
39
       DB::rollback();
40
       return Redirect::to("three-years-plan/{$program_id}");
40
       return Redirect::to("three-years-plan/{$program_id}");
41
     }
41
     }
554
     $count = 0;
554
     $count = 0;
555
     $yearStartPlusOne = $current_typ->year_start + 1;
555
     $yearStartPlusOne = $current_typ->year_start + 1;
556
     $yearStart = $current_typ->year_start;
556
     $yearStart = $current_typ->year_start;
557
-    Log::info($yearStart);
558
-    Log::info($yearStartPlusOne);
557
+    //Log::info($yearStart);
558
+    //Log::info($yearStartPlusOne);
559
     while ($count < 3) {
559
     while ($count < 3) {
560
 
560
 
561
 
561
 
564
 
564
 
565
       $secondSemester = DB::select("select * from semesters where name like 'Second Semester {$yearStart}-{$yearStartPlusOne}'");
565
       $secondSemester = DB::select("select * from semesters where name like 'Second Semester {$yearStart}-{$yearStartPlusOne}'");
566
       if (count($firstSemester) && count($secondSemester)) {
566
       if (count($firstSemester) && count($secondSemester)) {
567
-        Log::info($firstSemester);
568
-        Log::info($secondSemester);
567
+        //Log::info($firstSemester);
568
+        //Log::info($secondSemester);
569
         $query = DB::select("select * from annual_cycle where semester_start ={$firstSemester[0]->id} and semester_end ={$secondSemester[0]->id} ");
569
         $query = DB::select("select * from annual_cycle where semester_start ={$firstSemester[0]->id} and semester_end ={$secondSemester[0]->id} ");
570
         if (!count($query)) {
570
         if (!count($query)) {
571
           DB::insert("insert into annual_cycle (academic_year, semester_start, semester_end) values ('{$yearStart}-{$yearStartPlusOne}', {$firstSemester[0]->id}, {$secondSemester[0]->id})");
571
           DB::insert("insert into annual_cycle (academic_year, semester_start, semester_end) values ('{$yearStart}-{$yearStartPlusOne}', {$firstSemester[0]->id}, {$secondSemester[0]->id})");
626
         }
626
         }
627
       }
627
       }
628
     }
628
     }
629
-    Log::info($typ_semester_outcome);
629
+    //Log::info($typ_semester_outcome);
630
 
630
 
631
 
631
 
632
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
632
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));

+ 16
- 16
app/controllers/TransformativeActionsController.php View File

239
 
239
 
240
     $trimmed = trim(preg_replace('/\t+/', '', Input::get('text')));
240
     $trimmed = trim(preg_replace('/\t+/', '', Input::get('text')));
241
 
241
 
242
-    Log::info('trimmed 1 -->' . $trimmed . '<--');
242
+    //Log::info('trimmed 1 -->' . $trimmed . '<--');
243
 
243
 
244
     // if ($trimmed == '') {
244
     // if ($trimmed == '') {
245
     //     $trimmed = NULL;
245
     //     $trimmed = NULL;
247
     //     $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
247
     //     $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
248
     // }
248
     // }
249
 
249
 
250
-    Log::info('trimmed 2 -->' . $trimmed . '<--');
250
+    //Log::info('trimmed 2 -->' . $trimmed . '<--');
251
 
251
 
252
 
252
 
253
     $clean_input['text'] = $trimmed;
253
     $clean_input['text'] = $trimmed;
255
     //////
255
     //////
256
     $trimmed = trim(preg_replace('/\t+/', '', Input::get('description')));
256
     $trimmed = trim(preg_replace('/\t+/', '', Input::get('description')));
257
 
257
 
258
-    Log::info('trimmed 3 -->' . $trimmed . '<--');
258
+    //Log::info('trimmed 3 -->' . $trimmed . '<--');
259
 
259
 
260
     // if ($trimmed == '') {
260
     // if ($trimmed == '') {
261
     //     $trimmed = NULL;
261
     //     $trimmed = NULL;
263
     //     $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
263
     //     $trimmed = json_encode(preg_split('/\r\n/', $trimmed));
264
     // }
264
     // }
265
 
265
 
266
-    Log::info('trimmed 4 -->' . $trimmed . '<--');
266
+    //Log::info('trimmed 4 -->' . $trimmed . '<--');
267
 
267
 
268
 
268
 
269
     $clean_input['description'] = $trimmed;
269
     $clean_input['description'] = $trimmed;
346
       if ($role != 4) {
346
       if ($role != 4) {
347
         $by_professor = 0;
347
         $by_professor = 0;
348
       }
348
       }
349
-      Log::info($clean_input['courseid']);
349
+      //Log::info($clean_input['courseid']);
350
       // $by_professor = $clean_input['approval'];
350
       // $by_professor = $clean_input['approval'];
351
 
351
 
352
       $parentesis = array('(', ')');
352
       $parentesis = array('(', ')');
728
       ->select('objectives.text as text', 'objectives.id as id')
728
       ->select('objectives.text as text', 'objectives.id as id')
729
       ->orderBy('objectives.text', 'ASC')
729
       ->orderBy('objectives.text', 'ASC')
730
       ->lists('objectives.id');
730
       ->lists('objectives.id');
731
-    Log::info($ta_id);
731
+    //Log::info($ta_id);
732
 
732
 
733
     //$an_objective = $objectives[0]->id;
733
     //$an_objective = $objectives[0]->id;
734
     $outcome_ids = DB::table('objective_outcome')
734
     $outcome_ids = DB::table('objective_outcome')
736
       ->select('objective_outcome.outcome_id')
736
       ->select('objective_outcome.outcome_id')
737
       ->lists('outcome_id');
737
       ->lists('outcome_id');
738
     //$outcome_id = $outcome_id[0]->outcome_id;
738
     //$outcome_id = $outcome_id[0]->outcome_id;
739
-    Log::info("outcomes");
740
-    Log::info($outcome_ids);
739
+    //Log::info("outcomes");
740
+    //Log::info($outcome_ids);
741
     $objectives_from_outcome = DB::table('objectives')
741
     $objectives_from_outcome = DB::table('objectives')
742
       ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
742
       ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
743
       ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
743
       ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
1215
     $title = "Formative Actions";
1215
     $title = "Formative Actions";
1216
     $semesters = Session::get('semesters_ids');
1216
     $semesters = Session::get('semesters_ids');
1217
     $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
1217
     $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
1218
-    Log::info($semesters->start);
1218
+    //Log::info($semesters->start);
1219
     $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
1219
     $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
1220
       ->whereNull('deleted_at')
1220
       ->whereNull('deleted_at')
1221
       ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
1221
       ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
1254
     $semesters = Input::get('semesters');
1254
     $semesters = Input::get('semesters');
1255
     $outcome_id = Input::get('id');
1255
     $outcome_id = Input::get('id');
1256
 
1256
 
1257
-    Log::info($programs);
1258
-    Log::info($semesters);
1257
+    //Log::info($programs);
1258
+    //Log::info($semesters);
1259
 
1259
 
1260
 
1260
 
1261
     /* if (in_array(0, $semesters)) {
1261
     /* if (in_array(0, $semesters)) {
1365
           ->join('criteria','activity_criterion.criterion_id','=','criteria.id')
1365
           ->join('criteria','activity_criterion.criterion_id','=','criteria.id')
1366
           ->where('activity_id', $activity->id)
1366
           ->where('activity_id', $activity->id)
1367
           ->select('criteria')*/
1367
           ->select('criteria')*/
1368
-          //Log::info($activity->trans_action_id);
1368
+          ////Log::info($activity->trans_action_id);
1369
           $activity->criterion_with_objective = DB::table('transformative_activity_criterion')
1369
           $activity->criterion_with_objective = DB::table('transformative_activity_criterion')
1370
             ->join('activity_criterion', 'activity_criterion.id', '=', 'transformative_activity_criterion.activity_criterion_id')
1370
             ->join('activity_criterion', 'activity_criterion.id', '=', 'transformative_activity_criterion.activity_criterion_id')
1371
             ->join('criteria', 'activity_criterion.criterion_id', '=', 'criteria.id')
1371
             ->join('criteria', 'activity_criterion.criterion_id', '=', 'criteria.id')
1380
             ->get();*/
1380
             ->get();*/
1381
 
1381
 
1382
           /*foreach ($activity->objectives as $objective) {
1382
           /*foreach ($activity->objectives as $objective) {
1383
-            // Log::info($activity->activity_id);
1384
-            // Log::info($objective->objective_id);
1385
-            /* Log::info(DB::table('criterion_objective_outcome')
1383
+            // //Log::info($activity->activity_id);
1384
+            // //Log::info($objective->objective_id);
1385
+            /* //Log::info(DB::table('criterion_objective_outcome')
1386
               ->join('activity_criterion', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
1386
               ->join('activity_criterion', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
1387
               ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
1387
               ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
1388
               ->where('activity_criterion.activity_id', $activity->activity_id)
1388
               ->where('activity_criterion.activity_id', $activity->activity_id)
1404
     }
1404
     }
1405
     return $grouped_courses;
1405
     return $grouped_courses;
1406
   }
1406
   }
1407
-}
1407
+}

+ 31
- 31
app/controllers/UsersController.php View File

16
 			->orderBy('surnames')
16
 			->orderBy('surnames')
17
 			->orderBy('first_name')
17
 			->orderBy('first_name')
18
 			->get();
18
 			->get();
19
-		Log::info('LmaOOOOO get cocked');
19
+		//Log::info('LmaOOOOO get cocked');
20
 
20
 
21
 
21
 
22
 		$schools = School::orderBy('name', 'asc')->get();
22
 		$schools = School::orderBy('name', 'asc')->get();
23
 		$access_level  = count(User::select('role')->where('has_access', 1)->groupBy('role')->get());
23
 		$access_level  = count(User::select('role')->where('has_access', 1)->groupBy('role')->get());
24
 		try {
24
 		try {
25
-			Log::info("Schools");
25
+			//Log::info("Schools");
26
 			foreach ($schools as $school) {
26
 			foreach ($schools as $school) {
27
-				Log::info(print_r($school, true));
27
+				//Log::info(print_r($school, true));
28
 			}
28
 			}
29
 			foreach ($users as $user) {
29
 			foreach ($users as $user) {
30
-				Log::info("ID");
31
-				Log::info($user->id);
32
-				Log::info("Name");
33
-				Log::info($user->surname . $user->first_name);
34
-				Log::info("if funciona??");
35
-				Log::info($user->school_id);
36
-				Log::info("elseif??");
37
-				Log::info(count($user->programs));
30
+				//Log::info("ID");
31
+				//Log::info($user->id);
32
+				//Log::info("Name");
33
+				//Log::info($user->surname . $user->first_name);
34
+				//Log::info("if funciona??");
35
+				//Log::info($user->school_id);
36
+				//Log::info("elseif??");
37
+				//Log::info(count($user->programs));
38
 				if ($user->school_id) {
38
 				if ($user->school_id) {
39
-					Log::info("Schoool");
40
-					Log::info($user->school->name);
41
-					Log::info($user->school_id);
39
+					//Log::info("Schoool");
40
+					//Log::info($user->school->name);
41
+					//Log::info($user->school_id);
42
 				} elseif (count($user->programs) > 0) {
42
 				} elseif (count($user->programs) > 0) {
43
-					Log::info("Entre aqui");
44
-					Log::info($user->programs[0]->school_id);
45
-					Log::info($user->programs[0]->school->name);
46
-				} else Log::info("Not so cocked");
43
+					//Log::info("Entre aqui");
44
+					//Log::info($user->programs[0]->school_id);
45
+					//Log::info($user->programs[0]->school->name);
46
+				} else //Log::info("Not so cocked");
47
 
47
 
48
-				Log::info("bueno vamos a ver que hay???");
49
-				Log::info(count($user->programs));
48
+				//Log::info("bueno vamos a ver que hay???");
49
+				//Log::info(count($user->programs));
50
 				if (count($user->programs)) {
50
 				if (count($user->programs)) {
51
 					foreach ($user->programs as $program) {
51
 					foreach ($user->programs as $program) {
52
-						Log::info($program->id);
53
-						Log::info($program->name);
52
+						//Log::info($program->id);
53
+						//Log::info($program->name);
54
 					}
54
 					}
55
-				} else Log::info("Tal vez cocked");
56
-				Log::info("email");
57
-				Log::info($user->email);
58
-				Log::info("Role" . $user->role);
59
-				Log::info($user->office_phone);
60
-				Log::info($user->cell_phone);
55
+				} else //Log::info("Tal vez cocked");
56
+				//Log::info("email");
57
+				//Log::info($user->email);
58
+				//Log::info("Role" . $user->role);
59
+				//Log::info($user->office_phone);
60
+				//Log::info($user->cell_phone);
61
 			}
61
 			}
62
 		} catch (Exception $e) {
62
 		} catch (Exception $e) {
63
-			Log::info("get Cocked" . $e);
63
+			//Log::info("get Cocked" . $e);
64
 		}
64
 		}
65
-		Log::info("el error era en la base de datos XDDDDDDD");
65
+		//Log::info("el error era en la base de datos XDDDDDDD");
66
 
66
 
67
 
67
 
68
 		return View::make('local.managers.admins.users', compact('title', 'users', 'schools', 'access_level'));
68
 		return View::make('local.managers.admins.users', compact('title', 'users', 'schools', 'access_level'));
77
 	public function edit()
77
 	public function edit()
78
 	{
78
 	{
79
 		$user = Auth::user();
79
 		$user = Auth::user();
80
-		Log::info($user);
80
+		//Log::info($user);
81
 		$title = "Profile";
81
 		$title = "Profile";
82
 		$schools = School::orderBy('name', 'asc')->get();
82
 		$schools = School::orderBy('name', 'asc')->get();
83
 		$programs = $user->programs;
83
 		$programs = $user->programs;

+ 5
- 5
app/models/Activity.php View File

220
             ->where('b.score', '>=', $rubric->expected_points);
220
             ->where('b.score', '>=', $rubric->expected_points);
221
         })
221
         })
222
         ->select('a.student_id', DB::raw('count(`a`.`activity_criterion_id`) attempted'), DB::raw('count(`b`.`activity_criterion_id`) achieved'));
222
         ->select('a.student_id', DB::raw('count(`a`.`activity_criterion_id`) attempted'), DB::raw('count(`b`.`activity_criterion_id`) achieved'));
223
-      Log::info($students_attempted->get());*/
223
+      //Log::info($students_attempted->get());*/
224
       $students_attempted = DB::table('assessments as a')
224
       $students_attempted = DB::table('assessments as a')
225
         ->whereIn('a.activity_criterion_id', $ac_criteria)
225
         ->whereIn('a.activity_criterion_id', $ac_criteria)
226
         ->groupBy('a.student_id')
226
         ->groupBy('a.student_id')
235
       $conteo_outcome_achieved = 0;
235
       $conteo_outcome_achieved = 0;
236
 
236
 
237
       foreach ($students_attempted as $student) {
237
       foreach ($students_attempted as $student) {
238
-        Log::info($student->achieved / $student->attempted * 100);
238
+        //Log::info($student->achieved / $student->attempted * 100);
239
         if ($student->achieved / $student->attempted * 100 >= $outcome->expected_outcome) {
239
         if ($student->achieved / $student->attempted * 100 >= $outcome->expected_outcome) {
240
           $conteo_outcome_achieved++;
240
           $conteo_outcome_achieved++;
241
         }
241
         }
299
       $attempted_criteria = count(DB::table('assessments')
299
       $attempted_criteria = count(DB::table('assessments')
300
         ->where('activity_criterion_id', '=', $activity_crit->id)
300
         ->where('activity_criterion_id', '=', $activity_crit->id)
301
         ->lists('student_id'));
301
         ->lists('student_id'));
302
-      Log::info("For activity_crit " . ($activity_crit->id));
302
+      //Log::info("For activity_crit " . ($activity_crit->id));
303
       $percent_for_criteria = ($passed_criteria / $attempted_criteria) * 100;
303
       $percent_for_criteria = ($passed_criteria / $attempted_criteria) * 100;
304
-      Log::info('Percent calculated' . $percent_for_criteria);
304
+      //Log::info('Percent calculated' . $percent_for_criteria);
305
 
305
 
306
 
306
 
307
       $percent_for_criteria = ($passed_criteria / $attempted_criteria) * 100;
307
       $percent_for_criteria = ($passed_criteria / $attempted_criteria) * 100;
414
     //return json_decode($this->outcomes_attempted, true);
414
     //return json_decode($this->outcomes_attempted, true);
415
     return $outcomes_attempted;
415
     return $outcomes_attempted;
416
   }
416
   }
417
-}
417
+}

+ 26
- 26
app/models/Course.php View File

43
       ->select('activities.id')
43
       ->select('activities.id')
44
       ->distinct()
44
       ->distinct()
45
       ->lists('activities.id');
45
       ->lists('activities.id');
46
-    Log::info($activitiesAssessed);
46
+    //Log::info($activitiesAssessed);
47
 
47
 
48
     return $this->hasMany('Activity')->whereIn('activities.id', $activitiesAssessed)->orderBy('date', 'asc');
48
     return $this->hasMany('Activity')->whereIn('activities.id', $activitiesAssessed)->orderBy('date', 'asc');
49
 
49
 
111
         else $outcomes_attempted[$outcome_id] = 1;
111
         else $outcomes_attempted[$outcome_id] = 1;
112
       }
112
       }
113
     }
113
     }
114
-    Log::info("outcomes_attempted");
115
-    Log::info($outcomes_attempted);
114
+    //Log::info("outcomes_attempted");
115
+    //Log::info($outcomes_attempted);
116
 
116
 
117
     return $outcomes_attempted;
117
     return $outcomes_attempted;
118
   }
118
   }
122
       $criteria_id = DB::table('annual_plan_objective')
122
       $criteria_id = DB::table('annual_plan_objective')
123
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
123
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
124
         ->lists('criteria_id');
124
         ->lists('criteria_id');
125
-      Log::info($course_code->typ_semester_course_id);
126
-      Log::info("dame ese id");
125
+      //Log::info($course_code->typ_semester_course_id);
126
+      //Log::info("dame ese id");
127
       $program = Program::where('id', $course_code->program_id)->first();
127
       $program = Program::where('id', $course_code->program_id)->first();
128
-      // Log::info($program->code);
128
+      // //Log::info($program->code);
129
       if ($program->code == "") {
129
       if ($program->code == "") {
130
         $program_ids = DB::table('programs')
130
         $program_ids = DB::table('programs')
131
           ->where('school_id', $program->school->id)
131
           ->where('school_id', $program->school->id)
132
           ->lists('programs.id');
132
           ->lists('programs.id');
133
-        //Log::info("estamos");
133
+        ////Log::info("estamos");
134
       } else $program_ids = array($program->id);
134
       } else $program_ids = array($program->id);
135
 
135
 
136
       /*tabla es asi por curso codigo
136
       /*tabla es asi por curso codigo
168
         ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
168
         ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
169
         ->groupBy('criteria.id');
169
         ->groupBy('criteria.id');
170
 
170
 
171
-      /* Log::info($table_per_criterion->toSql());
172
-      Log::info(array($course_code));
173
-      Log::info($program_ids);
174
-      Log::info($criteria_id);*/
175
-      Log::info('mera 1');
176
-      Log::info(array($course_code));
177
-      Log::info($table_per_criterion->get());
171
+      /* //Log::info($table_per_criterion->toSql());
172
+      //Log::info(array($course_code));
173
+      //Log::info($program_ids);
174
+      //Log::info($criteria_id);*/
175
+      //Log::info('mera 1');
176
+      //Log::info(array($course_code));
177
+      //Log::info($table_per_criterion->get());
178
       return $table_per_criterion->get();
178
       return $table_per_criterion->get();
179
     }
179
     }
180
   }
180
   }
185
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
185
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
186
         ->lists('criteria_id');
186
         ->lists('criteria_id');
187
       $program = Program::where('id', $course_code->program_id)->first();
187
       $program = Program::where('id', $course_code->program_id)->first();
188
-      // // Log::info($program->code);
188
+      // // //Log::info($program->code);
189
       if ($program->code == "") {
189
       if ($program->code == "") {
190
         $program_ids = DB::table('programs')
190
         $program_ids = DB::table('programs')
191
           ->where('school_id', $program->school->id)
191
           ->where('school_id', $program->school->id)
192
           ->lists('programs.id');
192
           ->lists('programs.id');
193
-        //    Log::info("estamos");
193
+        //    //Log::info("estamos");
194
       } else $program_ids = array($program->id);
194
       } else $program_ids = array($program->id);
195
 
195
 
196
-      // Log::info(array($course_code));
196
+      // //Log::info(array($course_code));
197
 
197
 
198
       //Table
198
       //Table
199
       /* Student  criterion_attempted criterion passed
199
       /* Student  criterion_attempted criterion passed
231
 
231
 
232
 
232
 
233
 
233
 
234
-      //Log::info($criteria_id);
234
+      ////Log::info($criteria_id);
235
 
235
 
236
-      //Log::info($program_ids);
236
+      ////Log::info($program_ids);
237
 
237
 
238
-      //Log::info($table_per_student->toSql());
238
+      ////Log::info($table_per_student->toSql());
239
       $students = $table_per_student->get();
239
       $students = $table_per_student->get();
240
 
240
 
241
 
241
 
261
       ->where('courses.id', $this->id)
261
       ->where('courses.id', $this->id)
262
       ->groupBy('criteria.id')
262
       ->groupBy('criteria.id')
263
       ->get();
263
       ->get();
264
-    //Log::info($this->id);
264
+    ////Log::info($this->id);
265
     $reportObject->outcomesReport = DB::table('courses')
265
     $reportObject->outcomesReport = DB::table('courses')
266
       ->join('activities', 'activities.course_id', '=', 'courses.id')
266
       ->join('activities', 'activities.course_id', '=', 'courses.id')
267
       ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
267
       ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
311
       $students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
311
       $students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
312
       $students_achieved = Criterion::students_achieved($criterion->id, $criterion->activity_id);
312
       $students_achieved = Criterion::students_achieved($criterion->id, $criterion->activity_id);
313
 
313
 
314
-      Log::info('estamos aqui');
315
-      Log::info($students_attempted);
314
+      //Log::info('estamos aqui');
315
+      //Log::info($students_attempted);
316
 
316
 
317
       if ($students_attempted) {
317
       if ($students_attempted) {
318
         $percentage_students_who_achieved = 100.0 * $students_achieved / $students_attempted;
318
         $percentage_students_who_achieved = 100.0 * $students_achieved / $students_attempted;
332
         }
332
         }
333
       }
333
       }
334
     }
334
     }
335
-    Log::info(
335
+    //Log::info(
336
       "OUTCOMES_ACHIEVED: "
336
       "OUTCOMES_ACHIEVED: "
337
     );
337
     );
338
-    Log::info(
338
+    //Log::info(
339
       $outcomes_achieved
339
       $outcomes_achieved
340
     );
340
     );
341
     return $outcomes_achieved;
341
     return $outcomes_achieved;
370
       ->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
370
       ->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
371
       ->where('activities.course_id', $this->id)
371
       ->where('activities.course_id', $this->id)
372
       ->count();
372
       ->count();
373
-    //             Log::info("aqui".$assessed);
373
+    //             //Log::info("aqui".$assessed);
374
 
374
 
375
     if ($assessed) return true;
375
     if ($assessed) return true;
376
     else return false;
376
     else return false;

+ 3
- 3
app/models/Objective.php View File

36
             ->where('courses.program_id', $objective->program_id)
36
             ->where('courses.program_id', $objective->program_id)
37
             ->select('courses.code', 'courses.number', 'typ_semester_courses.id as typ_semester_course_id', DB::raw("'{$objective->semester_id}' as semester_id"), "courses.program_id")
37
             ->select('courses.code', 'courses.number', 'typ_semester_courses.id as typ_semester_course_id', DB::raw("'{$objective->semester_id}' as semester_id"), "courses.program_id")
38
             ->get();
38
             ->get();
39
-        Log::info($course_codes);
39
+        //Log::info($course_codes);
40
 
40
 
41
         //$course_codes['studentPerOutcome'] = array();
41
         //$course_codes['studentPerOutcome'] = array();
42
 
42
 
47
                 ->select('transformative_actions.*')
47
                 ->select('transformative_actions.*')
48
                 ->get();
48
                 ->get();
49
             $course_code->students = Course::getStudentReportForOutcome($course_code);
49
             $course_code->students = Course::getStudentReportForOutcome($course_code);
50
-            Log::info(array($course_code));
50
+            //Log::info(array($course_code));
51
             $course_code->criteria = Course::getCriteriaPlanReport($course_code);
51
             $course_code->criteria = Course::getCriteriaPlanReport($course_code);
52
         }
52
         }
53
         return $course_codes;
53
         return $course_codes;
71
     {
71
     {
72
         return $this->hasMany('Objective_Outcome', 'objective_id');
72
         return $this->hasMany('Objective_Outcome', 'objective_id');
73
     }
73
     }
74
-}
74
+}

+ 5
- 5
app/models/Outcome.php View File

36
 			->where('outcome_id', $this->id)
36
 			->where('outcome_id', $this->id)
37
 			->select('objectives.*', 'typ_semester_objectives.id as typ_semester_objective_id', 'program_id', 'semester_id')
37
 			->select('objectives.*', 'typ_semester_objectives.id as typ_semester_objective_id', 'program_id', 'semester_id')
38
 			->distinct();
38
 			->distinct();
39
-		Log::info($objectives->toSql());
40
-		Log::info('semester_program_outcome' . $semester_id . ',' . $program_id . ',' . $this->id);
39
+		//Log::info($objectives->toSql());
40
+		//Log::info('semester_program_outcome' . $semester_id . ',' . $program_id . ',' . $this->id);
41
 
41
 
42
 
42
 
43
 		return $objectives->get();
43
 		return $objectives->get();
221
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
221
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
222
 			->distinct()
222
 			->distinct()
223
 			->get();
223
 			->get();
224
-			
224
+
225
 		$conteo = 0;
225
 		$conteo = 0;
226
 		foreach ($criteria as $criterion) {
226
 		foreach ($criteria as $criterion) {
227
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
227
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
268
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
268
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
269
 			->distinct()
269
 			->distinct()
270
 			->get();
270
 			->get();
271
-			
271
+
272
 		$conteo = 0;
272
 		$conteo = 0;
273
 		foreach ($criteria as $criterion) {
273
 		foreach ($criteria as $criterion) {
274
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
274
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
315
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
315
 			->select('criteria.id', 'expected_percentage', 'activity_criterion.activity_id')
316
 			->distinct()
316
 			->distinct()
317
 			->get();
317
 			->get();
318
-			
318
+
319
 		$conteo = 0;
319
 		$conteo = 0;
320
 		foreach ($criteria as $criterion) {
320
 		foreach ($criteria as $criterion) {
321
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);
321
 			$students_attempted = Criterion::students_attempted($criterion->id, $criterion->activity_id);

+ 2
- 2
app/models/Program.php View File

161
 			->count(DB::raw('DISTINCT criterion_objective_outcome.outcome_id'));
161
 			->count(DB::raw('DISTINCT criterion_objective_outcome.outcome_id'));
162
 
162
 
163
 
163
 
164
-		Log::info(DB::table('activity_criterion')
164
+		//Log::info(DB::table('activity_criterion')
165
 			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
165
 			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
166
 			->join('courses', 'activities.course_id', '=', 'courses.id')
166
 			->join('courses', 'activities.course_id', '=', 'courses.id')
167
 			->join('programs', 'programs.id', '=', 'courses.program_id')
167
 			->join('programs', 'programs.id', '=', 'courses.program_id')
385
 			->orderBy('semester_id')
385
 			->orderBy('semester_id')
386
 			->get();
386
 			->get();
387
 
387
 
388
-		Log::info(Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
388
+		//Log::info(Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
389
 			->with('semester')
389
 			->with('semester')
390
 			->with('program')
390
 			->with('program')
391
 			->where('program_id', $this->id)
391
 			->where('program_id', $this->id)

+ 3
- 3
app/views/global/view-learning-outcomes-criteria.blade.php View File

45
       <div class="list-group" id='list'>
45
       <div class="list-group" id='list'>
46
         @foreach ($outcomes as $outcome)
46
         @foreach ($outcomes as $outcome)
47
           @foreach ($semesters as $semester)
47
           @foreach ($semesters as $semester)
48
-          <?php Log::info($outcome->deactivation_date <= $semester->start)
48
+          <?php //Log::info($outcome->deactivation_date <= $semester->start)
49
           
49
           
50
-        ; Log::info($outcome->deactivation_date);
51
-        Log::info($semester->start) ?>
50
+        ; //Log::info($outcome->deactivation_date);
51
+        //Log::info($semester->start) ?>
52
             @if(!$outcome->deleted_at && ( !$outcome->deactivation_date  ||$outcome->deactivation_date >= $semester->start))
52
             @if(!$outcome->deleted_at && ( !$outcome->deactivation_date  ||$outcome->deactivation_date >= $semester->start))
53
             <!--if(!$outcome->deleted_at && $outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end)-->
53
             <!--if(!$outcome->deleted_at && $outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end)-->
54
               <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }} [{{$semester->code}}]</li>
54
               <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }} [{{$semester->code}}]</li>

+ 5
- 5
app/views/local/managers/admins/assessment_report.blade.php View File

106
                                                 @foreach($section->activities as $activity_index => $activity)
106
                                                 @foreach($section->activities as $activity_index => $activity)
107
                                                         <?php
107
                                                         <?php
108
 
108
 
109
-Log::info($activity->o_att_array);
110
-Log::info(array_key_exists($outcome->id, $activity->o_att_array));
111
-Log::info($activity->o_att_array[$outcome->id] >=1);
112
-Log::info(isset($section)); 
113
-Log::info($activity->rubric[0]);
109
+//Log::info($activity->o_att_array);
110
+//Log::info(array_key_exists($outcome->id, $activity->o_att_array));
111
+//Log::info($activity->o_att_array[$outcome->id] >=1);
112
+//Log::info(isset($section)); 
113
+//Log::info($activity->rubric[0]);
114
 
114
 
115
 ?>
115
 ?>
116
                                                     <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
116
                                                     <!-- If activity has a rubric and the rubric has the outcome being evaluated -->

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

117
                                             <br>
117
                                             <br>
118
                                             <h5 style="display: inline;">Performance Indicators: </h5>
118
                                             <h5 style="display: inline;">Performance Indicators: </h5>
119
                                             <?php
119
                                             <?php
120
-                                            Log::info($activity->rubric[0]);
120
+                                            //Log::info($activity->rubric[0]);
121
                                             ?>
121
                                             ?>
122
                                             <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
122
                                             <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
123
                                                     <?php
123
                                                     <?php

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

101
                                     <br>
101
                                     <br>
102
                                     <h5 style="display: inline;">Performance Indicators: </h5>
102
                                     <h5 style="display: inline;">Performance Indicators: </h5>
103
                                     <?php
103
                                     <?php
104
-                                    Log::info($activity->rubric[0]);
104
+                                    //Log::info($activity->rubric[0]);
105
                                     ?>
105
                                     ?>
106
                                     <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
106
                                     <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
107
                                             <?php
107
                                             <?php

+ 2
- 2
app/views/local/managers/pCoords/overview.blade.php View File

333
                     y:-1
333
                     y:-1
334
                 }, 
334
                 }, 
335
                 <?php
335
                 <?php
336
-                Log::info('program_item');
337
-                Log::info($program_item);
336
+                //Log::info('program_item');
337
+                //Log::info($program_item);
338
 
338
 
339
                 ?>
339
                 ?>
340
                 data: [
340
                 data: [

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

115
                                         <br>
115
                                         <br>
116
                                         <h5 style="display: inline;">Performance Indicators: </h5>
116
                                         <h5 style="display: inline;">Performance Indicators: </h5>
117
                                         <?php
117
                                         <?php
118
-                                        Log::info($activity->rubric[0]);
118
+                                        //Log::info($activity->rubric[0]);
119
                                         ?>
119
                                         ?>
120
                                         <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
120
                                         <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
121
                                                 <?php
121
                                                 <?php

+ 3
- 3
app/views/local/managers/shared/limited-course.blade.php View File

92
                         @foreach($course->activities as $activity)
92
                         @foreach($course->activities as $activity)
93
                         <tr>
93
                         <tr>
94
                             <?php
94
                             <?php
95
-                                Log::info($activity);
96
-                                Log::info($activity->rubric);
95
+                                //Log::info($activity);
96
+                                //Log::info($activity->rubric);
97
                                 $bool = empty($activity->rubric);
97
                                 $bool = empty($activity->rubric);
98
-                                Log::info($bool);
98
+                                //Log::info($bool);
99
                                 
99
                                 
100
                                 ?>
100
                                 ?>
101
                             <td>{{{ $activity->name }}}</td>
101
                             <td>{{{ $activity->name }}}</td>

+ 8
- 8
app/views/local/professors/assessment_report.blade.php View File

76
 
76
 
77
                                     <!-- For each activity in the section -->
77
                                     <!-- For each activity in the section -->
78
                                     @foreach($section->activities as $index4 => $activity)
78
                                     @foreach($section->activities as $index4 => $activity)
79
-<?php Log::info($section); Log::info($section->activities) ;
80
-Log::info($activity->o_att_array);
81
-Log::info("this is the cap_array for ". $activity->name);
82
-Log::info($activity->cap_array);
83
-Log::info('aqui papi');?>
79
+<?php //Log::info($section); //Log::info($section->activities) ;
80
+//Log::info($activity->o_att_array);
81
+//Log::info("this is the cap_array for ". $activity->name);
82
+//Log::info($activity->cap_array);
83
+//Log::info('aqui papi');?>
84
 
84
 
85
                                         <!-- If activity is not draft, has a rubric and the rubric has the outcome being evaluated -->
85
                                         <!-- If activity is not draft, has a rubric and the rubric has the outcome being evaluated -->
86
                                         @if($activity->draft ==0 && $activity->diagnostic ==0&& array_key_exists($outcome->id, (array)$activity->o_att_array))
86
                                         @if($activity->draft ==0 && $activity->diagnostic ==0&& array_key_exists($outcome->id, (array)$activity->o_att_array))
118
                                             <?php
118
                                             <?php
119
                                                 $o_att_array = $activity->o_att_array;
119
                                                 $o_att_array = $activity->o_att_array;
120
                                                 $o_ach_array = $activity->o_ach_array;
120
                                                 $o_ach_array = $activity->o_ach_array;
121
-                                                Log::info($o_att_array);
122
-                                                Log::info($o_ach_array);
123
-                                                Log::info('los outcomes');
121
+                                                //Log::info($o_att_array);
122
+                                                //Log::info($o_ach_array);
123
+                                                //Log::info('los outcomes');
124
                                                 $percentage = ($o_ach_array[$outcome->id]/$o_att_array[$outcome->id])*100;
124
                                                 $percentage = ($o_ach_array[$outcome->id]/$o_att_array[$outcome->id])*100;
125
                                             ?>
125
                                             ?>
126
                                             @if($percentage >= 100)
126
                                             @if($percentage >= 100)

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

129
 
129
 
130
                 <h5 style="display: inline;">Performance Indicators: </h5>
130
                 <h5 style="display: inline;">Performance Indicators: </h5>
131
                 <?php
131
                 <?php
132
-                Log::info($activity_1->rubric[0]);
132
+                //Log::info($activity_1->rubric[0]);
133
                 ?>
133
                 ?>
134
                 <p style="display: inline;"><i>{{ $activity_1->rubric[0]->num_scales }} (
134
                 <p style="display: inline;"><i>{{ $activity_1->rubric[0]->num_scales }} (
135
                         <?php
135
                         <?php
369
 
369
 
370
                 <h5 style="display: inline;">Performance Indicators: </h5>
370
                 <h5 style="display: inline;">Performance Indicators: </h5>
371
                 <?php
371
                 <?php
372
-                Log::info($activity_2->rubric[0]);
372
+                //Log::info($activity_2->rubric[0]);
373
                 ?>
373
                 ?>
374
                 <p style="display: inline;"><i>{{ $activity_2->rubric[0]->num_scales }} (
374
                 <p style="display: inline;"><i>{{ $activity_2->rubric[0]->num_scales }} (
375
                         <?php
375
                         <?php

+ 2
- 2
app/views/local/professors/new_assessment_report.blade.php View File

98
                             <h3 style="text-align: center"> Course: {{ $course->code }}
98
                             <h3 style="text-align: center"> Course: {{ $course->code }}
99
                                 {{ $course->number }}-{{ $section->section }}</h3>
99
                                 {{ $course->number }}-{{ $section->section }}</h3>
100
                             <?php
100
                             <?php
101
-                            Log::info($section->publishedActivities);
101
+                            //Log::info($section->publishedActivities);
102
                             ?>
102
                             ?>
103
                             @foreach ($section->publishedActivities as $index4 => $activity)
103
                             @foreach ($section->publishedActivities as $index4 => $activity)
104
 
104
 
110
                                 <br>
110
                                 <br>
111
                                 <h5 style="display: inline;">Performance Indicators: </h5>
111
                                 <h5 style="display: inline;">Performance Indicators: </h5>
112
                                 <?php
112
                                 <?php
113
-                                Log::info($activity->rubric[0]);
113
+                                //Log::info($activity->rubric[0]);
114
                                 ?>
114
                                 ?>
115
                                 <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
115
                                 <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
116
                                         <?php
116
                                         <?php

+ 7
- 7
app/views/local/professors/overview.blade.php View File

176
                 data:[
176
                 data:[
177
                     @foreach($outcomes as $outcome)
177
                     @foreach($outcomes as $outcome)
178
                     <?php
178
                     <?php
179
-// Log::info($grouped_outcomes_attempted_results[$index]);
180
-// Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
179
+// //Log::info($grouped_outcomes_attempted_results[$index]);
180
+// //Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
181
 // 
181
 // 
182
 
182
 
183
-// Log::info($grouped_course);
184
-// Log::info($outcome->level);
185
-// Log::info($grouped_course->is_graduate);
186
-// Log::info($grouped_course->is_graduate==0);
187
-// Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
183
+// //Log::info($grouped_course);
184
+// //Log::info($outcome->level);
185
+// //Log::info($grouped_course->is_graduate);
186
+// //Log::info($grouped_course->is_graduate==0);
187
+// //Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
188
 //                          
188
 //                          
189
                     ?>
189
                     ?>
190
 					@if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
190
 					@if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))