Explorar el Código

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

Carlos J Corrada Bravo hace 2 años
padre
commit
c5ccfcafaa

+ 7
- 2
app/controllers/ProfessorsController.php Ver fichero

@@ -163,6 +163,11 @@ class ProfessorsController extends \BaseController
163 163
                 }
164 164
             }
165 165
         }*/
166
+        //Log::info($program->courses_students_score_per_outcome);
167
+
168
+        $outcomes_achieved = $program->courses_students_score_per_outcome['program_info']['outcomes_achieved_combined'];
169
+        $outcomes_attempted = $program->courses_students_score_per_outcome['program_info']['outcomes_attempted_combined'];
170
+        /*
166 171
 
167 172
         foreach ($program_courses as $course) {
168 173
 
@@ -192,8 +197,8 @@ class ProfessorsController extends \BaseController
192 197
                 if (array_key_exists($outcome, $program_outcomes_attempted))
193 198
                     $program_outcomes_attempted[$outcome] += $outcome_score['calculations']['student_attempted'];
194 199
                 else $program_outcomes_attempted[$outcome] = $outcome_score['calculations']['student_attempted'];
195
-            }*/
196
-        }
200
+            }
201
+        }*/
197 202
 
198 203
 
199 204
 

+ 10
- 118
app/controllers/ProgramCoordinatorsController.php Ver fichero

@@ -77,139 +77,31 @@ class ProgramCoordinatorsController extends \BaseController
77 77
       $program_array['outcomes_achieved'] = [];
78 78
       $program_array['outcomes_attempted'] = [];
79 79
 
80
-      $program_array['program_outcomes_achieved'] = [];
81
-      $program_array['program_outcomes_attempted'] = [];
80
+      //$program_array['program_outcomes_achieved'] = [];
81
+      //$program_array['program_outcomes_attempted'] = [];
82 82
       //Log::info($program_array);
83 83
 
84 84
       foreach ($outcomes as $outcome) {
85 85
         $program_array['outcomes_achieved'][$outcome->id] = 0;
86 86
         $program_array['outcomes_attempted'][$outcome->id] = 0;
87
-        $program_array['program_outcomes_achieved'][$outcome->id] = 0;
88
-        $program_array['program_outcomes_attempted'][$outcome->id] = 0;
87
+        //$program_array['program_outcomes_achieved'][$outcome->id] = 0;
88
+        //$program_array['program_outcomes_attempted'][$outcome->id] = 0;
89 89
       }
90 90
 
91
-      $program_array['program_outcomes_achieved']  = $program->program_students_per_outcome['program_info']['outcomes_achieved_combined'];
92
-      $program_array['program_outcomes_attempted'] = $program->program_students_per_outcome['program_info']['outcomes_attempted_combined'];
91
+      //$program_array['program_outcomes_achieved']  = $program->program_students_per_outcome['program_info']['outcomes_achieved_combined'];
92
+      //$program_array['program_outcomes_attempted'] = $program->program_students_per_outcome['program_info']['outcomes_attempted_combined'];
93 93
 
94 94
 
95 95
 
96 96
       $program_array['program_courses'] = $program->courses;
97 97
 
98
+      $program_array['assessed_courses_count'] = $program->courses_with_assessment_count->courses_assessed;
98 99
 
99
-      $program_array['assessed_courses_count'] = 0;
100
-      foreach ($program->courses as $course) {
101
-
102
-        $student_report = $course->student_report_for_outcome;
103
-
104
-        if ($student_report) {
105
-
106
-          foreach ($student_report as $outcome_id => $score) {
107
-            if (array_key_exists($outcome_id, $program_array['outcomes_attempted']))  $program_array['outcomes_attempted'][$outcome_id] += $student_report[$outcome_id]['calculations']['student_attempted'];
108
-            else $program_array['outcomes_attempted'][$outcome_id] = $student_report[$outcome_id]['calculations']['student_attempted'];
109
-
110
-            if (array_key_exists($outcome_id, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$outcome_id] += $student_report[$outcome_id]['calculations']['student_achieved'];
111
-            else $program_array['outcomes_achieved'][$outcome_id] = $student_report[$outcome_id]['calculations']['student_achieved'];
112
-          }
113
-          /*
114
-
115
-          $course->with_program_report = 1;
116
-
117
-          $program_student_report = $course->student_report_for_outcome;
100
+      $program_info = $program->courses_students_score_per_outcome['program_info'];
101
+      $program_array['outcomes_attempted'] = $program_info['outcomes_attempted_combined'];
102
+      $program_array['outcomes_achieved'] = $program_info['outcomes_achieved_combined'];
118 103
 
119
-          foreach ($program_student_report as $outcome_id => $score) {
120
-            if (array_key_exists($outcome_id, $program_array['program_outcomes_attempted']))  $program_array['program_outcomes_attempted'][$outcome_id] += $program_student_report[$outcome_id]['calculations']['student_attempted'];
121
-            else $program_array['program_outcomes_attempted'][$outcome_id] = $program_student_report[$outcome_id]['calculations']['student_attempted'];
122
-
123
-            if (array_key_exists($outcome_id, $program_array['program_outcomes_achieved']))  $program_array['program_outcomes_achieved'][$outcome_id] += $program_student_report[$outcome_id]['calculations']['student_achieved'];
124
-            else $program_array['program_outcomes_achieved'][$outcome_id] = $program_student_report[$outcome_id]['calculations']['student_achieved'];
125
-          } */
126
-
127
-
128
-
129
-          $program_array['assessed_courses_count'] += 1;
130
-        }
131
-      }
132 104
 
133
-
134
-
135
-
136
-      /*foreach ($programs as $program) {
137
-      //Log::info($program);
138
-      $program_array = array();
139
-      $program_object = new \stdClass();
140
-      $program_object->name = $program->name;
141
-      $program_object->school = $program->school->name;
142
-      $program_object->id = $program->id;
143
-      $program_array['program'] = $program_object;
144
-      //Log::info($program_array);
145
-
146
-      $program_array['outcomes_achieved'] = [];
147
-      $program_array['outcomes_attempted'] = [];
148
-      //Log::info($program_array);
149
-
150
-      $program_array['program_courses'] = $program->courses;
151
-
152
-
153
-      $program_array['assessed_courses_count'] = 0;
154
-
155
-
156
-      foreach ($program_array['program_courses'] as $course) {
157
-
158
-        //$student_report = $course->student_report_for_outcome;
159
-        //Log::info($program_array);
160
-
161
-        $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
162
-
163
-        //Log::info("course_outcomes_achieved");
164
-        //Log::info($program_array['course_outcomes_achieved']);
165
-        //Log::info($program_array);
166
-        if ($program_array['course_outcomes_achieved']) {
167
-          //(($program_array['course_outcomes_achieved'])) {
168
-          $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
169
-          $program_array['course_outcomes_attempted'] = $course->outcomes_att();
170
-          //Log::info('course_outcomes_achieved');
171
-          //Log::info($program_array['course_outcomes_achieved']);
172
-          //Log::info($program_array);
173
-
174
-          foreach ($program_array['course_outcomes_achieved'] as $outcome_id => $score) {
175
-            if (array_key_exists($outcome_id, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$outcome_id] += $score;
176
-            else $program_array['outcomes_achieved'][$outcome_id] = $score;
177
-            //Log::info('program["outcomes_achieved"]');
178
-            //Log::info($program_array['outcomes_achieved'][$i]);
179
-            //Log::info($program_array);
180
-            Log::info("outcomes_achieved");
181
-            Log::info($program_array['outcomes_achieved']);
182
-          }
183
-          foreach ($program_array['course_outcomes_attempted'] as $i => $score) {
184
-
185
-            if (array_key_exists($i, $program_array['outcomes_attempted']))  $program_array['outcomes_attempted'][$i] += $program_array['course_outcomes_attempted'][$i];
186
-            else $program_array['outcomes_attempted'][$i] = $program_array['course_outcomes_attempted'][$i];
187
-            //Log::info('program["outcomes_achieved"]');
188
-            //Log::info($program_array['outcomes_attempted'][$i]);
189
-            //Log::info($program_array);
190
-          }
191
-
192
-          $program_array['assessed_courses_count'] += 1;
193
-        }
194
-      }*/
195
-
196
-
197
-      /**
198
-       * List of grouped courses (grouped sections)
199
-       */
200
-
201
-      //old code
202
-      /* $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
203
-        ->with('semester')
204
-        ->with('program')
205
-        ->where('program_id', $program->id)
206
-        ->whereIn('semester_id', Session::get('semesters_ids'))
207
-        ->groupBy(array('code', 'number', 'semester_id'))
208
-        ->orderBy('code')
209
-        ->orderBy('number')
210
-        ->orderBy('semester_id')
211
-        ->get(); */
212
-      //Log::info($program_array);
213 105
       $program_array['grouped_courses'] = Course::select(DB::raw('name, code, number, semester_id, program_id'))
214 106
         ->with('semester')
215 107
         ->with('program')

+ 109
- 15
app/controllers/ProgramsController.php Ver fichero

@@ -58,7 +58,7 @@ class ProgramsController extends \BaseController
58 58
     $outcomes_attempted = [];
59 59
     $outcomes_achieved = [];
60 60
 
61
-    $program_info = $program->program_students_per_outcome;
61
+    $program_info = $program->courses_students_score_per_outcome;
62 62
 
63 63
     $outcomes_attempted = $program_info['program_info']['outcomes_attempted_combined'];
64 64
     $outcomes_achieved = $program_info['program_info']['outcomes_achieved_combined'];
@@ -352,6 +352,10 @@ class ProgramsController extends \BaseController
352 352
   {
353 353
     return strcmp($a->name, $b->name);
354 354
   }
355
+  public function studentsProgramAssessmentReportForProfessors($program_id)
356
+  {
357
+    return $this->studentProgramAssessmentReport($program_id);
358
+  }
355 359
 
356 360
   public function studentProgramAssessmentReport($program_id)
357 361
   {
@@ -407,7 +411,7 @@ class ProgramsController extends \BaseController
407 411
 
408 412
     $grouped_courses = Course::
409 413
       //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
410
-      select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
414
+      select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id, 1 as grouped'))
411 415
       ->with('semester')
412 416
       ->with('program')
413 417
       ->whereIn('courses.program_id', $programs_ids)
@@ -423,6 +427,7 @@ class ProgramsController extends \BaseController
423 427
     $role = Auth::user()->role;
424 428
 
425 429
     $users = array();
430
+    /*
426 431
 
427 432
 
428 433
     $resultados_todos_obj = DB::table('assessments')
@@ -458,7 +463,7 @@ class ProgramsController extends \BaseController
458 463
       if ($resultado->score >= $resultado->expected_points) {
459 464
         $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']++;
460 465
       }
461
-    }
466
+    }*//*
462 467
 
463 468
     $outcomes_colap = array();
464 469
     $programs = array();
@@ -557,7 +562,7 @@ class ProgramsController extends \BaseController
557 562
         }
558 563
       }
559 564
       $i++;
560
-    }
565
+    }/*
561 566
     usort($outcomes_colap, array($this, "cmp"));
562 567
     // 		var_dump($outcomes_attempted_colap); print "<br>";
563 568
     // 		var_dump($outcomes_achieved_colap); print "<br>";
@@ -574,6 +579,7 @@ class ProgramsController extends \BaseController
574 579
         $outcomes_achieved_colap_todo[$out] += $outcomes_achieved_colap[$program_id][$out];
575 580
       }
576 581
     }
582
+    /*
577 583
     $outcomes_attempted_todo = array();
578 584
     $outcomes_achieved_todo = array();
579 585
     foreach ($outcomes_attempted as $program_id => $out_res) {
@@ -585,11 +591,16 @@ class ProgramsController extends \BaseController
585 591
         $outcomes_attempted_todo[$out] += $outcomes_attempted[$program_id][$out];
586 592
         $outcomes_achieved_todo[$out] += $outcomes_achieved[$program_id][$out];
587 593
       }
588
-    }
589
-    $outcomes_attempted_colap = $outcomes_attempted_colap_todo;
590
-    $outcomes_achieved_colap = $outcomes_achieved_colap_todo;
591
-    $outcomes_attempted = $outcomes_attempted_todo;
592
-    $outcomes_achieved = $outcomes_achieved_todo;
594
+    }*/
595
+    $program_info = $program->program_students_per_outcome['program_info'];
596
+
597
+    $outcomes_attempted_colap = $program_info['outcomes_attempted_combined']; // $outcomes_attempted_colap_todo;
598
+    $outcomes_achieved_colap = $program_info['outcomes_achieved_combined']; //$outcomes_achieved_colap_todo;
599
+    $outcomes_attempted = $program_info['outcomes_attempted_uncombined'];
600
+    //$outcomes_attempted_todo;
601
+    $outcomes_achieved = $program_info['outcomes_achieved_uncombined'];
602
+    $outcomes_colap = Outcome::whereNull('new_outcome_id')->get();
603
+    //$outcomes_achieved_todo;
593 604
     // 	var_dump($outcomes_attempted_colap);
594 605
     // 	var_dump($outcomes_attempted_colap);
595 606
     // 	    return View::make('local.managers.shared.school_student_result', compact('title','outcomes_attempted_colap_semesters','outcomes_attempted_semesters','outcomes_attempted_colap_todo','outcomes_achieved_colap_todo','outcomes_attempted_todo','outcomes_achieved_todo','school','programs_name','role','outcomes','outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users','program_courses','grouped_courses'));
@@ -671,6 +682,78 @@ class ProgramsController extends \BaseController
671 682
   //
672 683
   // }
673 684
 
685
+  public function print_program_students($program_id)
686
+  {
687
+    $id = $program_id;
688
+    ini_set('memory_limit', -1);
689
+    ini_set('max_execution_time', 300);
690
+
691
+
692
+    $program = Program::find($program_id);
693
+    $title = $program->school->name . ': ' . $program->name;
694
+    $outcomes = Outcome::orderBy('name', 'asc')->get();
695
+    $schools = School::all();
696
+    $outcomeCount = Outcome::all()->count();
697
+
698
+    // 		var_dump(json_encode($outcomes));
699
+    $role = Auth::user()->role;
700
+
701
+    $programs_ids = array($program->id);
702
+
703
+    $users = User::select('users.*')
704
+      ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
705
+      ->where(function ($query) use ($program) {
706
+        $query
707
+          ->where('school_id', $program->school_id)
708
+          ->where('role', 2);
709
+      })
710
+      ->orWhere(function ($query) use ($program) {
711
+        $query
712
+          ->where('role', 3)
713
+          ->where('program_id', $program->id);
714
+      })
715
+      ->orWhere(function ($query) use ($program) {
716
+        $query
717
+          ->where('role', 4)
718
+          ->where('program_id', $program->id);
719
+      })
720
+      ->get();
721
+
722
+
723
+    $grouped_courses = Course::
724
+      //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
725
+      select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id, 1 as grouped'))
726
+      ->with('semester')
727
+      ->with('program')
728
+      ->whereIn('courses.program_id', $programs_ids)
729
+      ->whereIn('courses.semester_id', Session::get('semesters_ids'))
730
+      ->leftJoin('programs', 'courses.program_id', '=', 'programs.id')
731
+      ->groupBy(array('courses.code', 'courses.number', 'courses.semester_id'))
732
+      ->orderBy('courses.code')
733
+      ->orderBy('courses.number')
734
+      ->orderBy('courses.semester_id')
735
+      ->get();
736
+
737
+
738
+    $role = Auth::user()->role;
739
+
740
+    $users = array();
741
+
742
+    $program_info = $program->program_students_per_outcome['program_info'];
743
+
744
+    $outcomes_attempted_colap = $program_info['outcomes_attempted_combined']; // $outcomes_attempted_colap_todo;
745
+    $outcomes_achieved_colap = $program_info['outcomes_achieved_combined']; //$outcomes_achieved_colap_todo;
746
+    $outcomes_attempted = $program_info['outcomes_attempted_uncombined'];
747
+    //$outcomes_attempted_todo;
748
+    $outcomes_achieved = $program_info['outcomes_achieved_uncombined'];
749
+    $outcomes_colap = Outcome::whereNull('new_outcome_id')->get();
750
+    //$outcomes_achieved_todo;
751
+    // 	var_dump($outcomes_attempted_colap);
752
+    // 	var_dump($outcomes_attempted_colap);
753
+    // 	    return View::make('local.managers.shared.school_student_result', compact('title','outcomes_attempted_colap_semesters','outcomes_attempted_semesters','outcomes_attempted_colap_todo','outcomes_achieved_colap_todo','outcomes_attempted_todo','outcomes_achieved_todo','school','programs_name','role','outcomes','outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users','program_courses','grouped_courses'));
754
+
755
+    return View::make('local.managers.shared.print_program_students', compact('title', 'role', 'outcomes', 'outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'program', 'users', 'program_courses', 'grouped_courses'));
756
+  }
674 757
 
675 758
   /**
676 759
    * Info to print a program
@@ -706,10 +789,20 @@ class ProgramsController extends \BaseController
706 789
 
707 790
     $assessed_courses_count = 0;
708 791
 
709
-    $program_outcomes_attempted = $program->program_students_per_outcomes['program_info']['outcomes_attempted_combined'];
710
-    $program_outcomes_achieved = $program->program_students_per_outcomes['program_info']['outcomes_achieved_combined'];
792
+    //Log::info("Aqui");
793
+    //Log::info($program->program_students_per_outcomes);
794
+    //$program_info =  $program->program_students_per_outcome['program_info'];
711 795
 
796
+    //$program_outcomes_attempted = $program_info['outcomes_attempted_combined'];
797
+    //$program_outcomes_achieved = $program_info['outcomes_achieved_combined'];
712 798
 
799
+    $course_info =  $program->courses_students_score_per_outcome['program_info'];
800
+
801
+
802
+    $outcomes_attempted =  $course_info['outcomes_attempted_combined'];
803
+    $outcomes_achieved = $course_info['outcomes_achieved_combined'];
804
+    $assessed_courses_count = $program->courses_with_assessment_count->courses_assessed;
805
+    /*
713 806
     foreach ($program_courses as $course) {
714 807
 
715 808
 
@@ -742,7 +835,7 @@ class ProgramsController extends \BaseController
742 835
 
743 836
 */
744 837
 
745
-      /*
838
+    /*
746 839
       if ($course->outcomes_att()) {
747 840
         $course_outcomes_attempted = $course->outcomes_att();
748 841
         foreach ($course_outcomes_attempted as $outcome => $score) {
@@ -762,8 +855,9 @@ class ProgramsController extends \BaseController
762 855
           else $outcomes_achieved[$outcome] = $score;
763 856
         }
764 857
       }
765
-      */
858
+      
766 859
     }
860
+    */
767 861
 
768 862
 
769 863
 
@@ -841,7 +935,7 @@ class ProgramsController extends \BaseController
841 935
 
842 936
     $program_array['program_courses'] = $program->courses;
843 937
     // $program_array['grouped_objectives'] = $program->objectives();
844
-
938
+    /*
845 939
     $program_array['assessed_courses_count'] = 0;
846 940
     foreach ($program_array['program_courses'] as $course) {
847 941
       if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
@@ -860,7 +954,7 @@ class ProgramsController extends \BaseController
860 954
 
861 955
         $program_array['assessed_courses_count'] += 1;
862 956
       }
863
-    }
957
+    }*/
864 958
 
865 959
     /**
866 960
      * List of grouped courses (grouped sections)

+ 229
- 75
app/controllers/SchoolsController.php Ver fichero

@@ -39,6 +39,9 @@ class SchoolsController extends \BaseController
39 39
 
40 40
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
41 41
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
42
+        //$school->school_courses_per_outcome;
43
+
44
+
42 45
 
43 46
         //$undergrad_stu_outcome_attempted = [];
44 47
         //$grad_stu_outcome_attempted = [];
@@ -151,14 +154,14 @@ class SchoolsController extends \BaseController
151 154
             ->addSelect('outcome_id')
152 155
             ->groupBy(array('students.id', 'outcome_id'))
153 156
             ->get();
154
-*/
157
+        */
155 158
         //school
156 159
 
157 160
 
158 161
 
159 162
 
160 163
 
161
-        $school_info = $school->school_students_per_outcome;
164
+        $school_info = $school->school_courses_per_outcome;
162 165
         $grad_outcomes_attempted = $school_info['graduate_info']['outcomes_attempted_combined'];
163 166
         $grad_outcomes_achieved = $school_info['graduate_info']['outcomes_achieved_combined'];
164 167
 
@@ -167,7 +170,7 @@ class SchoolsController extends \BaseController
167 170
 
168 171
         $grad_grouped_courses = Course::
169 172
             //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
170
-            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
173
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id, 1 as grouped'))
171 174
             ->with('semester')
172 175
             ->with('program')
173 176
             ->whereIn('courses.program_id', $program_ids)
@@ -182,7 +185,7 @@ class SchoolsController extends \BaseController
182 185
 
183 186
         $undergrad_grouped_courses = Course::
184 187
             //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
185
-            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
188
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id, 1 as grouped'))
186 189
             ->with('semester')
187 190
             ->with('program')
188 191
             ->whereIn('courses.program_id', $program_ids)
@@ -242,12 +245,25 @@ class SchoolsController extends \BaseController
242 245
         }
243 246
 
244 247
 
248
+        //Aqui estan los resultados divididos en outcomes y programs
249
+
250
+
251
+
252
+        $attemptedUndergradProgramsPerOutcome = $school_info['undergraduate_info']['programs_attempted_combined'];
253
+        $achievedUndergradProgramsPerOutcome = $school_info['undergraduate_info']['programs_achieved_combined'];
254
+        $attemptedGradProgramsPerOutcome = $school_info['graduate_info']['programs_attempted_combined'];
255
+        $achievedGradProgramsPerOutcome = $school_info['graduate_info']['programs_achieved_combined'];
256
+
257
+
258
+
259
+
260
+
245 261
         //como resuelvo programsAttempted y eso
246 262
 
247 263
 
248 264
         //El query es el mismo de students, lo unico que dividido con programas,
249 265
         //asi que lo que esta haciendo es, prog 1, y coge los dominios y estudiantes que evaluason
250
-
266
+        /*
251 267
 
252 268
 
253 269
         $undergrad_prog_attempted =  DB::table("courses")
@@ -461,7 +477,7 @@ class SchoolsController extends \BaseController
461 477
             ->groupBy("expected_target")
462 478
             ->orderBy("expected_target", "DESC")
463 479
             ->first();
464
-        Log::info($linea_grad);
480
+        //Log::info($linea_grad);
465 481
         if (!isset($linea_grad)) {
466 482
             $default_grad = 70;
467 483
         } elseif ($linea_grad->count_semester_id > 1) {
@@ -479,17 +495,24 @@ class SchoolsController extends \BaseController
479 495
                 ->first();
480 496
         }
481 497
 
482
-        Log::info($default_grad);
498
+        $expected_target_for_undergradprograms = !isset($linea_undergrad) ? $default_undergrad : $linea_undergrad->expected_target;
499
+        $expected_target_for_gradprograms = !isset($linea_grad) ? $default_grad : $linea_grad->expected_target;
500
+
501
+
502
+        //Log::info($default_grad);
503
+
504
+        $undergrad_programs = $school->undergraduate_programs->get();
505
+        $grad_programs = $school->graduate_programs->get();
483 506
 
484 507
 
485 508
 
486 509
 
487 510
         if ($school->id == 13) {
488 511
             //             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'));
489
-            return View::make('local.managers.shared.school-uhs', compact('title', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
512
+            return View::make('local.managers.shared.school-uhs', compact('title', 'expected_target_for_undergradprograms', 'expected_target_for_gradprograms', 'undergrad_programs', 'grad_programs', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
490 513
         } else {
491 514
             //             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'));
492
-            return View::make('local.managers.shared.school', compact('title',  'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
515
+            return View::make('local.managers.shared.school', compact('title', 'expected_target_for_undergradprograms', 'expected_target_for_gradprograms', 'undergrad_programs', 'grad_programs', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
493 516
         }
494 517
     }
495 518
 
@@ -498,7 +521,7 @@ class SchoolsController extends \BaseController
498 521
         return strcmp($a->name, $b->name);
499 522
     }
500 523
 
501
-    public function studentSchoolAssessmentReport($school_id)
524
+    public function print_school_students_report($school_id)
502 525
     {
503 526
         $id = $school_id;
504 527
         ini_set('memory_limit', -1);
@@ -506,7 +529,7 @@ class SchoolsController extends \BaseController
506 529
 
507 530
         $outcomes = Outcome::orderBy('name', 'asc')->get();
508 531
         $school = School::find($school_id);
509
-        $title = $school->name;
532
+        $title = $school->name . ' Assessment Report - ' . date('m/d/Y');
510 533
         $outcomeCount = Outcome::all()->count();
511 534
         $programs = Program::where('school_id', '=', $school_id)->get();
512 535
         $programs_ids = array();
@@ -518,12 +541,104 @@ class SchoolsController extends \BaseController
518 541
             $programs_name[$program->id] = $program->name;
519 542
         }
520 543
 
521
-        $school->school_students_per_outcome;
544
+        $grouped_courses = Course::
545
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
546
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id, 1 as grouped'))
547
+            ->with('semester')
548
+            ->with('program')
549
+            ->whereIn('courses.program_id', $programs_ids)
550
+            ->whereIn('courses.semester_id', Session::get('semesters_ids'))
551
+            ->leftJoin('programs', 'courses.program_id', '=', 'programs.id')
552
+            ->groupBy(array('courses.code', 'courses.number', 'courses.semester_id'))
553
+            ->orderBy('courses.code')
554
+            ->orderBy('courses.number')
555
+            ->orderBy('courses.semester_id')
556
+            ->get();
557
+
522 558
 
559
+        $role = Auth::user()->role;
560
+
561
+        $users = array();
562
+        $outcomes_colap = Outcome::whereNull("new_outcome_id")->get();
563
+
564
+        $info = $school->school_students_per_outcome;
565
+
566
+        $outcomes_undergraduate_achieved_colap_todo = $info['undergraduate_info']['outcomes_achieved_combined'];
567
+        $outcomes_undergraduate_attempted_colap_todo = $info['undergraduate_info']['outcomes_attempted_combined'];
568
+
569
+        $outcomes_graduate_achieved_colap_todo = $info['graduate_info']['outcomes_achieved_combined'];
570
+        $outcomes_graduate_attempted_colap_todo = $info['graduate_info']['outcomes_attempted_combined'];
571
+
572
+
573
+        $outcomes_undergrad_program_attempted_colap = $info['undergraduate_info']['programs_attempted_combined'];
574
+        $outcomes_undergrad_program_achieved_colap = $info['undergraduate_info']['programs_achieved_combined'];
575
+        $outcomes_grad_program_attempted_colap = $info['graduate_info']['programs_attempted_combined'];
576
+        $outcomes_grad_program_achieved_colap = $info['graduate_info']['programs_achieved_combined'];
577
+
578
+
579
+        $undergraduate_programs = $school->undergraduate_programs->get();
580
+        $graduate_programs = $school->graduate_programs->get();
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+        return View::make('local.managers.shared.print_school_students_report', compact(
589
+            'title', #'outcomes_attempted_colap_semesters', 'outcomes_attempted_semesters', 
590
+            'outcomes_undergraduate_attempted_colap_todo',
591
+            'outcomes_undergraduate_achieved_colap_todo',
592
+
593
+            'outcomes_graduate_attempted_colap_todo',
594
+            'outcomes_graduate_achieved_colap_todo',
595
+
596
+            'outcomes_undergrad_program_attempted_colap',
597
+            'outcomes_undergrad_program_achieved_colap',
598
+            'outcomes_grad_program_attempted_colap',
599
+            'outcomes_grad_program_achieved_colap',
600
+
601
+            'undergraduate_programs',
602
+            'graduate_programs',
603
+            'school',
604
+            'programs_name',
605
+            'role',
606
+            'outcomes',
607
+            'outcomes_colap',
608
+            'outcomes_attempted',
609
+            'outcomes_achieved',
610
+            'outcomes_attempted_colap',
611
+            'outcomes_achieved_colap',
612
+            'programs',
613
+            'users',
614
+            'program_courses',
615
+            'grouped_courses'
616
+        ));
617
+    }
618
+
619
+    public function studentSchoolAssessmentReport($school_id)
620
+    {
621
+        $id = $school_id;
622
+        ini_set('memory_limit', -1);
623
+        ini_set('max_execution_time', 300);
624
+
625
+        $outcomes = Outcome::orderBy('name', 'asc')->get();
626
+        $school = School::find($school_id);
627
+        $title = $school->name;
628
+        $outcomeCount = Outcome::all()->count();
629
+        $programs = Program::where('school_id', '=', $school_id)->get();
630
+        $programs_ids = array();
631
+        // 				var_dump($programs);exit();
632
+        $programs_name = array();
633
+        foreach ($programs as $program) {
634
+            // 			var_dump($program);
635
+            $programs_ids[] = $program->id;
636
+            $programs_name[$program->id] = $program->name;
637
+        }
523 638
 
524 639
         $grouped_courses = Course::
525 640
             //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
526
-            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
641
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id, 1 as grouped'))
527 642
             ->with('semester')
528 643
             ->with('program')
529 644
             ->whereIn('courses.program_id', $programs_ids)
@@ -539,6 +654,8 @@ class SchoolsController extends \BaseController
539 654
         $role = Auth::user()->role;
540 655
 
541 656
         $users = array();
657
+        $outcomes_colap = Outcome::whereNull("new_outcome_id")->get();
658
+        /*
542 659
 
543 660
 
544 661
         $resultados_todos_obj = DB::table('assessments')
@@ -645,7 +762,7 @@ $resultados_todos=array();
645 762
                 }
646 763
             }
647 764
             // 			var_dump($resultados_todos_colap);
648
-
765
+        /*
649 766
             $outcomes_attempted_colap[$program_id] = array();
650 767
             $outcomes_achieved_colap[$program_id] = array();
651 768
             $outcomes_attempted_colap_semesters[$program_id] = array();
@@ -675,10 +792,12 @@ $resultados_todos=array();
675 792
             }
676 793
             $i++;
677 794
         }
795
+        /*
678 796
         usort($outcomes_colap, array($this, "cmp"));
679 797
         // 		var_dump($outcomes_attempted_colap); print "<br>";
680 798
         // 		var_dump($outcomes_achieved_colap); print "<br>";
681 799
         // 	exit();
800
+
682 801
         $outcomes_attempted_colap_todo = array();
683 802
         $outcomes_achieved_colap_todo = array();
684 803
         foreach ($outcomes_attempted_colap as $program_id => $out_res) {
@@ -691,6 +810,7 @@ $resultados_todos=array();
691 810
                 $outcomes_achieved_colap_todo[$out] += $outcomes_achieved_colap[$program_id][$out];
692 811
             }
693 812
         }
813
+        /*
694 814
         $outcomes_attempted_todo = array();
695 815
         $outcomes_achieved_todo = array();
696 816
         foreach ($outcomes_attempted as $program_id => $out_res) {
@@ -702,10 +822,79 @@ $resultados_todos=array();
702 822
                 $outcomes_attempted_todo[$out] += $outcomes_attempted[$program_id][$out];
703 823
                 $outcomes_achieved_todo[$out] += $outcomes_achieved[$program_id][$out];
704 824
             }
705
-        }
706
-
825
+        }*/
707 826
 
708
-        return View::make('local.managers.shared.school_student_result', compact('title', 'outcomes_attempted_colap_semesters', 'outcomes_attempted_semesters', 'outcomes_attempted_colap_todo', 'outcomes_achieved_colap_todo', 'outcomes_attempted_todo', 'outcomes_achieved_todo', 'school', 'programs_name', 'role', 'outcomes', 'outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users', 'program_courses', 'grouped_courses'));
827
+        $info = $school->school_students_per_outcome;
828
+        Log::info("BRR");
829
+        Log::info($info);
830
+
831
+        $outcomes_undergraduate_achieved_colap_todo = $info['undergraduate_info']['outcomes_achieved_combined'];
832
+        $outcomes_undergraduate_attempted_colap_todo = $info['undergraduate_info']['outcomes_attempted_combined'];
833
+        $outcomes_undergraduate_achieved_todo = $info['undergraduate_info']['outcomes_achieved_uncombined'];
834
+        $outcomes_undergraduate_attempted_todo = $info['undergraduate_info']['outcomes_attempted_uncombined'];
835
+
836
+        $outcomes_graduate_achieved_colap_todo = $info['graduate_info']['outcomes_achieved_combined'];
837
+        $outcomes_graduate_attempted_colap_todo = $info['graduate_info']['outcomes_attempted_combined'];
838
+        $outcomes_graduate_achieved_todo = $info['graduate_info']['outcomes_achieved_uncombined'];
839
+        $outcomes_graduate_attempted_todo = $info['graduate_info']['outcomes_attempted_uncombined'];
840
+
841
+        $outcomes_undergrad_program_attempted_colap = $info['undergraduate_info']['programs_attempted_combined'];
842
+        $outcomes_undergrad_program_achieved_colap = $info['undergraduate_info']['programs_achieved_combined'];
843
+        $outcomes_grad_program_attempted_colap = $info['graduate_info']['programs_attempted_combined'];
844
+        $outcomes_grad_program_achieved_colap = $info['graduate_info']['programs_achieved_combined'];
845
+        Log::info("mera");
846
+        Log::info($outcomes_grad_program_attempted_colap);
847
+        $outcomes_undergrad_program_attempted_todo = $info['undergraduate_info']['programs_attempted_uncombined'];
848
+
849
+        $outcomes_undergrad_program_achieved_todo = $info['undergraduate_info']['programs_achieved_uncombined'];
850
+
851
+
852
+        $outcomes_grad_program_attempted_todo = $info['graduate_info']['programs_attempted_uncombined'];
853
+        $outcomes_grad_program_achieved_todo = $info['graduate_info']['programs_achieved_uncombined'];
854
+
855
+        $undergraduate_programs = $school->undergraduate_programs->get();
856
+        $graduate_programs = $school->graduate_programs->get();
857
+
858
+
859
+
860
+
861
+
862
+
863
+
864
+        return View::make('local.managers.shared.school_student_result', compact(
865
+            'title', #'outcomes_attempted_colap_semesters', 'outcomes_attempted_semesters', 
866
+            'outcomes_undergraduate_attempted_colap_todo',
867
+            'outcomes_undergraduate_achieved_colap_todo',
868
+            'outcomes_undergraduate_attempted_todo',
869
+            'outcomes_undergraduate_achieved_todo',
870
+            'outcomes_graduate_attempted_colap_todo',
871
+            'outcomes_graduate_achieved_colap_todo',
872
+            'outcomes_graduate_attempted_todo',
873
+            'outcomes_graduate_achieved_todo',
874
+            'outcomes_undergrad_program_attempted_colap',
875
+            'outcomes_undergrad_program_achieved_colap',
876
+            'outcomes_grad_program_attempted_colap',
877
+            'outcomes_grad_program_achieved_colap',
878
+            'outcomes_undergrad_program_attempted_todo',
879
+            'outcomes_undergrad_program_achieved_todo',
880
+            'outcomes_grad_program_attempted_todo',
881
+            'outcomes_grad_program_achieved_todo',
882
+            'undergraduate_programs',
883
+            'graduate_programs',
884
+            'school',
885
+            'programs_name',
886
+            'role',
887
+            'outcomes',
888
+            'outcomes_colap',
889
+            'outcomes_attempted',
890
+            'outcomes_achieved',
891
+            'outcomes_attempted_colap',
892
+            'outcomes_achieved_colap',
893
+            'programs',
894
+            'users',
895
+            'program_courses',
896
+            'grouped_courses'
897
+        ));
709 898
     }
710 899
 
711 900
     public function showQuasiOri($id)
@@ -1194,7 +1383,7 @@ $resultados_todos=array();
1194 1383
         $undergrad_outcomes_achieved = [];
1195 1384
 
1196 1385
 
1197
-        $school_info = $school->school_students_per_outcome;
1386
+        $school_info = $school->school_courses_per_outcome;
1198 1387
         $grad_outcomes_attempted = $school_info['graduate_info']['outcomes_attempted_combined'];
1199 1388
         $grad_outcomes_achieved = $school_info['graduate_info']['outcomes_achieved_combined'];
1200 1389
 
@@ -1205,60 +1394,7 @@ $resultados_todos=array();
1205 1394
 
1206 1395
 
1207 1396
 
1208
-        /*
1209
-
1210
-
1211
-        $grad_outcomes_attempted = [];
1212
-        $grad_outcomes_achieved = [];
1213
-        $undergrad_outcomes_attempted = [];
1214
-        $undergrad_outcomes_achieved = [];
1215
-
1216
-        foreach ($outcomes_grad as $outcome) {
1217
-            $grad_outcomes_attempted[$outcome->id] = 0;
1218
-            $grad_outcomes_achieved[$outcome->id] = 0;
1219
-        }
1220
-
1221
-        foreach ($outcomes_undergrad as $outcome) {
1222
-            $undergrad_outcomes_attempted[$outcome->id] = 0;
1223
-            $undergrad_outcomes_achieved[$outcome->id] = 0;
1224
-        }
1225
-
1226
-        foreach ($grad_student_query as $result) {
1227
-            if ($result->criteria_attempted != 0) {
1228
-                if (!isset($grad_outcomes_attempted[$result->outcome_id]))
1229
-                    continue;
1230 1397
 
1231
-                $grad_outcomes_attempted[$result->outcome_id]++;
1232
-
1233
-                $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
1234
-
1235
-                if ($percent >= 66.66) {
1236
-
1237
-
1238
-                    $grad_outcomes_achieved[$result->outcome_id]++;
1239
-                }
1240
-            }
1241
-        }
1242
-
1243
-
1244
-
1245
-
1246
-        foreach ($undergraduate_student_query as $result) {
1247
-            if ($result->criteria_attempted != 0) {
1248
-                if (!isset($undergrad_outcomes_attempted[$result->outcome_id]))
1249
-                    continue;
1250
-
1251
-                $undergrad_outcomes_attempted[$result->outcome_id]++;
1252
-
1253
-                $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
1254
-
1255
-                if ($percent >= 66.66) {
1256
-
1257
-
1258
-                    $undergrad_outcomes_achieved[$result->outcome_id]++;
1259
-                }
1260
-            }
1261
-        }*/
1262 1398
 
1263 1399
         $grad_grouped_courses = Course::
1264 1400
             //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
@@ -1336,10 +1472,19 @@ $resultados_todos=array();
1336 1472
             }
1337 1473
         }
1338 1474
 
1475
+        $attemptedUndergradProgramsPerOutcome = $school_info['undergraduate_info']['programs_attempted_combined'];
1476
+        $achievedUndergradProgramsPerOutcome = $school_info['undergraduate_info']['programs_achieved_combined'];
1477
+        $attemptedGradProgramsPerOutcome = $school_info['graduate_info']['programs_attempted_combined'];
1478
+        $achievedGradProgramsPerOutcome = $school_info['graduate_info']['programs_achieved_combined'];
1479
+
1480
+
1481
+
1482
+
1339 1483
 
1340
-        //como resuelvo programsAttempted y eso
1341 1484
 
1485
+        //como resuelvo programsAttempted y eso
1342 1486
 
1487
+        /*
1343 1488
         //El query es el mismo de students, lo unico que dividido con programas,
1344 1489
         //asi que lo que esta haciendo es, prog 1, y coge los dominios y estudiantes que evaluason
1345 1490
 
@@ -1434,7 +1579,7 @@ $resultados_todos=array();
1434 1579
                     $achievedGradProgramsPerOutcome[$outcome_id][$program_id] = 0;
1435 1580
                 $achievedGradProgramsPerOutcome[$outcome_id][$program_id]++;
1436 1581
             }
1437
-        }
1582
+        }*/
1438 1583
         //La linea negra de proposed.
1439 1584
 
1440 1585
         //
@@ -1494,15 +1639,24 @@ $resultados_todos=array();
1494 1639
                 ->first();
1495 1640
         }
1496 1641
 
1642
+        $expected_target_for_undergradprograms = !isset($linea_undergrad) ? $default_undergrad : $linea_undergrad->expected_target;
1643
+        $expected_target_for_gradprograms = !isset($linea_grad) ? $default_grad : $linea_grad->expected_target;
1644
+
1645
+
1646
+        //Log::info($default_grad);
1647
+
1648
+        $undergrad_programs = $school->undergraduate_programs->get();
1649
+        $grad_programs = $school->graduate_programs->get();
1650
+
1497 1651
 
1498 1652
 
1499 1653
 
1500 1654
         if ($school->id == 13) {
1501 1655
             //             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'));
1502
-            return View::make('local.managers.shared.print_school', compact('title', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
1656
+            return View::make('local.managers.shared.print_school', compact('title',  'expected_target_for_undergradprograms', 'expected_target_for_gradprograms', 'undergrad_programs', 'grad_programs', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
1503 1657
         } else {
1504 1658
             //             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'));
1505
-            return View::make('local.managers.shared.print_school', compact('title',  'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
1659
+            return View::make('local.managers.shared.print_school', compact('title',  'expected_target_for_undergradprograms', 'expected_target_for_gradprograms', 'undergrad_programs', 'grad_programs', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', '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'));
1506 1660
         }
1507 1661
 
1508 1662
 

+ 28
- 0
app/models/Course.php Ver fichero

@@ -480,6 +480,34 @@ class Course extends Eloquent
480 480
     return $this->getStudentReportForOutcome($this);
481 481
   }
482 482
 
483
+  //cuantos estudiantes tiene este cursos que son del programa
484
+
485
+  public function getQuantityAttribute()
486
+  {
487
+    $query = DB::table('courses')
488
+      ->join('course_student', 'course_student.course_id', '=', 'courses.id')
489
+      ->join('program_student_semester as pcs', function ($j) {
490
+        $j->on('courses.program_id', '=', 'pcs.program_id')
491
+          ->on('course_student.student_id', '=', 'pcs.student_id')
492
+          ->on('courses.semester_id', '=', 'pcs.semester_id');
493
+      });
494
+    if ($this->grouped) {
495
+      $query = $query->where('courses.name', $this->name)
496
+        ->where('courses.code', $this->code)
497
+        ->where('courses.number', $this->number)
498
+        ->where('courses.semester_id', $this->semester_id);
499
+    } else {
500
+      $query = $query->where("courses.id", $this->id);
501
+    }
502
+    $query = $query->select(DB::raw("count( distinct pcs.student_id) as quantity"));
503
+
504
+    $query =  $query->first();
505
+    if (isset($query)) {
506
+      return $query->quantity;
507
+    }
508
+    return 0;
509
+  }
510
+
483 511
 
484 512
   //user id is for groupped professor sections. so el query es  code, number, semester y user_id
485 513
   public static function getStudentReportForOutcome($course_code = null, $user_id = null)

+ 240
- 99
app/models/Program.php Ver fichero

@@ -38,149 +38,148 @@ class Program extends Eloquent
38 38
 	}
39 39
 
40 40
 	public function getProgramStudentsPerOutcomeAttribute()
41
-	{ {
41
+	{
42 42
 
43
-			$semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
43
+		$semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
44 44
 
45
-			//if ($this->is_graduate == 1) {
46
-			//	$outcomes = Outcome::active_by_semesters($semesters, 1);
47
-			//} else {
48
-			//	$outcomes = Outcome::active_by_semesters($semesters, 0);
49
-			//}
45
+		//if ($this->is_graduate == 1) {
46
+		//	$outcomes = Outcome::active_by_semesters($semesters, 1);
47
+		//} else {
48
+		//	$outcomes = Outcome::active_by_semesters($semesters, 0);
49
+		//}
50 50
 
51
-			$outcomes = Outcome::orderBy('name', 'asc')->get();
51
+		$outcomes = Outcome::orderBy('name', 'asc')->get();
52 52
 
53
-			$outcome_ids = DB::table("outcomes")
54
-				->whereNotNull('new_outcome_id')
55
-				->get();
53
+		$outcome_ids = DB::table("outcomes")
54
+			->whereNotNull('new_outcome_id')
55
+			->get();
56 56
 
57
-			$combined_outcomes = [];
58
-			foreach ($outcome_ids as $outcome) {
59
-				$combined_outcomes[$outcome->id] = $outcome->new_outcome_id;
60
-			}
57
+		$combined_outcomes = [];
58
+		foreach ($outcome_ids as $outcome) {
59
+			$combined_outcomes[$outcome->id] = $outcome->new_outcome_id;
60
+		}
61 61
 
62
-			$array_to_send = [];
62
+		$array_to_send = [];
63 63
 
64 64
 
65 65
 
66
-			$students =
67
-				DB::table('assessments')
68
-				->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
69
-				->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
70
-				->join('courses', 'courses.id', '=', 'activities.course_id')
71
-				->join('students', 'students.id', '=', 'assessments.student_id')
72
-				->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
73
-				->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
74
-				->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
75
-				->join('semesters', 'semesters.id', '=', 'courses.semester_id')
76
-				->where('students.program_id', $this->id)
77
-				->whereIn('semester_id', Session::get('semesters_ids'))
78
-				->where('semesters.is_visible', '=', 1)
79
-				->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
80
-				->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
81
-				->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
66
+		$students =
67
+			DB::table('assessments')
68
+			->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
69
+			->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
70
+			->join('courses', 'courses.id', '=', 'activities.course_id')
71
+			->join('students', 'students.id', '=', 'assessments.student_id')
72
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
73
+			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
74
+			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
75
+			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
76
+			->where('students.program_id', $this->id)
77
+			->whereIn('semester_id', Session::get('semesters_ids'))
78
+			->where('semesters.is_visible', '=', 1)
79
+			->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
80
+			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
81
+			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
82 82
 
83
-				->groupBy('students.id', 'outcome_id')
84
-				->get();
83
+			->groupBy('students.id', 'outcome_id')
84
+			->get();
85 85
 
86 86
 
87 87
 
88 88
 
89
-			$array_to_send['program_info'] = [];
89
+		$array_to_send['program_info'] = [];
90 90
 
91
-			$array_to_send['program_info']['outcomes_attempted'] = [];
92
-			$out_att = [];
93
-			$out_ach = [];
91
+		$array_to_send['program_info']['outcomes_attempted'] = [];
92
+		$out_att = [];
93
+		$out_ach = [];
94 94
 
95
-			foreach ($outcomes as $outcome) {
96
-				$out_att[$outcome->id] = 0;
97
-				$out_ach[$outcome->id] = 0;
98
-			}
95
+		foreach ($outcomes as $outcome) {
96
+			$out_att[$outcome->id] = 0;
97
+			$out_ach[$outcome->id] = 0;
98
+		}
99 99
 
100 100
 
101
-			//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
102
-			foreach ($students as $result) {
103
-				$crit_att = $result->criteria_attempted;
104
-				$crit_ach = $result->criteria_achieved;
101
+		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
102
+		foreach ($students as $result) {
103
+			$crit_att = $result->criteria_attempted;
104
+			$crit_ach = $result->criteria_achieved;
105 105
 
106 106
 
107
-				$out_att[$result->outcome_id] += 1;
107
+			$out_att[$result->outcome_id] += 1;
108 108
 
109
-				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
110
-					$out_ach[$result->outcome_id] += 1;
111
-				}
109
+			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
110
+				$out_ach[$result->outcome_id] += 1;
112 111
 			}
112
+		}
113 113
 
114 114
 
115
-			$array_to_send['program_info']['outcomes_attempted_uncombined'] = $out_att;
116
-			$array_to_send['program_info']['outcomes_achieved_uncombined'] = $out_ach;
115
+		$array_to_send['program_info']['outcomes_attempted_uncombined'] = $out_att;
116
+		$array_to_send['program_info']['outcomes_achieved_uncombined'] = $out_ach;
117 117
 
118 118
 
119
-			$the_processed_table = [];
120
-			foreach ($students as $result) {
121
-				$student_id = $result->student_id;
122
-				$outcome_id = $result->outcome_id;
123
-				if (isset($combined_outcomes[$outcome_id]))
124
-					$outcome_id = $combined_outcomes[$outcome_id];
119
+		$the_processed_table = [];
120
+		foreach ($students as $result) {
121
+			$student_id = $result->student_id;
122
+			$outcome_id = $result->outcome_id;
123
+			if (isset($combined_outcomes[$outcome_id]))
124
+				$outcome_id = $combined_outcomes[$outcome_id];
125 125
 
126 126
 
127 127
 
128
-				if (!isset($the_processed_table[$student_id])) {
129
-					$the_processed_table[$student_id] = [];
130
-				}
128
+			if (!isset($the_processed_table[$student_id])) {
129
+				$the_processed_table[$student_id] = [];
130
+			}
131 131
 
132 132
 
133
-				//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
134
-				// los criterios, achieved y attempted
135
-				if (!isset($the_processed_table[$student_id][$outcome_id])) {
136
-					$the_processed_table[$student_id][$outcome_id] = array(
137
-						"criteria_attempted" => $result->criteria_attempted,
138
-						"criteria_achieved" => $result->criteria_achieved
139
-					);
140
-				}
141
-				//si este estudiante está pareado a este dominio, significa que ahora estoy en los
142
-				//deprecated outcomes.
143
-				else {
144
-					$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
145
-					$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
146
-				}
133
+			//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
134
+			// los criterios, achieved y attempted
135
+			if (!isset($the_processed_table[$student_id][$outcome_id])) {
136
+				$the_processed_table[$student_id][$outcome_id] = array(
137
+					"criteria_attempted" => $result->criteria_attempted,
138
+					"criteria_achieved" => $result->criteria_achieved
139
+				);
147 140
 			}
148
-			//Log::info("ESTOY LOCO POR TI");
149
-			//Log::info($the_processed_table);
141
+			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
142
+			//deprecated outcomes.
143
+			else {
144
+				$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
145
+				$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
146
+			}
147
+		}
148
+		//Log::info("ESTOY LOCO POR TI");
149
+		//Log::info($the_processed_table);
150 150
 
151
-			$out_att = [];
152
-			$out_ach = [];
151
+		$out_att = [];
152
+		$out_ach = [];
153 153
 
154
-			foreach ($outcomes as $outcome) {
155
-				$out_att[$outcome->id] = 0;
156
-				$out_ach[$outcome->id] = 0;
157
-			}
154
+		foreach ($outcomes as $outcome) {
155
+			$out_att[$outcome->id] = 0;
156
+			$out_ach[$outcome->id] = 0;
157
+		}
158 158
 
159
-			foreach ($the_processed_table as $student_id => $outcome_ids) {
160
-				//Log::info("AQUI");
161
-				//Log::info($outcome_ids);
162
-				foreach ($outcome_ids as $outcome_id => $crit_information) {
163
-					Log::info($crit_information);
164
-					$crit_att = $crit_information['criteria_attempted'];
165
-					$crit_ach = $crit_information['criteria_achieved'];
159
+		foreach ($the_processed_table as $student_id => $outcome_ids) {
160
+			//Log::info("AQUI");
161
+			//Log::info($outcome_ids);
162
+			foreach ($outcome_ids as $outcome_id => $crit_information) {
163
+				//Log::info($crit_information);
164
+				$crit_att = $crit_information['criteria_attempted'];
165
+				$crit_ach = $crit_information['criteria_achieved'];
166 166
 
167 167
 
168
-					$out_att[$outcome_id] += 1;
168
+				$out_att[$outcome_id] += 1;
169 169
 
170
-					if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
171
-						$out_ach[$outcome_id] += 1;
172
-					}
170
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
171
+					$out_ach[$outcome_id] += 1;
173 172
 				}
174 173
 			}
174
+		}
175 175
 
176
-			$array_to_send['program_info']['outcomes_attempted_combined'] = $out_att;
177
-			$array_to_send['program_info']['outcomes_achieved_combined'] = $out_ach;
176
+		$array_to_send['program_info']['outcomes_attempted_combined'] = $out_att;
177
+		$array_to_send['program_info']['outcomes_achieved_combined'] = $out_ach;
178 178
 
179 179
 
180 180
 
181 181
 
182
-			return $array_to_send;
183
-		}
182
+		return $array_to_send;
184 183
 	}
185 184
 
186 185
 	public function getCriteriaAttribute()
@@ -203,6 +202,147 @@ class Program extends Eloquent
203 202
 				->get();
204 203
 		}
205 204
 	}
205
+
206
+	public function getCoursesWithAssessmentCountAttribute()
207
+	{
208
+		return DB::table('courses')
209
+			->join(DB::raw("(SELECT distinct courses.* from courses join activities on activities.course_id = courses.id join activity_criterion on activity_criterion.activity_id = activities.id join assessments on activity_criterion.id = assessments.activity_criterion_id) as q"), function ($j) {
210
+				$j->on('q.semester_id', '=', 'courses.semester_id')
211
+					->on('q.program_id', '=', 'courses.program_id');
212
+			})
213
+			->where('courses.program_id', $this->id)
214
+			->whereIn('courses.semester_id', Session::get('semesters_ids'))
215
+			->select(DB::raw('count(DISTINCT courses.id) as courses_program, count(DISTINCT q.id) as courses_assessed'))
216
+			->first();
217
+	}
218
+
219
+	public function getCoursesStudentsScorePerOutcomeAttribute()
220
+	{
221
+		$outcomes = Outcome::orderBy('name', 'asc')->get();
222
+
223
+		$outcome_ids = DB::table("outcomes")
224
+			->whereNotNull('new_outcome_id')
225
+			->get();
226
+
227
+		$combined_outcomes = [];
228
+		foreach ($outcome_ids as $outcome) {
229
+			$combined_outcomes[$outcome->id] = $outcome->new_outcome_id;
230
+		}
231
+
232
+		$array_to_send = [];
233
+		$students = DB::table('assessments')
234
+			->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
235
+			->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
236
+			->join('courses', 'courses.id', '=', 'activities.course_id')
237
+			->join('students', 'students.id', '=', 'assessments.student_id')
238
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
239
+			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
240
+			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
241
+			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
242
+			->where('courses.program_id', $this->id)
243
+			->whereIn('semester_id', Session::get('semesters_ids'))
244
+			->where('semesters.is_visible', '=', 1)
245
+			->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
246
+			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
247
+			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
248
+
249
+			->groupBy('students.id', 'outcome_id')
250
+			->get();
251
+		$array_to_send['program_info'] = [];
252
+
253
+		$array_to_send['program_info']['outcomes_attempted'] = [];
254
+		$out_att = [];
255
+		$out_ach = [];
256
+
257
+		foreach ($outcomes as $outcome) {
258
+			$out_att[$outcome->id] = 0;
259
+			$out_ach[$outcome->id] = 0;
260
+		}
261
+
262
+
263
+		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
264
+		foreach ($students as $result) {
265
+			$crit_att = $result->criteria_attempted;
266
+			$crit_ach = $result->criteria_achieved;
267
+
268
+
269
+			$out_att[$result->outcome_id] += 1;
270
+
271
+			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
272
+				$out_ach[$result->outcome_id] += 1;
273
+			}
274
+		}
275
+
276
+
277
+		$array_to_send['program_info']['outcomes_attempted_uncombined'] = $out_att;
278
+		$array_to_send['program_info']['outcomes_achieved_uncombined'] = $out_ach;
279
+
280
+
281
+		$the_processed_table = [];
282
+		foreach ($students as $result) {
283
+			$student_id = $result->student_id;
284
+			$outcome_id = $result->outcome_id;
285
+			if (isset($combined_outcomes[$outcome_id]))
286
+				$outcome_id = $combined_outcomes[$outcome_id];
287
+
288
+
289
+
290
+			if (!isset($the_processed_table[$student_id])) {
291
+				$the_processed_table[$student_id] = [];
292
+			}
293
+
294
+
295
+			//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
296
+			// los criterios, achieved y attempted
297
+			if (!isset($the_processed_table[$student_id][$outcome_id])) {
298
+				$the_processed_table[$student_id][$outcome_id] = array(
299
+					"criteria_attempted" => $result->criteria_attempted,
300
+					"criteria_achieved" => $result->criteria_achieved
301
+				);
302
+			}
303
+			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
304
+			//deprecated outcomes.
305
+			else {
306
+				$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
307
+				$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
308
+			}
309
+		}
310
+		//Log::info("ESTOY LOCO POR TI");
311
+		//Log::info($the_processed_table);
312
+
313
+		$out_att = [];
314
+		$out_ach = [];
315
+
316
+		foreach ($outcomes as $outcome) {
317
+			$out_att[$outcome->id] = 0;
318
+			$out_ach[$outcome->id] = 0;
319
+		}
320
+
321
+		foreach ($the_processed_table as $student_id => $outcome_ids) {
322
+			//Log::info("AQUI");
323
+			//Log::info($outcome_ids);
324
+			foreach ($outcome_ids as $outcome_id => $crit_information) {
325
+				//Log::info($crit_information);
326
+				$crit_att = $crit_information['criteria_attempted'];
327
+				$crit_ach = $crit_information['criteria_achieved'];
328
+
329
+
330
+				$out_att[$outcome_id] += 1;
331
+
332
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
333
+					$out_ach[$outcome_id] += 1;
334
+				}
335
+			}
336
+		}
337
+
338
+		$array_to_send['program_info']['outcomes_attempted_combined'] = $out_att;
339
+		$array_to_send['program_info']['outcomes_achieved_combined'] = $out_ach;
340
+
341
+
342
+
343
+
344
+		return $array_to_send;
345
+	}
206 346
 	public function templates()
207 347
 	{
208 348
 		return $this->hasMany('Template');
@@ -353,7 +493,7 @@ class Program extends Eloquent
353 493
 			->whereIn('courses.semester_id', $semesters_array)
354 494
 			->count(DB::raw('DISTINCT criterion_objective_outcome.outcome_id'));
355 495
 
356
-
496
+		/*
357 497
 		Log::info(DB::table('activity_criterion')
358 498
 			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
359 499
 			->join('courses', 'activities.course_id', '=', 'courses.id')
@@ -363,6 +503,7 @@ class Program extends Eloquent
363 503
 			->where('programs.id', '=', $this->id)
364 504
 			->whereIn('courses.semester_id', $semesters_array)
365 505
 			->toSql());
506
+			*/
366 507
 		return $conteo;
367 508
 	}
368 509
 

+ 421
- 6
app/models/School.php Ver fichero

@@ -59,6 +59,342 @@ class School extends Eloquent
59 59
 
60 60
 */
61 61
 
62
+	public function getSchoolCoursesPerOutcomeAttribute()
63
+	{
64
+		$semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
65
+
66
+		$outcomes_grad = Outcome::active_by_semesters($semesters, 1);
67
+		$outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
68
+
69
+		$outcomes = Outcome::orderBy('name', 'asc')->get();
70
+		$array_to_send = [];
71
+
72
+
73
+
74
+		$undergraduate_students =
75
+			DB::table('assessments')
76
+			->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
77
+			->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
78
+			->join('courses', 'courses.id', '=', 'activities.course_id')
79
+			->join('students', 'students.id', '=', 'assessments.student_id')
80
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
81
+			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
82
+			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
83
+			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
84
+			->whereIn('courses.program_id', $this->undergraduate_programs->lists('id'))
85
+			->whereIn('semester_id', Session::get('semesters_ids'))
86
+			->where('semesters.is_visible', '=', 1)
87
+			->select('student_id', 'courses.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
88
+			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
89
+			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
90
+
91
+			->groupBy('students.id', 'outcome_id');
92
+
93
+		//->get();
94
+
95
+
96
+
97
+		$undergraduate_students = $undergraduate_students->get();
98
+
99
+		//$array_to_send["undergraduate_students"] = $undergraduate_students;
100
+
101
+		$graduate_students = DB::table('assessments')
102
+			->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
103
+			->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
104
+			->join('courses', 'courses.id', '=', 'activities.course_id')
105
+			->join('students', 'students.id', '=', 'assessments.student_id')
106
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
107
+			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
108
+			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
109
+			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
110
+			->whereIn('courses.program_id', $this->graduate_programs->lists('id'))
111
+			->whereIn('semester_id', Session::get('semesters_ids'))
112
+			->where('semesters.is_visible', '=', 1)
113
+			->select('student_id', 'courses.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
114
+			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
115
+			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
116
+
117
+			->groupBy('students.id', 'outcome_id', 'courses.program_id')
118
+			->get();
119
+
120
+		//$array_to_send["graduate_students"] = $graduate_students;
121
+
122
+		//Log::info(count($graduate_students));
123
+		//Log::info(count($undergraduate_students));
124
+
125
+		$outcome_ids = DB::table("outcomes")
126
+			->whereNotNull('new_outcome_id')
127
+			->get();
128
+
129
+		$combined_outcomes = [];
130
+		foreach ($outcome_ids as $outcome) {
131
+			$combined_outcomes[$outcome->id] = $outcome->new_outcome_id;
132
+		}
133
+
134
+		//Necesito undergraduateCombined, undergraduateUncombined, 
135
+		//lo mismo pa graduate 
136
+
137
+		$array_to_send['undergraduate_info'] = [];
138
+		$array_to_send['graduate_info'] = [];
139
+
140
+		$array_to_send['undergraduate_info']['outcomes_attempted_uncombined'] = [];
141
+		$array_to_send['undergraduate_info']['outcomes_achieved_uncombined'] = [];
142
+		$array_to_send['graduate_info']['outcomes_attempted_uncombined']  = [];
143
+		$array_to_send['graduate_info']['outcomes_achieved_uncombined'] = [];
144
+
145
+		$under_out_att = [];
146
+		$under_out_ach = [];
147
+		$program_out_att = [];
148
+		$program_out_ach = [];
149
+
150
+		foreach ($outcomes as $outcome) {
151
+			$under_out_att[$outcome->id] = 0;
152
+			$under_out_ach[$outcome->id] = 0;
153
+			$program_out_att[$outcome->id] = [];
154
+			$program_out_ach[$outcome->id] = [];
155
+		}
156
+
157
+		//Para los programas attempted, voy a tener, un arreglo por dominio, y cada dominio tendra
158
+		//indices por cada programa, y cada programa tendrá conteo del estudiantes que intentaron y 
159
+		// estudiantes que fallaron. 
160
+
161
+		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
162
+		foreach ($undergraduate_students as $result) {
163
+			$crit_att = $result->criteria_attempted;
164
+			$crit_ach = $result->criteria_achieved;
165
+
166
+			$program_id = $result->program_id;
167
+
168
+			if (!isset($program_out_att[$result->outcome_id][$program_id])) {
169
+				$program_out_att[$result->outcome_id][$program_id] = 0;
170
+			}
171
+
172
+			$program_out_att[$result->outcome_id][$program_id] += 1;
173
+
174
+			$under_out_att[$result->outcome_id] += 1;
175
+
176
+
177
+
178
+			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
179
+				if (!isset($program_out_ach[$result->outcome_id][$program_id])) {
180
+					$program_out_ach[$result->outcome_id][$program_id] = 0;
181
+				}
182
+				$program_out_ach[$result->outcome_id][$program_id] += 1;
183
+				$under_out_ach[$result->outcome_id] += 1;
184
+			}
185
+		}
186
+
187
+		$array_to_send['undergraduate_info']['programs_attempted_uncombined'] = $program_out_att;
188
+		$array_to_send['undergraduate_info']['programs_achieved_uncombined'] = $program_out_ach;
189
+
190
+		$array_to_send['undergraduate_info']['outcomes_attempted_uncombined'] = $under_out_att;
191
+		$array_to_send['undergraduate_info']['outcomes_achieved_uncombined'] = $under_out_ach;
192
+
193
+		$grad_out_att = [];
194
+		$grad_out_ach = [];
195
+
196
+		foreach ($outcomes as $outcome) {
197
+			$grad_out_att[$outcome->id] = 0;
198
+			$grad_out_ach[$outcome->id] = 0;
199
+			$program_out_att[$outcome->id] = [];
200
+			$program_out_ach[$outcome->id] = [];
201
+		}
202
+
203
+
204
+		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
205
+		foreach ($graduate_students as $result) {
206
+			$crit_att = $result->criteria_attempted;
207
+			$crit_ach = $result->criteria_achieved;
208
+
209
+			$program_id = $result->program_id;
210
+
211
+			if (!isset($program_out_att[$result->outcome_id][$program_id])) {
212
+				$program_out_att[$result->outcome_id][$program_id] = 0;
213
+			}
214
+			$program_out_att[$result->outcome_id][$program_id] += 1;
215
+
216
+
217
+			$grad_out_att[$result->outcome_id] += 1;
218
+
219
+			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
220
+				if (!isset($program_out_ach[$result->outcome_id][$program_id])) {
221
+					$program_out_ach[$result->outcome_id][$program_id] = 0;
222
+				}
223
+				$program_out_ach[$result->outcome_id][$program_id] += 1;
224
+				$grad_out_ach[$result->outcome_id] += 1;
225
+			}
226
+		}
227
+
228
+		$array_to_send['graduate_info']['outcomes_attempted_uncombined'] = $grad_out_att;
229
+		$array_to_send['graduate_info']['outcomes_achieved_uncombined'] = $grad_out_ach;
230
+		$array_to_send['graduate_info']['programs_attempted_uncombined'] = $program_out_att;
231
+		$array_to_send['graduate_info']['programs_achieved_uncombined'] = $program_out_ach;
232
+
233
+
234
+
235
+
236
+		$array_to_send['undergraduate_info']['outcomes_attempted_combined'] = [];
237
+		$array_to_send['undergraduate_info']['outcomes_achieved_combined'] = [];
238
+		$array_to_send['graduate_info']['outcomes_attempted_combined']  = [];
239
+		$array_to_send['graduate_info']['outcomes_achieved_combined'] = [];
240
+
241
+		$under_out_att = [];
242
+		$under_out_ach = [];
243
+
244
+		foreach ($outcomes as $outcome) {
245
+			$under_out_att[$outcome->id] = 0;
246
+			$under_out_ach[$outcome->id] = 0;
247
+			$program_out_att[$outcome->id] = [];
248
+			$program_out_ach[$outcome->id] = [];
249
+		}
250
+
251
+		//preprocess para combined_students
252
+
253
+		$the_processed_table = [];
254
+		foreach ($undergraduate_students as $result) {
255
+			$student_id = $result->student_id;
256
+			$outcome_id = $result->outcome_id;
257
+			if (isset($combined_outcomes[$outcome_id]))
258
+				$outcome_id = $combined_outcomes[$outcome_id];
259
+
260
+
261
+
262
+			if (!isset($the_processed_table[$student_id])) {
263
+				$the_processed_table[$student_id] = [];
264
+			}
265
+
266
+
267
+			//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
268
+			// los criterios, achieved y attempted
269
+			if (!isset($the_processed_table[$student_id][$outcome_id])) {
270
+				$the_processed_table[$student_id][$outcome_id] = array(
271
+					"criteria_attempted" => $result->criteria_attempted,
272
+					"criteria_achieved" => $result->criteria_achieved,
273
+					"program_id" => $result->program_id
274
+				);
275
+			}
276
+			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
277
+			//deprecated outcomes.
278
+			else {
279
+				$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
280
+				$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
281
+			}
282
+		}
283
+
284
+
285
+		foreach ($the_processed_table as $student_id => $outcome_ids) {
286
+			foreach ($outcome_ids as $outcome_id => $crit_information) {
287
+				$crit_att = $crit_information['criteria_attempted'];
288
+				$crit_ach = $crit_information['criteria_achieved'];
289
+				$program_id = $crit_information['program_id'];
290
+
291
+
292
+				$under_out_att[$outcome_id] += 1;
293
+
294
+
295
+				if (!isset($program_out_att[$outcome_id][$program_id])) {
296
+					$program_out_att[$outcome_id][$program_id] = 0;
297
+				}
298
+
299
+				$program_out_att[$outcome_id][$program_id] += 1;
300
+
301
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
302
+					if (!isset($program_out_ach[$outcome_id][$program_id])) {
303
+						$program_out_ach[$outcome_id][$program_id] = 0;
304
+					}
305
+					$program_out_ach[$outcome_id][$program_id] += 1;
306
+					$under_out_ach[$outcome_id] += 1;
307
+				}
308
+			}
309
+		}
310
+
311
+		$array_to_send['undergraduate_info']['outcomes_attempted_combined'] = $under_out_att;
312
+		$array_to_send['undergraduate_info']['outcomes_achieved_combined'] = $under_out_ach;
313
+		$array_to_send['undergraduate_info']['programs_attempted_combined'] = $program_out_att;
314
+		$array_to_send['undergraduate_info']['programs_achieved_combined'] = $program_out_ach;
315
+
316
+
317
+		$grad_out_att = [];
318
+		$grad_out_ach = [];
319
+
320
+		foreach ($outcomes as $outcome) {
321
+			$grad_out_att[$outcome->id] = 0;
322
+			$grad_out_ach[$outcome->id] = 0;
323
+			$program_out_att[$outcome->id] = [];
324
+			$program_out_ach[$outcome->id] = [];
325
+		}
326
+
327
+		//preprocess para combined_students
328
+
329
+		$the_processed_table = [];
330
+		foreach ($graduate_students as $result) {
331
+			$student_id = $result->student_id;
332
+			$outcome_id = $result->outcome_id;
333
+			if (isset($combined_outcomes[$outcome_id]))
334
+				$outcome_id = $combined_outcomes[$outcome_id];
335
+
336
+
337
+
338
+			if (!isset($the_processed_table[$student_id])) {
339
+				$the_processed_table[$student_id] = [];
340
+			}
341
+
342
+
343
+			//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
344
+			// los criterios, achieved y attempted
345
+			if (!isset($the_processed_table[$student_id][$outcome_id])) {
346
+				$the_processed_table[$student_id][$outcome_id] = array(
347
+					"criteria_attempted" => $result->criteria_attempted,
348
+					"criteria_achieved" => $result->criteria_achieved,
349
+					'program_id' => $result->program_id
350
+				);
351
+			}
352
+			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
353
+			//deprecated outcomes.
354
+			else {
355
+				$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
356
+				$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
357
+			}
358
+		}
359
+
360
+
361
+
362
+
363
+		foreach ($the_processed_table as $student_id => $outcome_ids) {
364
+			foreach ($outcome_ids as $out_id => $crit_information) {
365
+				$crit_att = $crit_information['criteria_attempted'];
366
+				$crit_ach = $crit_information['criteria_achieved'];
367
+				$program_id = $crit_information['program_id'];
368
+
369
+
370
+				$grad_out_att[$out_id] += 1;
371
+
372
+				if (!isset($program_out_att[$out_id][$program_id])) {
373
+					$program_out_att[$out_id][$program_id] = 0;
374
+				}
375
+
376
+				$program_out_att[$out_id][$program_id] += 1;
377
+
378
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
379
+					if (!isset($program_out_ach[$out_id][$program_id])) {
380
+						$program_out_ach[$out_id][$program_id] = 0;
381
+					}
382
+					$program_out_ach[$out_id][$program_id] += 1;
383
+					$grad_out_ach[$out_id] += 1;
384
+				}
385
+			}
386
+		}
387
+
388
+		$array_to_send['graduate_info']['outcomes_attempted_combined'] = $grad_out_att;
389
+		$array_to_send['graduate_info']['outcomes_achieved_combined'] = $grad_out_ach;
390
+		$array_to_send['graduate_info']['programs_attempted_combined'] = $program_out_att;
391
+		$array_to_send['graduate_info']['programs_achieved_combined'] = $program_out_ach;
392
+
393
+		Log::info($array_to_send);
394
+		return $array_to_send;
395
+	}
396
+
397
+
62 398
 	public function getSchoolStudentsPerOutcomeAttribute()
63 399
 	{
64 400
 
@@ -89,8 +425,13 @@ class School extends Eloquent
89 425
 			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
90 426
 			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
91 427
 
92
-			->groupBy('students.id', 'outcome_id')
93
-			->get();
428
+			->groupBy('students.id', 'outcome_id');
429
+
430
+		//->get();
431
+
432
+
433
+
434
+		$undergraduate_students = $undergraduate_students->get();
94 435
 
95 436
 		//$array_to_send["undergraduate_students"] = $undergraduate_students;
96 437
 
@@ -140,32 +481,60 @@ class School extends Eloquent
140 481
 
141 482
 		$under_out_att = [];
142 483
 		$under_out_ach = [];
484
+		$program_out_att = [];
485
+		$program_out_ach = [];
143 486
 
144 487
 		foreach ($outcomes as $outcome) {
145 488
 			$under_out_att[$outcome->id] = 0;
146 489
 			$under_out_ach[$outcome->id] = 0;
490
+			$program_out_att[$outcome->id] = [];
491
+			$program_out_ach[$outcome->id] = [];
147 492
 		}
148 493
 
494
+		//Para los programas attempted, voy a tener, un arreglo por dominio, y cada dominio tendra
495
+		//indices por cada programa, y cada programa tendrá conteo del estudiantes que intentaron y 
496
+		// estudiantes que fallaron. 
149 497
 
150 498
 		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
151 499
 		foreach ($undergraduate_students as $result) {
152 500
 			$crit_att = $result->criteria_attempted;
153 501
 			$crit_ach = $result->criteria_achieved;
154 502
 
503
+			$program_id = $result->program_id;
504
+
505
+			if (!isset($program_out_att[$result->outcome_id][$program_id])) {
506
+				$program_out_att[$result->outcome_id][$program_id] = 0;
507
+			}
508
+
509
+			$program_out_att[$result->outcome_id][$program_id] += 1;
155 510
 
156 511
 			$under_out_att[$result->outcome_id] += 1;
157 512
 
513
+
514
+
158 515
 			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
516
+				if (!isset($program_out_ach[$result->outcome_id][$program_id])) {
517
+					$program_out_ach[$result->outcome_id][$program_id] = 0;
518
+				}
519
+				$program_out_ach[$result->outcome_id][$program_id] += 1;
159 520
 				$under_out_ach[$result->outcome_id] += 1;
160 521
 			}
161 522
 		}
162 523
 
524
+		$array_to_send['undergraduate_info']['programs_attempted_uncombined'] = $program_out_att;
525
+		$array_to_send['undergraduate_info']['programs_achieved_uncombined'] = $program_out_ach;
526
+
527
+		$array_to_send['undergraduate_info']['outcomes_attempted_uncombined'] = $under_out_att;
528
+		$array_to_send['undergraduate_info']['outcomes_achieved_uncombined'] = $under_out_ach;
529
+
163 530
 		$grad_out_att = [];
164 531
 		$grad_out_ach = [];
165 532
 
166 533
 		foreach ($outcomes as $outcome) {
167 534
 			$grad_out_att[$outcome->id] = 0;
168 535
 			$grad_out_ach[$outcome->id] = 0;
536
+			$program_out_att[$outcome->id] = [];
537
+			$program_out_ach[$outcome->id] = [];
169 538
 		}
170 539
 
171 540
 
@@ -174,18 +543,30 @@ class School extends Eloquent
174 543
 			$crit_att = $result->criteria_attempted;
175 544
 			$crit_ach = $result->criteria_achieved;
176 545
 
546
+			$program_id = $result->program_id;
547
+
548
+			if (!isset($program_out_att[$result->outcome_id][$program_id])) {
549
+				$program_out_att[$result->outcome_id][$program_id] = 0;
550
+			}
551
+			$program_out_att[$result->outcome_id][$program_id] += 1;
552
+
177 553
 
178 554
 			$grad_out_att[$result->outcome_id] += 1;
179 555
 
180 556
 			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
557
+				if (!isset($program_out_ach[$result->outcome_id][$program_id])) {
558
+					$program_out_ach[$result->outcome_id][$program_id] = 0;
559
+				}
560
+				$program_out_ach[$result->outcome_id][$program_id] += 1;
181 561
 				$grad_out_ach[$result->outcome_id] += 1;
182 562
 			}
183 563
 		}
184 564
 
185
-		$array_to_send['undergraduate_info']['outcomes_attempted_uncombined'] = $under_out_att;
186
-		$array_to_send['undergraduate_info']['outcomes_achieved_uncombined'] = $under_out_ach;
187 565
 		$array_to_send['graduate_info']['outcomes_attempted_uncombined'] = $grad_out_att;
188 566
 		$array_to_send['graduate_info']['outcomes_achieved_uncombined'] = $grad_out_ach;
567
+		$array_to_send['graduate_info']['programs_attempted_uncombined'] = $program_out_att;
568
+		$array_to_send['graduate_info']['programs_achieved_uncombined'] = $program_out_ach;
569
+
189 570
 
190 571
 
191 572
 
@@ -200,6 +581,8 @@ class School extends Eloquent
200 581
 		foreach ($outcomes as $outcome) {
201 582
 			$under_out_att[$outcome->id] = 0;
202 583
 			$under_out_ach[$outcome->id] = 0;
584
+			$program_out_att[$outcome->id] = [];
585
+			$program_out_ach[$outcome->id] = [];
203 586
 		}
204 587
 
205 588
 		//preprocess para combined_students
@@ -223,7 +606,8 @@ class School extends Eloquent
223 606
 			if (!isset($the_processed_table[$student_id][$outcome_id])) {
224 607
 				$the_processed_table[$student_id][$outcome_id] = array(
225 608
 					"criteria_attempted" => $result->criteria_attempted,
226
-					"criteria_achieved" => $result->criteria_achieved
609
+					"criteria_achieved" => $result->criteria_achieved,
610
+					"program_id" => $result->program_id
227 611
 				);
228 612
 			}
229 613
 			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
@@ -239,11 +623,23 @@ class School extends Eloquent
239 623
 			foreach ($outcome_ids as $outcome_id => $crit_information) {
240 624
 				$crit_att = $crit_information['criteria_attempted'];
241 625
 				$crit_ach = $crit_information['criteria_achieved'];
626
+				$program_id = $crit_information['program_id'];
242 627
 
243 628
 
244 629
 				$under_out_att[$outcome_id] += 1;
245 630
 
631
+
632
+				if (!isset($program_out_att[$outcome_id][$program_id])) {
633
+					$program_out_att[$outcome_id][$program_id] = 0;
634
+				}
635
+
636
+				$program_out_att[$outcome_id][$program_id] += 1;
637
+
246 638
 				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
639
+					if (!isset($program_out_ach[$outcome_id][$program_id])) {
640
+						$program_out_ach[$outcome_id][$program_id] = 0;
641
+					}
642
+					$program_out_ach[$outcome_id][$program_id] += 1;
247 643
 					$under_out_ach[$outcome_id] += 1;
248 644
 				}
249 645
 			}
@@ -251,6 +647,8 @@ class School extends Eloquent
251 647
 
252 648
 		$array_to_send['undergraduate_info']['outcomes_attempted_combined'] = $under_out_att;
253 649
 		$array_to_send['undergraduate_info']['outcomes_achieved_combined'] = $under_out_ach;
650
+		$array_to_send['undergraduate_info']['programs_attempted_combined'] = $program_out_att;
651
+		$array_to_send['undergraduate_info']['programs_achieved_combined'] = $program_out_ach;
254 652
 
255 653
 
256 654
 		$grad_out_att = [];
@@ -259,6 +657,8 @@ class School extends Eloquent
259 657
 		foreach ($outcomes as $outcome) {
260 658
 			$grad_out_att[$outcome->id] = 0;
261 659
 			$grad_out_ach[$outcome->id] = 0;
660
+			$program_out_att[$outcome->id] = [];
661
+			$program_out_ach[$outcome->id] = [];
262 662
 		}
263 663
 
264 664
 		//preprocess para combined_students
@@ -282,7 +682,8 @@ class School extends Eloquent
282 682
 			if (!isset($the_processed_table[$student_id][$outcome_id])) {
283 683
 				$the_processed_table[$student_id][$outcome_id] = array(
284 684
 					"criteria_attempted" => $result->criteria_attempted,
285
-					"criteria_achieved" => $result->criteria_achieved
685
+					"criteria_achieved" => $result->criteria_achieved,
686
+					'program_id' => $result->program_id
286 687
 				);
287 688
 			}
288 689
 			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
@@ -300,11 +701,22 @@ class School extends Eloquent
300 701
 			foreach ($outcome_ids as $out_id => $crit_information) {
301 702
 				$crit_att = $crit_information['criteria_attempted'];
302 703
 				$crit_ach = $crit_information['criteria_achieved'];
704
+				$program_id = $crit_information['program_id'];
303 705
 
304 706
 
305 707
 				$grad_out_att[$out_id] += 1;
306 708
 
709
+				if (!isset($program_out_att[$out_id][$program_id])) {
710
+					$program_out_att[$out_id][$program_id] = 0;
711
+				}
712
+
713
+				$program_out_att[$out_id][$program_id] += 1;
714
+
307 715
 				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
716
+					if (!isset($program_out_ach[$out_id][$program_id])) {
717
+						$program_out_ach[$out_id][$program_id] = 0;
718
+					}
719
+					$program_out_ach[$out_id][$program_id] += 1;
308 720
 					$grad_out_ach[$out_id] += 1;
309 721
 				}
310 722
 			}
@@ -312,6 +724,9 @@ class School extends Eloquent
312 724
 
313 725
 		$array_to_send['graduate_info']['outcomes_attempted_combined'] = $grad_out_att;
314 726
 		$array_to_send['graduate_info']['outcomes_achieved_combined'] = $grad_out_ach;
727
+		$array_to_send['graduate_info']['programs_attempted_combined'] = $program_out_att;
728
+		$array_to_send['graduate_info']['programs_achieved_combined'] = $program_out_ach;
729
+
315 730
 		Log::info($array_to_send);
316 731
 		return $array_to_send;
317 732
 	}

+ 14
- 1
app/routes.php Ver fichero

@@ -182,6 +182,8 @@ Route::group(array('before' => 'auth|has_access'), function () {
182 182
     );
183 183
 
184 184
 
185
+
186
+
185 187
     Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
186 188
     Route::get('printAnnualPlan/{annual_plan?}/{submit?}', 'AnnualPlansController@printAnnualPlan');
187 189
     Route::post('checkIfPlanReady', 'AnnualPlansController@checkIfPlanReady');
@@ -397,6 +399,12 @@ Route::group(array('before' => 'auth|has_access'), function () {
397 399
     Route::post('transformativeAction/objectivesFromOutcome', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@objectivesFromOutcome'));
398 400
 
399 401
 
402
+    //shared print_program and school
403
+
404
+    Route::get('print_program_students/{program_id}', 'ProgramsController@print_program_students');
405
+    Route::get('print_school_students_report/{school_id}', 'SchoolsController@print_school_students_report');
406
+
407
+
400 408
     /**
401 409
      * Administrator Routes
402 410
      */
@@ -481,7 +489,11 @@ Route::group(array('before' => 'auth|has_access'), function () {
481 489
     Route::group(array('before' => 'scoord'), function () {
482 490
         Route::get('school-coordinator-test', 'SchoolCoordinatorsController@overview_test');
483 491
         Route::get('school-coordinator', 'SchoolCoordinatorsController@overview');
484
-        Route::get('school/{id}', 'SchoolsController@show');
492
+        Route::get('school/{id}', array(
493
+            'as' => 'school-coordinator',
494
+            'uses' => 'SchoolsController@show'
495
+        ));
496
+
485 497
         Route::get('program/{id}', 'ProgramsController@show');
486 498
         Route::post('programs/report', 'ProgramsController@showReport');
487 499
         Route::get('template/{template}', 'TemplatesController@show');
@@ -680,6 +692,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
680 692
         Route::post('activities/{id}', array('before' => 'csrf', 'uses' => 'ActivitiesController@create'));
681 693
         Route::get('students', 'StudentsController@students');
682 694
         Route::get('program', 'ProfessorsController@program');
695
+        Route::get("program_students/{program_id}", 'ProgramsController@studentsProgramAssessmentReportForProfessors');
683 696
         Route::get('personal-information', 'ProfessorsController@personalInformation');
684 697
         Route::get('manual', 'ProfessorsController@manual');
685 698
         Route::post('loadRubric', array('before' => 'csrf', 'uses' => 'RubricsController@fetch'));

+ 9
- 6
app/views/local/managers/pCoords/overview.blade.php Ver fichero

@@ -22,10 +22,13 @@
22 22
 
23 23
                 <br>
24 24
                 <br>
25
+                <div class="btn-group pull-left">
26
+                    <a href="{{ action('ProgramsController@studentProgramAssessmentReport', array($program_item['program']->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by Program Students</a>
27
+
28
+                </div>
25 29
                 <div class="btn-group pull-right">
26 30
                      <a href="{{ action('ProgramsController@print_program', array($program_item['program']->id)); }}" class="btn btn-primary" alt="print"><span class="glyphicon glyphicon-print"></span></a>
27
-                <button type='button' class = 'btn btn-primary' id="change-view-btn{{$index}}" onclick="changeView('#allGraph{{$index}}','#programGraph{{$index}}', {{$index}}, 'Show Program Courses')">Show Program Students</button>
28
-                </div>
31
+                  </div>
29 32
                 <br>
30 33
                 <br>
31 34
 
@@ -298,7 +301,7 @@
298 301
             e.preventDefault()
299 302
             $(this).tab('show');
300 303
         });
301
-
304
+ 
302 305
         $('#graph{{$index}}').highcharts({
303 306
             chart: {
304 307
                 type: 'bar'
@@ -445,7 +448,7 @@
445 448
                 ]
446 449
             }]
447 450
         });
448
-
451
+{{--}}
449 452
         $('#graph-stu-program{{$index}}').highcharts({
450 453
             chart: {
451 454
                 type: 'bar'
@@ -563,7 +566,7 @@
563 566
                     @endforeach
564 567
                 ]
565 568
 
566
-            },--}}{
569
+            },{
567 570
                 name: 'Obtained Value',
568 571
                 color: '#e70033',
569 572
                 dataLabels: {
@@ -591,7 +594,7 @@
591 594
                     @endforeach
592 595
                 ]
593 596
             }]
594
-        });
597
+        });--}}
595 598
 
596 599
     });
597 600
 @endforeach

+ 3
- 141
app/views/local/managers/shared/print_program.blade.php Ver fichero

@@ -16,9 +16,9 @@
16 16
 @section('main')
17 17
 
18 18
 <div class = "col-md-8" id="graph"></div>
19
-<div class = 'col-md-4'></div>
20
-<div class = "col-md-8" id="graph-stu-program"></div>
21
-<div class = 'col-md-4'></div>
19
+
20
+
21
+
22 22
 
23 23
 <h3>Courses</h3>
24 24
 @if($program_courses->count()>0)
@@ -239,143 +239,5 @@ $('#graph').highcharts({
239 239
     }]
240 240
 });
241 241
 
242
-$('#graph-stu-program').highcharts({
243
-    chart: {
244
-        type: 'bar'
245
-    },
246
-    title: {
247
-        text: 'Performance by {{ $program->name }}\'s Students in Learning Outcomes '
248
-    },
249
-    legend: {
250
-        reversed: true,
251
-    },
252
-    xAxis: {
253
-        categories: [
254
-            @foreach($outcomes as $outcome)
255
-                "{{{ $outcome->name }}} <br>(N = {{$program_outcomes_attempted[$outcome->id]}}, {{$program_outcomes_achieved[$outcome->id]}})",
256
-            @endforeach
257
-        ],
258
-        labels: {
259
-            style: {
260
-                fontSize:'11px'
261
-            },
262
-            step:1,
263
-            useHTML:true,
264
-            formatter: function() {
265
-                return '<div style="width:100px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
266
-            },
267
-        }
268
-    },
269
-   
270
-    yAxis: {
271
-        min: 0,
272
-        max: 100,
273
-        title: {
274
-        text: 'Percentage'
275
-        }, 
276
-        @if($program->expected_outcome_target == null)
277
-                plotLines:[{
278
-            value:70.00,
279
-            color: '#000',
280
-            width:3,
281
-            zIndex:4,
282
-            label:{
283
-                text: 'Goal (70.00%)',
284
-                style: {
285
-                    color: '#000',
286
-                    fontSize: '14px',
287
-                }
288
-    
289
-            }
290
-        }]
291
-        @else
292
-        plotLines:[{
293
-            value:{{$program->expected_outcome_target->expected_target}},
294
-            color: '#000',
295
-            width:3,
296
-            zIndex:4,
297
-            label:{
298
-                text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
299
-                style: {
300
-                    color: '#000',
301
-                    fontSize: '14px',
302
-                }
303
-    
304
-            }
305
-        }]
306
-
307
-        @endif
308
-    },
309
-    tooltip: {
310
-        enabled:false
311
-    },
312
-    plotOptions: {
313
-            bar: {
314
-                //grouping: false,
315
-                shadow: false,
316
-                borderWidth: 0,
317
-            },
318
-            series: {
319
-                pointPadding: 0,
320
-                groupPadding: 0.075,
321
-                animation: false
322
-            },
323
-        },
324
-    series: [/*{
325
-        name: 'Expected Value',
326
-        color: '#555555',
327
-        dataLabels: {
328
-            enabled: true,
329
-            fontSize: 8,
330
-            color: '#fff',
331
-            align: 'right',
332
-            format: '{y:.1f}%',
333
-            style: {
334
-                //fontWeight: 'bold'
335
-            },
336
-            y:-1
337
-        },
338
-        data: [
339
-            @foreach($outcomes as $index => $outcome)
340
-                @if(
341
-                    is_array($outcomes_attempted)
342
-                    && array_key_exists($outcome->id, $outcomes_attempted)
343
-                    && $outcomes_attempted[$outcome->id]!=0)
344
-                    {{{ $outcome->expected_outcome }}},
345
-                @else
346
-                    0,
347
-                @endif
348
-            @endforeach
349
-        ]
350
-
351
-    },*/{
352
-        name: 'Obtained Value',
353
-        color: '#e70033',
354
-        dataLabels: {
355
-            enabled: true,
356
-            fontSize: 8,
357
-            color: '#fff',
358
-            align: 'right',
359
-            format: '{y:.1f}%',
360
-            style: {
361
-                //fontWeight: 'bold'
362
-            },
363
-            y:-1
364
-        },
365
-        data:[
366
-            @foreach($outcomes as $index => $outcome)
367
-                @if(
368
-                    is_array($program_outcomes_attempted)
369
-                    && array_key_exists($outcome->id, $program_outcomes_attempted)
370
-                    && $program_outcomes_attempted[$outcome->id]!=0)
371
-                    {{{ ($program_outcomes_achieved[$outcome->id]/$program_outcomes_attempted[$outcome->id])*100 }}},
372
-                @else
373
-                    0,
374
-                @endif
375
-            @endforeach
376
-
377
-        ]
378
-    }]
379
-});
380 242
 
381 243
 @stop

+ 255
- 0
app/views/local/managers/shared/print_program_students.blade.php Ver fichero

@@ -0,0 +1,255 @@
1
+@extends('layouts.print')
2
+
3
+@section('header')
4
+<p class="header-text">
5
+    @foreach (Session::get('semesters_info') as $index => $semester_info)
6
+        {{ $semester_info }}
7
+        @if($index+1 != count(Session::get('semesters_info')))
8
+        <strong>&#183;</strong>
9
+        @endif
10
+    @endforeach
11
+</p>
12
+<p class="header-text">Program Assessment Results</p>
13
+<h1 class="header-text">{{{ $program->name}}}</h1>
14
+@stop
15
+
16
+@section('main')
17
+
18
+
19
+<div class="row">
20
+    <div class="col-md-8" id="graph_undergrad_combined"></div>
21
+</div>
22
+
23
+        <div class="row">
24
+            <div class="col-md-8">
25
+                <h3>Performance of {{ $program->name }} Students by Learning Outcome</h3>
26
+                @if($outcomes->count()>0)
27
+                    <table class="table table-striped table-condensed">
28
+                        <thead>
29
+                            <tr>
30
+                                <th>Program Id</th>
31
+                                <th>Program Is Graduate</th>
32
+                                <th>Learning Outcome</th>
33
+                                <th>Number Students</th>
34
+                                <th>Number Students that Achieved the Target</th>
35
+                                <th>Percentage of Students that Achieved the Target</th>
36
+                            </tr>
37
+                        </thead>
38
+                        
39
+                        <tbody>
40
+                            @foreach($outcomes_colap as $outcome)
41
+                                @if(isset($outcomes_attempted_colap[$outcome->id]))
42
+                              <tr>
43
+                                    <td>{{{ $program->id }}}</td>
44
+                                    <td>{{{ $program->is_graduate }}}</td>
45
+                                    <td>{{  $outcome->name }}</td>
46
+                                    <td>{{{ $outcomes_attempted_colap[$outcome->id] }}}</td>
47
+                                    <td>{{{ $outcomes_achieved_colap[$outcome->id] }}}</td>
48
+                                    <td>
49
+                                        @if($outcomes_attempted_colap[$outcome->id]!=0)
50
+                                            {{{ round($outcomes_achieved_colap[$outcome->id] / $outcomes_attempted_colap[$outcome->id]*100, 2) }}}%
51
+                                        @else
52
+                                            N/M
53
+                                        @endif
54
+                                    </td>
55
+                                </tr>
56
+                                @endif
57
+                            @endforeach
58
+                        </tbody>
59
+                    </table>
60
+                @else
61
+                    <p class="lead"> No courses assigned.</p>
62
+                @endif
63
+            </div>
64
+        </div>
65
+
66
+        <div class="row">
67
+            <div class="col-md-8">
68
+                <h3>Courses in this program</h3>
69
+                @if(count($grouped_courses)>0)
70
+                    <table class="table table-striped table-condensed">
71
+                        <thead>
72
+                            <tr>
73
+                                <th>Identifier</th>
74
+                                <th>Name</th>
75
+                                <th>Course Program</th>
76
+                                <th>Number of Students</th>
77
+                            </tr>
78
+                        </thead>
79
+                        
80
+                        <tbody>
81
+                            @foreach($grouped_courses as $grouped_course)
82
+                                <tr>
83
+                                    <td class="col-md-2">{{  $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')' }}</td>
84
+                                    <td class="col-md-4">{{{ $grouped_course->name}}}</td>
85
+                                    <td class="col-md-2">{{{ $grouped_course->program->code}}}</td>
86
+                                    <td class="col-md-3">{{{ $grouped_course->quantity }}}</td>
87
+                                </tr>
88
+                            @endforeach
89
+                        </tbody>
90
+                    </table>
91
+                @else
92
+                    <p class="lead"> No courses assigned.</p>
93
+                @endif
94
+            </div>
95
+        </div>
96
+
97
+
98
+
99
+
100
+<!-- =================== end tabs =================== -->
101
+
102
+@stop
103
+
104
+@section('included-js')
105
+
106
+<!-- HighCharts -->
107
+<script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
108
+<!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
109
+
110
+@stop
111
+
112
+@section('javascript')
113
+
114
+$('#graph_undergrad_combined').highcharts({
115
+    chart: {
116
+        type: 'bar'
117
+    },
118
+    title: {
119
+        text: 'Performance of {{ $program->name }} Students by Learning Outcome'
120
+    },
121
+    legend: {
122
+                reversed: true,
123
+            },
124
+    xAxis: {
125
+        categories: [
126
+            @foreach($outcomes_colap as $outcome)
127
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted_colap[$outcome->id] }}}, {{{ $outcomes_achieved_colap[$outcome->id] }}})",
128
+            @endforeach
129
+        ],
130
+        labels: {
131
+            style: {
132
+                fontSize:'11px'
133
+            },
134
+            step:1,
135
+            useHTML:true,
136
+            formatter: function() {
137
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
138
+            },
139
+        }
140
+    },
141
+    yAxis: {
142
+        min: 0,
143
+        max: 100,
144
+        title: {
145
+            text: 'Percentage'
146
+        },        @if($program->expected_outcome_target == null)
147
+        plotLines:[{
148
+    value:70,
149
+    color: '#000',
150
+    width:3,
151
+    zIndex:4,
152
+    label:{
153
+        text: 'Goal (70%)',
154
+        style: {
155
+            color: '#000',
156
+            fontSize: '14px',
157
+        }
158
+
159
+    }
160
+}]
161
+@else
162
+plotLines:[{
163
+    value:{{$program->expected_outcome_target->expected_target}},
164
+    color: '#000',
165
+    width:3,
166
+    zIndex:4,
167
+    label:{
168
+        text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
169
+        style: {
170
+            color: '#000',
171
+            fontSize: '14px',
172
+        }
173
+
174
+    }
175
+}]
176
+@endif
177
+
178
+    },
179
+    tooltip: {
180
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
181
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
182
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
183
+        footerFormat: '</table>',
184
+        shared: true,
185
+        useHTML: true
186
+    },
187
+    plotOptions: {
188
+        bar: {
189
+            //grouping: false,
190
+            shadow: false,
191
+            borderWidth: 0,
192
+        },
193
+        series: {
194
+        pointPadding: 0,
195
+        groupPadding: 0.075
196
+        },
197
+    },
198
+    series: [/*{
199
+        name: 'Expected Value',
200
+        color: '#555555',
201
+        dataLabels: {
202
+            enabled: true,
203
+            fontSize: 8,
204
+            color: '#fff',
205
+            align: 'right',
206
+            format: '{y:.1f}%',
207
+            style: {
208
+                //fontWeight: 'bold'
209
+            },
210
+            y:-1
211
+        },
212
+        data: [
213
+            @foreach($outcomes_colap as $index => $outcome)
214
+                @if(
215
+                    is_array($outcomes_attempted_colap)
216
+                    && array_key_exists($outcome->id, $outcomes_attempted_colap)
217
+                    && $outcomes_attempted_colap[$outcome->id]!=0)
218
+                @else
219
+                    0,
220
+                @endif
221
+            @endforeach
222
+        ]
223
+
224
+    },*/{
225
+        name: 'Obtained Value',
226
+        color: '#e70033',
227
+        dataLabels: {
228
+            enabled: true,
229
+            fontSize: 8,
230
+            color: '#fff',
231
+            align: 'right',
232
+            format: '{y:.1f}%',
233
+            style: {
234
+                //fontWeight: 'bold'
235
+            },
236
+            y:-1
237
+        },
238
+        data:[
239
+            @foreach($outcomes_colap as $index => $outcome)
240
+                @if(
241
+                    is_array($outcomes_attempted_colap)
242
+                    && array_key_exists($outcome->id, $outcomes_attempted_colap)
243
+                    && $outcomes_attempted_colap[$outcome->id]!=0)
244
+                    {{{ ($outcomes_achieved_colap[$outcome->id]/$outcomes_attempted_colap[$outcome->id])*100 }}},
245
+                @else
246
+                    0,
247
+                @endif
248
+            @endforeach
249
+        ]
250
+    }]
251
+});
252
+
253
+
254
+
255
+@stop

+ 44
- 20
app/views/local/managers/shared/print_school.blade.php Ver fichero

@@ -15,7 +15,7 @@
15 15
 
16 16
 @section('main')
17 17
 
18
-
18
+ 
19 19
 <h3>Programs</h3>
20 20
 <table class="tabletable-condensed">
21 21
     <tr>
@@ -51,16 +51,29 @@
51 51
     </thead>
52 52
     <tbody>
53 53
         @foreach($outcomes_undergrad as $outcome)
54
+        <?php $count = 0;?>
54 55
             <tr>
55 56
                 <td class="col-md-6">{{ $outcome->name }}</td>
56 57
                 <td class="col-md-2">{{{ count($attemptedUndergradProgramsPerOutcome[$outcome->id]) }}}</td>
57
-                <td class="col-md-2">{{{ count($achievedUndergradProgramsPerOutcome[$outcome->id]) }}}</td>
58
+                @foreach($undergrad_programs as $program)
59
+                    <?php
60
+                        if(isset($achievedUndergradProgramsPerOutcome[$outcome->id][$program->id])
61
+                            && $achievedUndergradProgramsPerOutcome[$outcome->id][$program->id] / $attemptedUndergradProgramsPerOutcome[$outcome->id][$program->id] * 100 >= $expected_target_for_undergradprograms)
62
+                        $count++;
63
+                                                
64
+
65
+                                                
66
+                            ?>
67
+
68
+                @endforeach
69
+
70
+                <td class="col-md-2">{{{ $count }}}</td>
58 71
                 <td class="col-md-2">
59
-                    @if(count($attemptedUndergradProgramsPerOutcome[$outcome->id])!=0)
60
-                        {{{ round( count($achievedUndergradProgramsPerOutcome[$outcome->id]) / count($attemptedUndergradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
61
-                    @else
62
-                        N/M
63
-                    @endif
72
+                @if(count($attemptedUndergradProgramsPerOutcome[$outcome->id])!=0)
73
+                    {{{ round( $count / count($attemptedUndergradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
74
+                @else
75
+                    N/M
76
+                @endif
64 77
                 </td>
65 78
             </tr>
66 79
         @endforeach
@@ -168,19 +181,30 @@
168 181
     </thead>
169 182
     <tbody>
170 183
         @foreach($outcomes_grad as $outcome)
171
-        <tr>
172
-            <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
173
-            <td class="col-md-2">{{{ count($attemptedGradProgramsPerOutcome[$outcome->id]) }}}</td>
174
-            <td class="col-md-2">{{{ count($achievedGradProgramsPerOutcome[$outcome->id]) }}}</td>
175
-            <td class="col-md-2">
176
-                @if(count($attemptedGradProgramsPerOutcome[$outcome->id])!=0)
177
-                    {{{ round(count($achievedGradProgramsPerOutcome[$outcome->id]) / count($attemptedGradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
178
-                @else
179
-                    N/M
180
-                @endif
181
-            </td>
182
-        </tr>
183
-        @endforeach
184
+        <?php $count = 0;?>
185
+            <tr>
186
+                <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
187
+                <td class="col-md-2">{{{ count($attemptedGradProgramsPerOutcome[$outcome->id]) }}}</td>
188
+                @foreach($grad_programs as $program)
189
+                <?php
190
+                if(isset($achievedGradProgramsPerOutcome[$outcome->id][$program->id])
191
+                    && $achievedGradProgramsPerOutcome[$outcome->id][$program->id] / $attemptedGradProgramsPerOutcome[$outcome->id][$program->id] * 100 >= $expected_target_for_gradprograms)
192
+                $count++;
193
+                
194
+
195
+                
196
+                    ?>
197
+
198
+            @endforeach
199
+                <td class="col-md-2">{{{ $count }}}</td>
200
+                <td class="col-md-2">
201
+                    @if(count($attemptedGradProgramsPerOutcome[$outcome->id])!=0)
202
+                        {{{ round($count / count($attemptedGradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
203
+                    @else
204
+                        N/M
205
+                    @endif
206
+                </td></tr>
207
+                @endforeach
184 208
     </tbody>
185 209
     <tfoot></tfoot>
186 210
     <caption>N/M: Not Measured</caption>

+ 489
- 0
app/views/local/managers/shared/print_school_students_report.blade.php Ver fichero

@@ -0,0 +1,489 @@
1
+@extends('layouts.print')
2
+
3
+@section('header')
4
+<p class="header-text">
5
+    @foreach (Session::get('semesters_info') as $index => $semester_info)
6
+        {{ $semester_info }}
7
+        @if($index+1 != count(Session::get('semesters_info')))
8
+        <strong>&#183;</strong>
9
+        @endif
10
+    @endforeach
11
+</p>
12
+
13
+<p class="header-text">Assessment Results</p>
14
+<h1 class="header-text">School of {{{ $school->name}}}</h1>
15
+@stop
16
+
17
+@section('main')
18
+
19
+
20
+
21
+<br>
22
+<div class="row">
23
+    <div class="col-md-8" id="graph2"></div>
24
+</div>
25
+
26
+<div class="row">
27
+    <div class="col-md-8">
28
+        <h3>Performance of {{ $school->name }} Undergrad Students by Learning Outcome</h3>
29
+        @if($outcomes->count()>0)
30
+            <table class="table table-striped table-condensed datatable">
31
+                <thead>
32
+                    <tr>
33
+                        <th>Learning Outcome</th>
34
+                        <th>Program</th>
35
+                        <th>Program Id</th>
36
+                        <th>Program Is Graduate</th>
37
+                        <th>Number Students</th>
38
+                        <th>Number Students that Achieved the Target</th>
39
+                        <th>Percentage of Students that Achieved the Target</th>
40
+                        <!--<th>Semesters</th>-->
41
+                    </tr>
42
+                </thead>
43
+                
44
+                <tbody>
45
+                    @foreach($undergraduate_programs as $program)
46
+                      @foreach($outcomes_colap as $outcome)
47
+                        @if(isset($outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id]))
48
+                        <tr>
49
+                            <td>{{  $outcome->name }}</td>
50
+                            <td>{{{ $program->name }}}</td>
51
+                            <td>{{{ $program->id }}}</td>
52
+                            <td>{{{ $program->is_graduate }}}</td>
53
+                            <td>{{{ $outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id] }}}</td>
54
+                            @if(isset($outcomes_undergrad_program_achieved_colap[$outcome->id][$program->id]))
55
+            
56
+                                <td>{{{ $outcomes_undergrad_program_achieved_colap[$outcome->id][$program->id] }}}</td>
57
+                                <td>
58
+                                    @if($outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id]!=0)
59
+                                        
60
+                                        {{{ round($outcomes_undergrad_program_achieved_colap[$outcome->id][$program->id] / $outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id]*100, 2) }}}%
61
+                                    
62
+                                        
63
+                                @else
64
+                                    N/M
65
+                                @endif
66
+                                </td>
67
+                            @else
68
+                                <td>0</td><td>0%</td>
69
+                                @endif
70
+                                {{--}}
71
+                                
72
+                            <td>
73
+                            @if(isset($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id]))
74
+                                {{{ str_replace('"','',json_encode($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id])) }}}
75
+                            @else
76
+                                N/M
77
+                            @endif
78
+                            
79
+                            </td>--}}
80
+                        </tr>
81
+                           @endif
82
+                      @endforeach
83
+                    @endforeach
84
+                </tbody>
85
+            </table>
86
+        @else
87
+            <p class="lead"> No courses assigned.</p>
88
+        @endif
89
+    </div>
90
+</div>
91
+
92
+<div class="row">
93
+    <div class="col-md-8" id="graph3"></div>
94
+</div>
95
+<div class="row">
96
+    <div class="col-md-8">
97
+        <h3>Performance of {{ $school->name }} Graduate Students by Learning Outcome</h3>
98
+        @if($outcomes->count()>0)
99
+            <table class="table table-striped table-condensed datatable">
100
+                <thead>
101
+                    <tr>
102
+                        <th>Learning Outcome</th>
103
+                        <th>Program</th>
104
+                        <th>Program Id</th>
105
+                        <th>Program Is Graduate</th>
106
+                        <th>Number Students</th>
107
+                        <th>Number Students that Achieved the Target</th>
108
+                        <th>Percentage of Students that Achieved the Target</th>
109
+                        
110
+                    </tr>
111
+                </thead>
112
+                
113
+                <tbody>
114
+                    @foreach($graduate_programs as $program)
115
+                      @foreach($outcomes_colap as $outcome)
116
+                        @if(isset($outcomes_grad_program_attempted_colap[$outcome->id][$program->id]))
117
+                        <tr>
118
+                            <td>{{  $outcome->name }}</td>
119
+                            <td>{{{ $program->name }}}</td>
120
+                            <td>{{{ $program->id }}}</td>
121
+                            <td>{{{ $program->is_graduate }}}</td>
122
+                            <td>{{{ $outcomes_grad_program_attempted_colap[$outcome->id][$program->id] }}}</td>
123
+                            @if((isset($outcomes_grad_program_achieved_colap[$outcome->id][$program->id])))
124
+                                <td>{{{ $outcomes_grad_program_achieved_colap[$outcome->id][$program->id] }}}</td>
125
+                                <td>
126
+                                    @if($outcomes_grad_program_attempted_colap[$outcome->id][$program->id]!=0)
127
+                                        
128
+                                    {{{ round($outcomes_grad_program_achieved_colap[$outcome->id][$program->id] / $outcomes_grad_program_attempted_colap[$outcome->id][$program->id]*100, 2) }}}%
129
+                                
130
+                                        
131
+                                @else
132
+                                        N/M
133
+                                    @endif
134
+                                </td>
135
+                                @else
136
+                                <td>
137
+                                    0</td>
138
+                                    <td>0%</td>
139
+                                @endif
140
+                            
141
+                        </tr>
142
+                           @endif
143
+                      @endforeach
144
+                    @endforeach
145
+                </tbody>
146
+            </table>
147
+        @else
148
+            <p class="lead"> No courses assigned.</p>
149
+        @endif
150
+    </div>
151
+</div>
152
+
153
+<div class="row">
154
+    <div class="col-md-12">
155
+        <h3>Courses in this School</h3>
156
+        @if(count($grouped_courses)>0)
157
+            <table class="table table-striped table-condensed datatable">
158
+                <thead>
159
+                    <tr>
160
+                        <th>Identifier</th>
161
+                        <th>Name</th>
162
+                        <th>Course Program</th>
163
+                        <th>Number of Students</th>
164
+                    </tr>
165
+                </thead>
166
+                <tfoot>
167
+                    <tr class="column-search">
168
+                        <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
169
+                        <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
170
+                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
171
+                        <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
172
+                    </tr>
173
+                </tfoot>
174
+                <tbody>
175
+                    @foreach($grouped_courses as $grouped_course)
176
+                        <tr>
177
+                            <td class="col-md-2">{{  $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')' }}</td>
178
+                            <td class="col-md-4">{{{ $grouped_course->name}}}</td>
179
+                            <td class="col-md-2">{{{ $grouped_course->program->code}}}</td>
180
+                            <td class="col-md-3">{{{ $grouped_course->quantity }}}</td>
181
+                        </tr>
182
+                    @endforeach
183
+                </tbody>
184
+            </table>
185
+        @else
186
+            <p class="lead"> No courses assigned.</p>
187
+        @endif
188
+    </div>
189
+</div>
190
+
191
+@stop
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+@section('included-js')
201
+
202
+<!-- HighCharts -->
203
+<script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
204
+<!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
205
+
206
+@stop
207
+
208
+@section('javascript')
209
+$(function () {
210
+
211
+    $('#schoolTabs a').click(function (e) {
212
+        e.preventDefault()
213
+        $(this).tab('show');
214
+    });
215
+   
216
+$('#graph2').highcharts({
217
+    chart: {
218
+        type: 'bar'
219
+    }, 
220
+    title: {
221
+        text: 'Performance of {{ $school->name }} Undergraduate Students by Learning Outcome'
222
+    },
223
+    legend: {
224
+                reversed: true,
225
+            },
226
+    xAxis: {
227
+        categories: [
228
+            @foreach($outcomes_colap as $outcome)
229
+            @if(isset($outcomes_undergraduate_attempted_colap_todo[$outcome->id]) &&
230
+                    isset($outcomes_undergraduate_achieved_colap_todo[$outcome->id]))
231
+                    "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_undergraduate_attempted_colap_todo[$outcome->id] }}}, {{{ $outcomes_undergraduate_achieved_colap_todo[$outcome->id] }}})",
232
+                    @elseif(isset($outcomes_undergraduate_attempted_colap_todo[$outcome->id]))
233
+                    "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_undergraduate_attempted_colap_todo[$outcome->id] }}}, 0)",
234
+                    
235
+                    @else
236
+                        "{{{ $outcome->name }}}<br>(N = 0, 0)",         	
237
+                    @endif
238
+               @endforeach
239
+        ],
240
+        labels: {
241
+            style: {
242
+                fontSize:'11px'
243
+            },
244
+            step:1,
245
+            useHTML:true,
246
+            formatter: function() {
247
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
248
+            },
249
+        }
250
+    },
251
+    yAxis: {
252
+        min: 0,
253
+        max: 100,
254
+        title: {
255
+            text: 'Percentage'
256
+        },
257
+        			plotLines:[{
258
+		value:70,
259
+		color: '#000',
260
+		width:3,
261
+		zIndex:4,
262
+		label:{
263
+			text: 'Goal (70%)',
264
+			style: {
265
+				color: '#000',
266
+				fontSize: '14px',
267
+			}
268
+
269
+		}
270
+	}]
271
+
272
+    },
273
+    tooltip: {
274
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
275
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
276
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
277
+        footerFormat: '</table>',
278
+        shared: true,
279
+        useHTML: true
280
+    },
281
+    plotOptions: {
282
+        bar: {
283
+            //grouping: false,
284
+            shadow: false,
285
+            borderWidth: 0,
286
+        },
287
+        series: {
288
+        pointPadding: 0,
289
+        groupPadding: 0.075
290
+        },
291
+    },
292
+    series: [/*{
293
+        name: 'Expected Value',
294
+        color: '#555555',
295
+        dataLabels: {
296
+            enabled: true,
297
+            fontSize: 8,
298
+            color: '#fff',
299
+            align: 'right',
300
+            format: '{y:.1f}%',
301
+            style: {
302
+                //fontWeight: 'bold'
303
+            },
304
+            y:-1
305
+        },
306
+        data: [
307
+            @foreach($outcomes_colap as $index => $outcome)
308
+                @if(
309
+                    is_array($outcomes_undergraduate_attempted_colap_todo)
310
+                    && array_key_exists($outcome->id, $outcomes_undergraduate_attempted_colap_todo)
311
+                    && $outcomes_undergraduate_attempted_colap_todo[$outcome->id]!=0)
312
+                @else
313
+                    0,
314
+                @endif
315
+            @endforeach
316
+        ]
317
+
318
+    },*/{
319
+        name: 'Obtained Value',
320
+        color: '#e70033',
321
+        dataLabels: {
322
+            enabled: true,
323
+            fontSize: 8,
324
+            color: '#fff',
325
+            align: 'right',
326
+            format: '{y:.1f}%',
327
+            style: {
328
+                //fontWeight: 'bold'
329
+            },
330
+            y:-1
331
+        },
332
+        data:[
333
+            @foreach($outcomes_colap as $index => $outcome)
334
+                @if(
335
+                    is_array($outcomes_undergraduate_attempted_colap_todo)
336
+                    && array_key_exists($outcome->id, $outcomes_undergraduate_attempted_colap_todo)
337
+                    && $outcomes_undergraduate_attempted_colap_todo[$outcome->id]!=0
338
+                    && isset($outcomes_undergraduate_achieved_colap_todo[$outcome->id]))
339
+                    {{{ ($outcomes_undergraduate_achieved_colap_todo[$outcome->id]/$outcomes_undergraduate_attempted_colap_todo[$outcome->id])*100 }}},
340
+                @else
341
+                    0,
342
+                @endif
343
+            @endforeach
344
+        ]
345
+    }]
346
+}); 
347
+
348
+
349
+$('#graph3').highcharts({
350
+    chart: {
351
+        type: 'bar'
352
+    }, 
353
+    title: {
354
+        text: 'Performance of {{ $school->name }} Graduate Students by Learning Outcome'
355
+    },
356
+    legend: {
357
+                reversed: true,
358
+            },
359
+    xAxis: {
360
+        categories: [
361
+            @foreach($outcomes_colap as $outcome)
362
+            @if(isset($outcomes_graduate_attempted_colap_todo[$outcome->id])
363
+            && isset($outcomes_graduate_achieved_colap_todo[$outcome->id]))
364
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_graduate_attempted_colap_todo[$outcome->id] }}}, {{{ $outcomes_graduate_achieved_colap_todo[$outcome->id] }}})",
365
+            @elseif(isset($outcomes_graduate_attempted_colap_todo[$outcome->id]))
366
+            "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_graduate_attempted_colap_todo[$outcome->id] }}}, 0)",
367
+          @else
368
+          "{{{ $outcome->name }}}<br>(N = 0, 0)",
369
+          @endif
370
+                @endforeach
371
+        ],
372
+        labels: {
373
+            style: {
374
+                fontSize:'11px'
375
+            },
376
+            step:1,
377
+            useHTML:true,
378
+            formatter: function() {
379
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
380
+            },
381
+        }
382
+    },
383
+    yAxis: {
384
+        min: 0,
385
+        max: 100,
386
+        title: {
387
+            text: 'Percentage'
388
+        },
389
+        			plotLines:[{
390
+		value:70,
391
+		color: '#000',
392
+		width:3,
393
+		zIndex:4,
394
+		label:{
395
+			text: 'Goal (70%)',
396
+			style: {
397
+				color: '#000',
398
+				fontSize: '14px',
399
+			}
400
+
401
+		}
402
+	}]
403
+
404
+    },
405
+    tooltip: {
406
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
407
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
408
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
409
+        footerFormat: '</table>',
410
+        shared: true,
411
+        useHTML: true
412
+    },
413
+    plotOptions: {
414
+        bar: {
415
+            //grouping: false,
416
+            shadow: false,
417
+            borderWidth: 0,
418
+        },
419
+        series: {
420
+        pointPadding: 0,
421
+        groupPadding: 0.075
422
+        },
423
+    },
424
+    series: [/*{
425
+        name: 'Expected Value',
426
+        color: '#555555',
427
+        dataLabels: {
428
+            enabled: true,
429
+            fontSize: 8,
430
+            color: '#fff',
431
+            align: 'right',
432
+            format: '{y:.1f}%',
433
+            style: {
434
+                //fontWeight: 'bold'
435
+            },
436
+            y:-1
437
+        },
438
+        data: [
439
+            @foreach($outcomes_colap as $index => $outcome)
440
+                @if(
441
+                    is_array($outcomes_graduate_attempted_colap_todo)
442
+                    && array_key_exists($outcome->id, $outcomes_graduate_attempted_colap_todo)
443
+                    && $outcomes_graduate_attempted_colap_todo[$outcome->id]!=0
444
+                    )
445
+                @else
446
+                    0,
447
+                @endif
448
+            @endforeach
449
+        ]
450
+
451
+    },*/{
452
+        name: 'Obtained Value',
453
+        color: '#e70033',
454
+        dataLabels: {
455
+            enabled: true,
456
+            fontSize: 8,
457
+            color: '#fff',
458
+            align: 'right',
459
+            format: '{y:.1f}%',
460
+            style: {
461
+                //fontWeight: 'bold'
462
+            },
463
+            y:-1
464
+        },
465
+        data:[
466
+            @foreach($outcomes_colap as $index => $outcome)
467
+                @if(
468
+                    is_array($outcomes_graduate_attempted_colap_todo)
469
+                    && array_key_exists($outcome->id, $outcomes_graduate_attempted_colap_todo)
470
+                    && $outcomes_graduate_attempted_colap_todo[$outcome->id]!=0
471
+                    && isset($outcomes_graduate_achieved_colap_todo[$outcome->id]))
472
+                    {{{ ($outcomes_graduate_achieved_colap_todo[$outcome->id]/$outcomes_graduate_attempted_colap_todo[$outcome->id])*100 }}},
473
+                @else
474
+                    0,
475
+                @endif
476
+            @endforeach
477
+        ]
478
+    }]
479
+});
480
+});
481
+
482
+
483
+   
484
+
485
+    // Include dummy graph for outcomes
486
+    @include('global.dummy-outcomes')
487
+
488
+
489
+@stop

+ 23
- 12
app/views/local/managers/shared/program_student_result.blade.php Ver fichero

@@ -6,13 +6,24 @@
6 6
         @include('local.managers.admins._new_navigation')
7 7
     @elseif($role==2)
8 8
         @include('local.managers.sCoords._new_navigation')
9
+    @elseif($role==3)
10
+    @include('local.managers.pCoords._new_navigation')
11
+    @else
12
+    @include('local.professors._navigation')
13
+
9 14
      @endif
10
-@stop
15
+
16
+@stop 
11 17
 
12 18
 @section('main')
19
+@if($role!=4)
13 20
 <a href="{{ action('ProgramsController@show', array($program->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by Program Courses</a>
21
+@else
14 22
 
15
-<a href="{{ action('ProgramsController@print_program', array($program->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
23
+<a href="{{ action('ProfessorsController@program') }}" class="btn btn-primary pull-left" alt="print">Go to Performance by Program Courses</a>
24
+@endif
25
+
26
+<a href="{{ action('ProgramsController@print_program_students', array($program->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
16 27
 <br>
17 28
 <br>
18 29
 <div class="row">
@@ -52,10 +63,10 @@
52 63
                                     <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
53 64
                                     <th><select class="column-search-select form-control"><option value=""></option></select></th>
54 65
                                 </tr>
55
-                            </tfoot>
66
+                            </tfoot> 
56 67
                             <tbody>
57 68
                                 @foreach($outcomes_colap as $outcome)
58
-                                    @if(isset($outcomes_attempted_colap[$program->id][$outcome->id]))
69
+                                    @if(isset($outcomes_attempted_colap[$outcome->id]))
59 70
               					<tr>
60 71
 										<td>{{{ $program->id }}}</td>
61 72
 										<td>{{{ $program->is_graduate }}}</td>
@@ -63,7 +74,7 @@
63 74
 										<td>{{{ $outcomes_attempted_colap[$outcome->id] }}}</td>
64 75
 										<td>{{{ $outcomes_achieved_colap[$outcome->id] }}}</td>
65 76
 										<td>
66
-											@if($outcomes_attempted[$outcome->id]!=0)
77
+											@if($outcomes_attempted_colap[$outcome->id]!=0)
67 78
 												{{{ round($outcomes_achieved_colap[$outcome->id] / $outcomes_attempted_colap[$outcome->id]*100, 2) }}}%
68 79
 											@else
69 80
 												N/M
@@ -112,7 +123,7 @@
112 123
                             </tfoot>
113 124
                             <tbody>
114 125
                                 @foreach($outcomes as $outcome)
115
-                                     @if(isset($outcomes_attempted[$program->id][$outcome->id]))
126
+                                     @if(isset($outcomes_attempted[$outcome->id]))
116 127
                                    <tr>
117 128
 										<td>{{{ $program->id }}}</td>
118 129
 										<td>{{{ $program->is_graduate }}}</td>
@@ -176,7 +187,7 @@
176 187
                                     <tr>
177 188
                                         <td class="col-md-2">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
178 189
                                         <td class="col-md-4">{{{ $grouped_course->name}}}</td>
179
-                                        <td class="col-md-2">{{{ $grouped_course->program_code}}}</td>
190
+                                        <td class="col-md-2">{{{ $grouped_course->program->code}}}</td>
180 191
                                         <td class="col-md-3">{{{ $grouped_course->quantity }}}</td>
181 192
                                     </tr>
182 193
                                 @endforeach
@@ -373,7 +384,7 @@ $('#graph').highcharts({
373 384
         groupPadding: 0.075
374 385
         },
375 386
     },
376
-    series: [{
387
+    series: [/*{
377 388
         name: 'Expected Value',
378 389
         color: '#555555',
379 390
         dataLabels: {
@@ -399,7 +410,7 @@ $('#graph').highcharts({
399 410
             @endforeach
400 411
         ]
401 412
 
402
-    },{
413
+    },*/{
403 414
         name: 'Obtained Value',
404 415
         color: '#e70033',
405 416
         dataLabels: {
@@ -512,7 +523,7 @@ plotLines:[{
512 523
         groupPadding: 0.075
513 524
         },
514 525
     },
515
-    series: [{
526
+    series: [/*{
516 527
         name: 'Expected Value',
517 528
         color: '#555555',
518 529
         dataLabels: {
@@ -538,7 +549,7 @@ plotLines:[{
538 549
             @endforeach
539 550
         ]
540 551
 
541
-    },{
552
+    },*/{
542 553
         name: 'Obtained Value',
543 554
         color: '#e70033',
544 555
         dataLabels: {
@@ -556,7 +567,7 @@ plotLines:[{
556 567
             @foreach($outcomes_colap as $index => $outcome)
557 568
                 @if(
558 569
                     is_array($outcomes_attempted_colap)
559
-                    && array_key_exists($outcome->id, $outcomes_attempted)
570
+                    && array_key_exists($outcome->id, $outcomes_attempted_colap)
560 571
                     && $outcomes_attempted_colap[$outcome->id]!=0)
561 572
                     {{{ ($outcomes_achieved_colap[$outcome->id]/$outcomes_attempted_colap[$outcome->id])*100 }}},
562 573
                 @else

+ 30
- 5
app/views/local/managers/shared/school.blade.php Ver fichero

@@ -63,7 +63,7 @@
63 63
             @endif
64 64
                 </div>
65 65
 
66
-                        </div>
66
+        </div>
67 67
 
68 68
         <div>
69 69
             <!-- Nav tabs -->
@@ -90,13 +90,26 @@
90 90
                                 </thead>
91 91
                                 <tbody>
92 92
                                     @foreach($outcomes_undergrad as $outcome)
93
+                                    <?php $count = 0;?>
93 94
                                         <tr>
94 95
                                             <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
95 96
                                             <td class="col-md-2">{{{ count($attemptedUndergradProgramsPerOutcome[$outcome->id]) }}}</td>
96
-                                            <td class="col-md-2">{{{ count($achievedUndergradProgramsPerOutcome[$outcome->id]) }}}</td>
97
+                                            @foreach($undergrad_programs as $program)
98
+                                                <?php
99
+                                                if(isset($achievedUndergradProgramsPerOutcome[$outcome->id][$program->id])
100
+                                                    && $achievedUndergradProgramsPerOutcome[$outcome->id][$program->id] / $attemptedUndergradProgramsPerOutcome[$outcome->id][$program->id] * 100 >= $expected_target_for_undergradprograms)
101
+                                                $count++;
102
+                                                
103
+
104
+                                                
105
+                                                    ?>
106
+
107
+                                            @endforeach
108
+
109
+                                            <td class="col-md-2">{{{ $count }}}</td>
97 110
                                             <td class="col-md-2">
98 111
                                                 @if(count($attemptedUndergradProgramsPerOutcome[$outcome->id])!=0)
99
-                                                    {{{ round( count($achievedUndergradProgramsPerOutcome[$outcome->id]) / count($attemptedUndergradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
112
+                                                    {{{ round( $count / count($attemptedUndergradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
100 113
                                                 @else
101 114
                                                     N/M
102 115
                                                 @endif
@@ -296,13 +309,25 @@
296 309
                                 </thead>
297 310
                                 <tbody>
298 311
                                     @foreach($outcomes_grad as $outcome)
312
+                                    <?php $count = 0;?>
299 313
                                         <tr>
300 314
                                             <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
301 315
                                             <td class="col-md-2">{{{ count($attemptedGradProgramsPerOutcome[$outcome->id]) }}}</td>
302
-                                            <td class="col-md-2">{{{ count($achievedGradProgramsPerOutcome[$outcome->id]) }}}</td>
316
+                                            @foreach($grad_programs as $program)
317
+                                            <?php
318
+                                            if(isset($achievedGradProgramsPerOutcome[$outcome->id][$program->id])
319
+                                                && $achievedGradProgramsPerOutcome[$outcome->id][$program->id] / $attemptedGradProgramsPerOutcome[$outcome->id][$program->id] * 100 >= $expected_target_for_gradprograms)
320
+                                            $count++;
321
+                                            
322
+
323
+                                            
324
+                                                ?>
325
+
326
+                                        @endforeach
327
+                                            <td class="col-md-2">{{{ $count }}}</td>
303 328
                                             <td class="col-md-2">
304 329
                                                 @if(count($attemptedGradProgramsPerOutcome[$outcome->id])!=0)
305
-                                                    {{{ round(count($achievedGradProgramsPerOutcome[$outcome->id]) / count($attemptedGradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
330
+                                                    {{{ round($count / count($attemptedGradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
306 331
                                                 @else
307 332
                                                     N/M
308 333
                                                 @endif

+ 537
- 75
app/views/local/managers/shared/school_student_result.blade.php Ver fichero

@@ -12,25 +12,28 @@
12 12
 @section('main')
13 13
 <a href="{{ action('SchoolsController@show', array($school->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by School Courses</a>
14 14
 
15
-<a href="{{ action('ProgramsController@print_program', array($school->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
15
+<a href="{{ action('SchoolsController@print_school_students_report', array($school->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
16 16
 <br>
17 17
 <br>
18
-<div class="row">
18
+
19 19
     <ul id="resultsTabs" class="nav nav-tabs" role="tablist">
20
-        <li role="presentation" class="active"><a href="#combined" aria-controls="combined" role="tab">Combined</a></li>
21
-        <li role="presentation"><a href="#uncombined" aria-controls="uncombined" role="tab">Uncombined</a></li>
20
+        <li role="presentation" class="active"><a href="#undergraduate_combined"  aria-controls="undergraduate_combined" role="tab">Undergraduate Combined</a></li>
21
+        <li role="presentation"><a href="#undergraduate_uncombined"  aria-controls="undergraduate_uncombined" role="tab">Undergraduate Uncombined</a></li>
22
+        <li role="presentation"><a href="#graduate_combined"  aria-controls="graduate_combined" role="tab">Graduate Combined</a></li>
23
+        <li role="presentation"><a href="#graduate_uncombined"  aria-controls="graduate_uncombined" role="tab">Graduate Uncombined</a></li>
24
+    
22 25
     </ul>
23
-	<div>
26
+<!--<div class="tab-content">-->
24 27
 <!-- 	<div class="tab-content"> -->
25 28
 
26
-	<div role="tabpanel" class="tab-pane active" id="combined">
27
-	<div class="row">
28
-		<div class="col-md-12" id="graph2"></div>
29
-	</div>
29
+	<div role="tabpanel" class="tab-pane active" id="undergraduate_combined">
30
+        <div class="row">
31
+            <div class="col-md-12" id="graph2"></div>
32
+        </div>
30 33
 
31
-            <div class="row">
34
+        <div class="row">
32 35
                 <div class="col-md-12">
33
-                    <h3>Performance of {{ $school->name }} Students by Combined Learning Outcome</h3>
36
+                    <h3>Performance of {{ $school->name }} Undergrad Students by Combined Learning Outcome</h3>
34 37
                     @if($outcomes->count()>0)
35 38
                         <table class="table table-striped table-condensed datatable">
36 39
                             <thead>
@@ -42,7 +45,7 @@
42 45
                                     <th>Number Students</th>
43 46
                                     <th>Number Students that Achieved the Target</th>
44 47
                                     <th>Percentage of Students that Achieved the Target</th>
45
-                                    <th>Semesters</th>
48
+                                    <!--<th>Semesters</th>-->
46 49
                                 </tr>
47 50
                             </thead>
48 51
                             <tfoot>
@@ -54,35 +57,45 @@
54 57
                                     <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
55 58
                                     <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
56 59
                                     <th><select class="column-search-select form-control"><option value=""></option></select></th>
57
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
60
+                                   <!-- <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>-->
58 61
                                 </tr>
59 62
                             </tfoot>
60 63
                             <tbody>
61
-                                @foreach($programs as $program)
64
+                                @foreach($undergraduate_programs as $program)
62 65
                                   @foreach($outcomes_colap as $outcome)
63
-                                	@if(isset($outcomes_attempted_colap[$program->id][$outcome->id]))
66
+                                	@if(isset($outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id]))
64 67
                                     <tr>
65 68
 										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
66 69
 										<td>{{{ $program->name }}}</td>
67 70
 										<td>{{{ $program->id }}}</td>
68 71
 										<td>{{{ $program->is_graduate }}}</td>
69
-										<td>{{{ $outcomes_attempted_colap[$program->id][$outcome->id] }}}</td>
70
-										<td>{{{ $outcomes_achieved_colap[$program->id][$outcome->id] }}}</td>
71
-										<td>
72
-											@if($outcomes_attempted_colap[$program->id][$outcome->id]!=0)
73
-												{{{ round($outcomes_achieved_colap[$program->id][$outcome->id] / $outcomes_attempted_colap[$program->id][$outcome->id]*100, 2) }}}%
74
-											@else
75
-												N/M
76
-											@endif
77
-										</td>
72
+										<td>{{{ $outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id] }}}</td>
73
+										@if(isset($outcomes_undergrad_program_achieved_colap[$outcome->id][$program->id]))
74
+                        
75
+                                            <td>{{{ $outcomes_undergrad_program_achieved_colap[$outcome->id][$program->id] }}}</td>
76
+                                            <td>
77
+                                                @if($outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id]!=0)
78
+                                                    
79
+                                                    {{{ round($outcomes_undergrad_program_achieved_colap[$outcome->id][$program->id] / $outcomes_undergrad_program_attempted_colap[$outcome->id][$program->id]*100, 2) }}}%
80
+                                                
81
+                                                    
82
+                                            @else
83
+                                                N/M
84
+                                            @endif
85
+                                            </td>
86
+                                        @else
87
+                                            <td>0</td><td>0%</td>
88
+                                            @endif
89
+                                            {{--}}
90
+                                            
78 91
 										<td>
79
-										@if(isset($outcomes_attempted_colap_semesters[$program->id][$outcome->id]))
80
-											{{{ str_replace('"','',json_encode($outcomes_attempted_colap_semesters[$program->id][$outcome->id])) }}}
92
+										@if(isset($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id]))
93
+											{{{ str_replace('"','',json_encode($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id])) }}}
81 94
 										@else
82 95
 											N/M
83 96
 										@endif
84 97
 										
85
-										</td>
98
+										</td>--}}
86 99
                                     </tr>
87 100
                        				@endif
88 101
                                   @endforeach
@@ -93,16 +106,16 @@
93 106
                         <p class="lead"> No courses assigned.</p>
94 107
                     @endif
95 108
                 </div>
109
+        </div>
110
+    </div>
111
+		<div role="tabpanel" class="tab-pane" id="undergraduate_uncombined">
112
+            <div class="row">
113
+                <div class="col-md-12" id="graph"></div>
96 114
             </div>
97
-            </div>
98
-		<div role="tabpanel" class="tab-pane" id="uncombined">
99
-	<div class="row">
100
-		<div class="col-md-12" id="graph"></div>
101
-	</div>
102 115
 
103 116
             <div class="row">
104 117
                 <div class="col-md-12">
105
-                    <h3>Performance of {{ $school->name }} Students by Uncombined Learning Outcome</h3>
118
+                    <h3>Performance of {{ $school->name }} Undergrad Students by Uncombined Learning Outcome</h3>
106 119
                     @if($outcomes->count()>0)
107 120
                         <table class="table table-striped table-condensed datatable">
108 121
                             <thead>
@@ -114,7 +127,7 @@
114 127
                                     <th>Number Students</th>
115 128
                                     <th>Number Students that Achieved the Target</th>
116 129
                                     <th>Percentage of Students that Achieved the Target</th>
117
-                                    <th>Semesters</th>
130
+                                    <!--<th>Semesters</th>-->
118 131
                                 </tr>
119 132
                             </thead>
120 133
                             <tfoot>
@@ -126,35 +139,44 @@
126 139
                                     <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
127 140
                                     <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
128 141
                                     <th><select class="column-search-select form-control"><option value=""></option></select></th>
129
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
142
+                                     <!--<th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>-->
130 143
                                 </tr>
131 144
                             </tfoot>
132 145
                             <tbody>
133
-                                @foreach($programs as $program)
146
+                                
134 147
                                	   @foreach($outcomes as $outcome)
135
-  											@if(isset($outcomes_attempted[$program->id][$outcome->id]))
148
+                                      @foreach($undergraduate_programs as $program)
149
+  											@if(isset($outcomes_undergrad_program_attempted_todo[$outcome->id][$program->id]))
136 150
                                   <tr>
137 151
 										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
138 152
 										<td>{{{ $program->name }}}</td>
139 153
 										<td>{{{ $program->id }}}</td>
140 154
 										<td>{{{ $program->is_graduate }}}</td>
141
-										<td>{{{ $outcomes_attempted[$program->id][$outcome->id] }}}</td>
142
-										<td>{{{ $outcomes_achieved[$program->id][$outcome->id] }}}</td>
155
+										
156
+                                        <td>{{{ $outcomes_undergrad_program_attempted_todo[$outcome->id][$program->id] }}}</td>
157
+									@if((isset($outcomes_undergrad_program_achieved_todo[$outcome->id][$program->id])))
158
+                                        <td>{{{ $outcomes_undergrad_program_achieved_todo[$outcome->id][$program->id] }}}</td>
143 159
 										<td>
144
-											@if($outcomes_attempted[$program->id][$outcome->id]!=0)
145
-												{{{ round($outcomes_achieved[$program->id][$outcome->id] / $outcomes_attempted[$program->id][$outcome->id]*100, 2) }}}%
160
+											@if($outcomes_undergrad_program_attempted_todo[$outcome->id][$program->id]!=0)
161
+                                            	{{{ round($outcomes_undergrad_program_achieved_todo[$outcome->id][$program->id] / $outcomes_undergrad_program_attempted_todo[$outcome->id][$program->id]*100, 2) }}}%
146 162
 											@else
163
+                                            
147 164
 												N/M
148 165
 											@endif
149 166
 										</td>
167
+                                        @else
168
+                                            <td>0</td>
169
+                                            <td>0%</td>
170
+                                        @endif
171
+                                        {{--}}
150 172
 										<td>
151
-											@if(isset($outcomes_attempted_semesters[$program->id][$outcome->id]))
152
-												{{{ str_replace('"','',json_encode($outcomes_attempted_semesters[$program->id][$outcome->id])) }}}
173
+											@if(isset($outcomes_undergraduate_attempted_semesters[$program->id][$outcome->id]))
174
+												{{{ str_replace('"','',json_encode($outcomes_undergraduate_attempted_semesters[$program->id][$outcome->id])) }}}
153 175
 											@else
154 176
 												N/M
155 177
 											@endif
156 178
 										
157
-										</td>
179
+										</td>--}}
158 180
                                     </tr>
159 181
 											@endif
160 182
                                    @endforeach
@@ -166,9 +188,180 @@
166 188
                     @endif
167 189
                 </div>
168 190
             </div>
169
-</div>
170
-	</div>
171
-</div>
191
+        </div>
192
+	
193
+    <div role="tabpanel" class="tab-pane" id="graduate_combined">
194
+        <div class="row">
195
+            <div class="col-md-12" id="graph3"></div>
196
+        </div>
197
+
198
+        <div class="row">
199
+                <div class="col-md-12">
200
+                    <h3>Performance of {{ $school->name }} Graduate Students by Combined Learning Outcome</h3>
201
+                    @if($outcomes->count()>0)
202
+                        <table class="table table-striped table-condensed datatable">
203
+                            <thead>
204
+                                <tr>
205
+                                    <th>Learning Outcome</th>
206
+                                    <th>Program</th>
207
+                                    <th>Program Id</th>
208
+                                    <th>Program Is Graduate</th>
209
+                                    <th>Number Students</th>
210
+                                    <th>Number Students that Achieved the Target</th>
211
+                                    <th>Percentage of Students that Achieved the Target</th>
212
+                                    <!--<th>Semesters</th>-->
213
+                                </tr>
214
+                            </thead>
215
+                            <tfoot>
216
+                                <tr class="column-search">
217
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
218
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
219
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
220
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
221
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
222
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
223
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
224
+                                    <!--<th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>-->
225
+                                </tr>
226
+                            </tfoot>
227
+                            <tbody>
228
+                                @foreach($graduate_programs as $program)
229
+                                  @foreach($outcomes_colap as $outcome)
230
+                                	@if(isset($outcomes_grad_program_attempted_colap[$outcome->id][$program->id]))
231
+                                    <tr>
232
+										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
233
+										<td>{{{ $program->name }}}</td>
234
+										<td>{{{ $program->id }}}</td>
235
+										<td>{{{ $program->is_graduate }}}</td>
236
+										<td>{{{ $outcomes_grad_program_attempted_colap[$outcome->id][$program->id] }}}</td>
237
+										@if((isset($outcomes_grad_program_achieved_colap[$outcome->id][$program->id])))
238
+                                            <td>{{{ $outcomes_grad_program_achieved_colap[$outcome->id][$program->id] }}}</td>
239
+                                            <td>
240
+                                                @if($outcomes_grad_program_attempted_colap[$outcome->id][$program->id]!=0)
241
+                                                    
242
+                                                {{{ round($outcomes_grad_program_achieved_colap[$outcome->id][$program->id] / $outcomes_grad_program_attempted_colap[$outcome->id][$program->id]*100, 2) }}}%
243
+                                            
244
+                                                    
245
+                                            @else
246
+                                                    N/M
247
+                                                @endif
248
+                                            </td>
249
+                                            @else
250
+                                            <td>
251
+                                                0</td>
252
+                                                <td>0%</td>
253
+                                            @endif
254
+                                        {{--}}
255
+										<td>
256
+										@if(isset($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id]))
257
+											{{{ str_replace('"','',json_encode($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id])) }}}
258
+										@else
259
+											N/M
260
+										@endif
261
+										
262
+										</td>--}}
263
+                                    </tr>
264
+                       				@endif
265
+                                  @endforeach
266
+                                @endforeach
267
+                            </tbody>
268
+                        </table>
269
+                    @else
270
+                        <p class="lead"> No courses assigned.</p>
271
+                    @endif
272
+                </div>
273
+        </div>
274
+    </div>
275
+
276
+    <div role="tabpanel" class="tab-pane" id="graduate_uncombined">
277
+        <div class="row">
278
+            <div class="col-md-12" id="graph4"></div>
279
+        </div>
280
+
281
+        <div class="row">
282
+                <div class="col-md-12">
283
+                    <h3>Performance of {{ $school->name }} Graduate Students by Uncombined Learning Outcome</h3>
284
+                    @if($outcomes->count()>0)
285
+                        <table class="table table-striped table-condensed datatable">
286
+                            <thead>
287
+                                <tr>
288
+                                    <th>Learning Outcome</th>
289
+                                    <th>Program</th>
290
+                                    <th>Program Id</th>
291
+                                    <th>Program Is Graduate</th>
292
+                                    <th>Number Students</th>
293
+                                    <th>Number Students that Achieved the Target</th>
294
+                                    <th>Percentage of Students that Achieved the Target</th>
295
+                                    <!--<th>Semesters</th>-->
296
+                                </tr>
297
+                            </thead>
298
+                            <tfoot>
299
+                                <tr class="column-search">
300
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
301
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
302
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
303
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
304
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
305
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
306
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
307
+                                    <!--<th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>-->
308
+                                </tr>
309
+                            </tfoot>
310
+                            <tbody>
311
+                                @foreach($graduate_programs as $program)
312
+                                  @foreach($outcomes as $outcome)
313
+                                	@if(isset($outcomes_grad_program_attempted_colap[$outcome->id][$program->id]))
314
+                                    <tr>
315
+										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
316
+										<td>{{{ $program->name }}}</td>
317
+										<td>{{{ $program->id }}}</td>
318
+										<td>{{{ $program->is_graduate }}}</td>
319
+										<td>{{{ $outcomes_grad_program_attempted_colap[$outcome->id][$program->id] }}}</td>
320
+                                        @if(isset($outcomes_grad_program_achieved_colap[$outcome->id][$program->id]))
321
+										<td>{{{ $outcomes_grad_program_achieved_colap[$outcome->id][$program->id] }}}</td>
322
+										<td>
323
+											@if($outcomes_grad_program_attempted_colap[$outcome->id][$program->id]!=0)
324
+												
325
+                                            
326
+
327
+                                            {{{ round($outcomes_grad_program_achieved_colap[$outcome->id][$program->id] / $outcomes_grad_program_attempted_colap[$outcome->id][$program->id]*100, 2) }}}%
328
+										
329
+                                            @else
330
+												N/M
331
+											@endif
332
+										</td>
333
+                                        @else
334
+                                        <td>0</td>
335
+										<td>
336
+											0%
337
+										</td>
338
+                         
339
+                                        @endif
340
+                                        
341
+                                        {{--}}
342
+										<td>
343
+                                            
344
+										@if(isset($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id]))
345
+											{{{ str_replace('"','',json_encode($outcomes_undergraduate_attempted_colap_semesters[$program->id][$outcome->id])) }}}
346
+										@else
347
+											N/M
348
+										@endif
349
+										
350
+										</td>--}}
351
+                                    </tr>
352
+                       				@endif
353
+                                  @endforeach
354
+                                @endforeach
355
+                            </tbody>
356
+                        </table>
357
+                    @else
358
+                        <p class="lead"> No courses assigned.</p>
359
+                    @endif
360
+                </div>
361
+        </div>
362
+    </div>
363
+<!--</div>-->
364
+
172 365
  <!-- ===== tabs ===== -->
173 366
 <div class="row">
174 367
     <!-- Nav tabs -->
@@ -182,7 +375,7 @@
182 375
        <div role="tabpanel" class="tab-pane active" id="courses">
183 376
             <div class="row">
184 377
                 <div class="col-md-12">
185
-                    <h3>Courses in this program</h3>
378
+                    <h3>Courses in this School</h3>
186 379
                     @if(count($grouped_courses)>0)
187 380
                         <table class="table table-striped table-condensed datatable">
188 381
                             <thead>
@@ -206,7 +399,7 @@
206 399
                                     <tr>
207 400
                                         <td class="col-md-2">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
208 401
                                         <td class="col-md-4">{{{ $grouped_course->name}}}</td>
209
-                                        <td class="col-md-2">{{{ $grouped_course->program_code}}}</td>
402
+                                        <td class="col-md-2">{{{ $grouped_course->program->code}}}</td>
210 403
                                         <td class="col-md-3">{{{ $grouped_course->quantity }}}</td>
211 404
                                     </tr>
212 405
                                 @endforeach
@@ -319,7 +512,7 @@ $('#graph').highcharts({
319 512
         type: 'bar'
320 513
     },
321 514
     title: {
322
-        text: 'Performance of {{ $school->name }} Students by Uncombined Learning Outcome'
515
+        text: 'Performance of {{ $school->name }} Undergraduate Students by Uncombined Learning Outcome'
323 516
     },
324 517
     legend: {
325 518
                 reversed: true,
@@ -327,13 +520,17 @@ $('#graph').highcharts({
327 520
     xAxis: {
328 521
         categories: [
329 522
             @foreach($outcomes as $outcome)
330
-            	@if(isset($outcomes_attempted_todo[$outcome->id]))
331
-                 "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted_todo[$outcome->id] }}}, {{{ $outcomes_achieved_todo[$outcome->id] }}})",
332
-            	@else
523
+            	@if(isset($outcomes_undergraduate_attempted_todo[$outcome->id]) &&
524
+                isset($outcomes_undergraduate_achieved_todo[$outcome->id]))
525
+                 "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_undergraduate_attempted_todo[$outcome->id] }}}, {{{ $outcomes_undergraduate_achieved_todo[$outcome->id] }}})",
526
+            	@elseif(isset($outcomes_undergraduate_attempted_todo[$outcome->id]))
527
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_undergraduate_attempted_todo[$outcome->id] }}}, 0)",
528
+            	
529
+                 @else
333 530
                     "{{{ $outcome->name }}}<br>(N = 0, 0)",         	
334 531
             	@endif
335 532
             @endforeach
336
-        ],
533
+        ], 
337 534
         labels: {
338 535
             style: {
339 536
                 fontSize:'11px'
@@ -386,7 +583,7 @@ $('#graph').highcharts({
386 583
         groupPadding: 0.075
387 584
         },
388 585
     },
389
-    series: [{
586
+    series: [/*{
390 587
         name: 'Expected Value',
391 588
         color: '#555555',
392 589
         dataLabels: {
@@ -403,16 +600,16 @@ $('#graph').highcharts({
403 600
         data: [
404 601
             @foreach($outcomes as $index => $outcome)
405 602
                 @if(
406
-                    is_array($outcomes_attempted_todo)
407
-                    && array_key_exists($outcome->id, $outcomes_attempted_todo)
408
-                    && $outcomes_attempted_todo[$outcome->id]!=0)
603
+                    is_array($outcomes_undergraduate_attempted_todo)
604
+                    && array_key_exists($outcome->id, $outcomes_undergraduate_attempted_todo)
605
+                    && $outcomes_undergraduate_attempted_todo[$outcome->id]!=0)
409 606
                 @else
410 607
                     0,
411 608
                 @endif
412 609
             @endforeach
413 610
         ]
414 611
 
415
-    },{
612
+    },*/{
416 613
         name: 'Obtained Value',
417 614
         color: '#e70033',
418 615
         dataLabels: {
@@ -429,11 +626,14 @@ $('#graph').highcharts({
429 626
         data:[
430 627
             @foreach($outcomes as $index => $outcome)
431 628
                 @if(
432
-                    is_array($outcomes_attempted_todo)
433
-                    && array_key_exists($outcome->id, $outcomes_attempted_todo)
434
-                    && $outcomes_attempted_todo[$outcome->id]!=0)
435
-                    {{{ ($outcomes_achieved_todo[$outcome->id]/$outcomes_attempted_todo[$outcome->id])*100 }}},
436
-                @else
629
+                    is_array($outcomes_undergraduate_attempted_todo)
630
+                    && array_key_exists($outcome->id, $outcomes_undergraduate_attempted_todo)
631
+                    && $outcomes_undergraduate_attempted_todo[$outcome->id]!=0
632
+                    && isset($outcomes_undergraduate_achieved_todo[$outcome->id]))
633
+
634
+                    {{{ ($outcomes_undergraduate_achieved_todo[$outcome->id]/$outcomes_undergraduate_attempted_todo[$outcome->id])*100 }}},
635
+                    @else
636
+                
437 637
                     0,
438 638
                 @endif
439 639
             @endforeach
@@ -446,7 +646,7 @@ $('#graph2').highcharts({
446 646
         type: 'bar'
447 647
     }, 
448 648
     title: {
449
-        text: 'Performance of {{ $school->name }} Students by Combined Learning Outcome'
649
+        text: 'Performance of {{ $school->name }} Undergraduate Students by Combined Learning Outcome'
450 650
     },
451 651
     legend: {
452 652
                 reversed: true,
@@ -454,8 +654,146 @@ $('#graph2').highcharts({
454 654
     xAxis: {
455 655
         categories: [
456 656
             @foreach($outcomes_colap as $outcome)
457
-                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted_colap_todo[$outcome->id] }}}, {{{ $outcomes_achieved_colap_todo[$outcome->id] }}})",
657
+            @if(isset($outcomes_undergraduate_attempted_colap_todo[$outcome->id]) &&
658
+                    isset($outcomes_undergraduate_achieved_colap_todo[$outcome->id]))
659
+                    "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_undergraduate_attempted_colap_todo[$outcome->id] }}}, {{{ $outcomes_undergraduate_achieved_colap_todo[$outcome->id] }}})",
660
+                    @elseif(isset($outcomes_undergraduate_attempted_colap_todo[$outcome->id]))
661
+                    "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_undergraduate_attempted_colap_todo[$outcome->id] }}}, 0)",
662
+                    
663
+                    @else
664
+                        "{{{ $outcome->name }}}<br>(N = 0, 0)",         	
665
+                    @endif
666
+               @endforeach
667
+        ],
668
+        labels: {
669
+            style: {
670
+                fontSize:'11px'
671
+            },
672
+            step:1,
673
+            useHTML:true,
674
+            formatter: function() {
675
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
676
+            },
677
+        }
678
+    },
679
+    yAxis: {
680
+        min: 0,
681
+        max: 100,
682
+        title: {
683
+            text: 'Percentage'
684
+        },
685
+        			plotLines:[{
686
+		value:70,
687
+		color: '#000',
688
+		width:3,
689
+		zIndex:4,
690
+		label:{
691
+			text: 'Goal (70%)',
692
+			style: {
693
+				color: '#000',
694
+				fontSize: '14px',
695
+			}
696
+
697
+		}
698
+	}]
699
+
700
+    },
701
+    tooltip: {
702
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
703
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
704
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
705
+        footerFormat: '</table>',
706
+        shared: true,
707
+        useHTML: true
708
+    },
709
+    plotOptions: {
710
+        bar: {
711
+            //grouping: false,
712
+            shadow: false,
713
+            borderWidth: 0,
714
+        },
715
+        series: {
716
+        pointPadding: 0,
717
+        groupPadding: 0.075
718
+        },
719
+    },
720
+    series: [/*{
721
+        name: 'Expected Value',
722
+        color: '#555555',
723
+        dataLabels: {
724
+            enabled: true,
725
+            fontSize: 8,
726
+            color: '#fff',
727
+            align: 'right',
728
+            format: '{y:.1f}%',
729
+            style: {
730
+                //fontWeight: 'bold'
731
+            },
732
+            y:-1
733
+        },
734
+        data: [
735
+            @foreach($outcomes_colap as $index => $outcome)
736
+                @if(
737
+                    is_array($outcomes_undergraduate_attempted_colap_todo)
738
+                    && array_key_exists($outcome->id, $outcomes_undergraduate_attempted_colap_todo)
739
+                    && $outcomes_undergraduate_attempted_colap_todo[$outcome->id]!=0)
740
+                @else
741
+                    0,
742
+                @endif
743
+            @endforeach
744
+        ]
745
+
746
+    },*/{
747
+        name: 'Obtained Value',
748
+        color: '#e70033',
749
+        dataLabels: {
750
+            enabled: true,
751
+            fontSize: 8,
752
+            color: '#fff',
753
+            align: 'right',
754
+            format: '{y:.1f}%',
755
+            style: {
756
+                //fontWeight: 'bold'
757
+            },
758
+            y:-1
759
+        },
760
+        data:[
761
+            @foreach($outcomes_colap as $index => $outcome)
762
+                @if(
763
+                    is_array($outcomes_undergraduate_attempted_colap_todo)
764
+                    && array_key_exists($outcome->id, $outcomes_undergraduate_attempted_colap_todo)
765
+                    && $outcomes_undergraduate_attempted_colap_todo[$outcome->id]!=0
766
+                    && isset($outcomes_undergraduate_achieved_colap_todo[$outcome->id]))
767
+                    {{{ ($outcomes_undergraduate_achieved_colap_todo[$outcome->id]/$outcomes_undergraduate_attempted_colap_todo[$outcome->id])*100 }}},
768
+                @else
769
+                    0,
770
+                @endif
458 771
             @endforeach
772
+        ]
773
+    }]
774
+});
775
+$('#graph3').highcharts({
776
+    chart: {
777
+        type: 'bar'
778
+    }, 
779
+    title: {
780
+        text: 'Performance of {{ $school->name }} Graduate Students by Combined Learning Outcome'
781
+    },
782
+    legend: {
783
+                reversed: true,
784
+            },
785
+    xAxis: {
786
+        categories: [
787
+            @foreach($outcomes_colap as $outcome)
788
+            @if(isset($outcomes_graduate_attempted_colap_todo[$outcome->id])
789
+            && isset($outcomes_graduate_achieved_colap_todo[$outcome->id]))
790
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_graduate_attempted_colap_todo[$outcome->id] }}}, {{{ $outcomes_graduate_achieved_colap_todo[$outcome->id] }}})",
791
+            @elseif(isset($outcomes_graduate_attempted_colap_todo[$outcome->id]))
792
+            "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_graduate_attempted_colap_todo[$outcome->id] }}}, 0)",
793
+          @else
794
+          "{{{ $outcome->name }}}<br>(N = 0, 0)",
795
+          @endif
796
+                @endforeach
459 797
         ],
460 798
         labels: {
461 799
             style: {
@@ -509,7 +847,7 @@ $('#graph2').highcharts({
509 847
         groupPadding: 0.075
510 848
         },
511 849
     },
512
-    series: [{
850
+    series: [/*{
513 851
         name: 'Expected Value',
514 852
         color: '#555555',
515 853
         dataLabels: {
@@ -526,16 +864,17 @@ $('#graph2').highcharts({
526 864
         data: [
527 865
             @foreach($outcomes_colap as $index => $outcome)
528 866
                 @if(
529
-                    is_array($outcomes_attempted_colap_todo)
530
-                    && array_key_exists($outcome->id, $outcomes_attempted_colap_todo)
531
-                    && $outcomes_attempted_colap_todo[$outcome->id]!=0)
867
+                    is_array($outcomes_graduate_attempted_colap_todo)
868
+                    && array_key_exists($outcome->id, $outcomes_graduate_attempted_colap_todo)
869
+                    && $outcomes_graduate_attempted_colap_todo[$outcome->id]!=0
870
+                    )
532 871
                 @else
533 872
                     0,
534 873
                 @endif
535 874
             @endforeach
536 875
         ]
537 876
 
538
-    },{
877
+    },*/{
539 878
         name: 'Obtained Value',
540 879
         color: '#e70033',
541 880
         dataLabels: {
@@ -552,10 +891,133 @@ $('#graph2').highcharts({
552 891
         data:[
553 892
             @foreach($outcomes_colap as $index => $outcome)
554 893
                 @if(
555
-                    is_array($outcomes_attempted_colap_todo)
556
-                    && array_key_exists($outcome->id, $outcomes_attempted_todo)
557
-                    && $outcomes_attempted_colap_todo[$outcome->id]!=0)
558
-                    {{{ ($outcomes_achieved_colap_todo[$outcome->id]/$outcomes_attempted_colap_todo[$outcome->id])*100 }}},
894
+                    is_array($outcomes_graduate_attempted_colap_todo)
895
+                    && array_key_exists($outcome->id, $outcomes_graduate_attempted_colap_todo)
896
+                    && $outcomes_graduate_attempted_colap_todo[$outcome->id]!=0
897
+                    && isset($outcomes_graduate_achieved_colap_todo[$outcome->id]))
898
+                    {{{ ($outcomes_graduate_achieved_colap_todo[$outcome->id]/$outcomes_graduate_attempted_colap_todo[$outcome->id])*100 }}},
899
+                @else
900
+                    0,
901
+                @endif
902
+            @endforeach
903
+        ]
904
+    }]
905
+});
906
+
907
+$('#graph4').highcharts({
908
+    chart: {
909
+        type: 'bar'
910
+    }, 
911
+    title: {
912
+        text: 'Performance of {{ $school->name }} Graduate Students by Uncombined Learning Outcome'
913
+    },
914
+    legend: {
915
+                reversed: true,
916
+            },
917
+    xAxis: {
918
+        categories: [
919
+            @foreach($outcomes as $outcome)
920
+                @if(isset($outcomes_graduate_attempted_todo[$outcome->id])
921
+                && isset($outcomes_graduate_achieved_todo[$outcome->id]))
922
+                    "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_graduate_attempted_todo[$outcome->id] }}}, {{{ $outcomes_graduate_achieved_todo[$outcome->id] }}})",
923
+                @elseif(isset($outcomes_graduate_attempted_todo[$outcome->id]))
924
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_graduate_attempted_todo[$outcome->id] }}}, 0)",
925
+            @else
926
+            "{{{ $outcome->name }}}<br>(N = 0, 0)",
927
+          @endif  @endforeach
928
+        ],
929
+        labels: {
930
+            style: {
931
+                fontSize:'11px'
932
+            },
933
+            step:1,
934
+            useHTML:true,
935
+            formatter: function() {
936
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
937
+            },
938
+        }
939
+    },
940
+    yAxis: {
941
+        min: 0,
942
+        max: 100,
943
+        title: {
944
+            text: 'Percentage'
945
+        },
946
+        			plotLines:[{
947
+		value:70,
948
+		color: '#000',
949
+		width:3,
950
+		zIndex:4,
951
+		label:{
952
+			text: 'Goal (70%)',
953
+			style: {
954
+				color: '#000',
955
+				fontSize: '14px',
956
+			}
957
+
958
+		}
959
+	}]
960
+
961
+    },
962
+    tooltip: {
963
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
964
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
965
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
966
+        footerFormat: '</table>',
967
+        shared: true,
968
+        useHTML: true
969
+    },
970
+    plotOptions: {
971
+        bar: {
972
+            //grouping: false,
973
+            shadow: false,
974
+            borderWidth: 0,
975
+        },
976
+        series: {
977
+        pointPadding: 0,
978
+        groupPadding: 0.075
979
+        },
980
+    },
981
+    series: [/*{
982
+        name: 'Expected Value',
983
+        color: '#555555',
984
+        dataLabels: {
985
+            enabled: true,
986
+            fontSize: 8,
987
+            color: '#fff',
988
+            align: 'right',
989
+            format: '{y:.1f}%',
990
+            style: {
991
+                //fontWeight: 'bold'
992
+            },
993
+            y:-1
994
+        },
995
+        data: [
996
+            
997
+        ]
998
+
999
+    },*/{
1000
+        name: 'Obtained Value',
1001
+        color: '#e70033',
1002
+        dataLabels: {
1003
+            enabled: true,
1004
+            fontSize: 8,
1005
+            color: '#fff',
1006
+            align: 'right',
1007
+            format: '{y:.1f}%',
1008
+            style: {
1009
+                //fontWeight: 'bold'
1010
+            },
1011
+            y:-1
1012
+        },
1013
+        data:[
1014
+            @foreach($outcomes as $index => $outcome)
1015
+                @if(
1016
+                    is_array($outcomes_graduate_attempted_todo)
1017
+                    && array_key_exists($outcome->id, $outcomes_graduate_attempted_todo)
1018
+                    && $outcomes_graduate_attempted_todo[$outcome->id]!=0
1019
+                    && isset($outcomes_graduate_achieved_todo[$outcome->id]))
1020
+                    {{{ ($outcomes_graduate_achieved_todo[$outcome->id]/$outcomes_graduate_attempted_todo[$outcome->id])*100 }}},
559 1021
                 @else
560 1022
                     0,
561 1023
                 @endif

+ 1
- 1
app/views/local/professors/overview.blade.php Ver fichero

@@ -110,7 +110,7 @@ function loadGraphs() {
110 110
         <?php
111 111
 
112 112
             $student_in_course = $grouped_course->getStudentReportForOutcome($grouped_course, Auth::user()->id);
113
-            Log::info($student_in_course);
113
+            //Log::info($student_in_course);
114 114
         ?>
115 115
         // Load grad charts after clicking tab, so they are sized correctly.  
116 116
         $('#graph-{{ $index }}').highcharts({

+ 1
- 2
app/views/local/professors/program.blade.php Ver fichero

@@ -13,8 +13,7 @@
13 13
 @stop
14 14
 
15 15
 @section('main')
16
-
17
-<button type='button' class = 'btn btn-primary' id="change-view-btn" onclick="changeView('#allGraph','#programGraph', '', 'Show All Students')">Show Program Students</button>
16
+<a href="{{ action('ProgramsController@studentsProgramAssessmentReportForProfessors', array($program->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by Program Students</a>
18 17
 <div class="row" id = "allGraph">
19 18
     <div class="col-md-12" id="graph"></div>
20 19
 </div>