Browse Source

Cambios hechos para resolver cuando no hay datos y otros bugs

parent
commit
c5b6a972fa

+ 4
- 3
app/controllers/AnnualPlansController.php View File

135
     $title = "Annual Plans";
135
     $title = "Annual Plans";
136
     //$typ_parts = DB::select("select * from typ_parts");
136
     //$typ_parts = DB::select("select * from typ_parts");
137
 
137
 
138
-    $current_typ = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'))[0];
139
-
140
-
138
+//     $current_typ = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'))[0];
139
+    $current_typ_arr = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'));
140
+// 	var_dump($current_typ);exit();
141
+	if(!empty($current_typ_arr))$current_typ=$current_typ_arr[0];else {$current_typ= new stdClass();$current_typ->id=0;}
141
 
142
 
142
 
143
 
143
     $program = Program::where('id', '=', $program_id)->first();
144
     $program = Program::where('id', '=', $program_id)->first();

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

709
                     ->with(array('courses' => function ($query2) use ($outcome_id) {
709
                     ->with(array('courses' => function ($query2) use ($outcome_id) {
710
                         $query2
710
                         $query2
711
                             ->has('activities')
711
                             ->has('activities')
712
-                            ->whereNotNull('outcomes_attempted')
712
+//                             ->whereNotNull('outcomes_attempted')
713
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
713
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
714
                             ->whereIn('semester_id', Session::get('semesters_ids'))
714
                             ->whereIn('semester_id', Session::get('semesters_ids'))
715
                             ->groupBy(array('code', 'number'));
715
                             ->groupBy(array('code', 'number'));
736
                     ->with(array('courses' => function ($query2) use ($outcome_id) {
736
                     ->with(array('courses' => function ($query2) use ($outcome_id) {
737
                         $query2
737
                         $query2
738
                             ->has('activities')
738
                             ->has('activities')
739
-                            ->whereNotNull('outcomes_attempted')
739
+//                             ->whereNotNull('outcomes_attempted')
740
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
740
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
741
                             ->whereIn('semester_id', Session::get('semesters_ids'))
741
                             ->whereIn('semester_id', Session::get('semesters_ids'))
742
                             ->groupBy(array('code', 'number'));
742
                             ->groupBy(array('code', 'number'));

+ 2
- 3
app/controllers/ProgramCoordinatorsController.php View File

75
 
75
 
76
       $program_array['assessed_courses_count'] = 0;
76
       $program_array['assessed_courses_count'] = 0;
77
       foreach ($program_array['program_courses'] as $course) {
77
       foreach ($program_array['program_courses'] as $course) {
78
-        if (!empty($course->outcomes_ach())) {
79
-          $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
78
+        if (!($program_array['course_outcomes_achieved'] = $course->outcomes_ach())) {
79
+//           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
80
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
80
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
81
           Log::info($program_array['course_outcomes_achieved']);
81
           Log::info($program_array['course_outcomes_achieved']);
82
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
82
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
146
       $programs_contact[] = $users;
146
       $programs_contact[] = $users;
147
     }
147
     }
148
 
148
 
149
-
150
     return View::make('local.managers.pCoords.overview', compact('title', 'programs', 'outcomes', 'programs_array', 'programs_contact'));
149
     return View::make('local.managers.pCoords.overview', compact('title', 'programs', 'outcomes', 'programs_array', 'programs_contact'));
151
   }
150
   }
152
 }
151
 }

+ 4
- 3
app/controllers/ProgramsController.php View File

73
      * List of grouped courses (grouped sections)
73
      * List of grouped courses (grouped sections)
74
      */
74
      */
75
 
75
 
76
-    $grouped_courses = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
76
+//     $grouped_courses = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
77
+    $grouped_courses = Course::select(DB::raw('name, code, number, semester_id, program_id'))
77
       ->with('semester')
78
       ->with('semester')
78
       ->with('program')
79
       ->with('program')
79
       ->where('program_id', $program->id)
80
       ->where('program_id', $program->id)
363
 
364
 
364
       $program_array['assessed_courses_count'] = 0;
365
       $program_array['assessed_courses_count'] = 0;
365
       foreach ($program_array['program_courses'] as $course) {
366
       foreach ($program_array['program_courses'] as $course) {
366
-        if (!empty($course->outcomes_ach())) {
367
-          $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
367
+        if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
368
+//           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
368
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
369
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
369
           Log::info($program_array['course_outcomes_achieved']);
370
           Log::info($program_array['course_outcomes_achieved']);
370
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
371
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {

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

238
                     $course_outcomes_attempted2 = $course->outcomes_att(); //json_decode($course->outcomes_attempted, true);
238
                     $course_outcomes_attempted2 = $course->outcomes_att(); //json_decode($course->outcomes_attempted, true);
239
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
239
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
240
                     if (
240
                     if (
241
-                        array_key_exists($outcome->id, $course_outcomes_attempted2)
241
+                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
242
                         && $course_outcomes_attempted2[$outcome->id] > 0
242
                         && $course_outcomes_attempted2[$outcome->id] > 0
243
                     ) {
243
                     ) {
244
                         $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
244
                         $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
312
                     $course_outcomes_attempted2 = $course->outcomes_att();  // json_decode($course->outcomes_attempted, true);
312
                     $course_outcomes_attempted2 = $course->outcomes_att();  // json_decode($course->outcomes_attempted, true);
313
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
313
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
314
                     if (
314
                     if (
315
-                        array_key_exists($outcome->id, $course_outcomes_attempted2)
315
+                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
316
                         && $course_outcomes_attempted2[$outcome->id] > 0
316
                         && $course_outcomes_attempted2[$outcome->id] > 0
317
                     ) {
317
                     ) {
318
                         $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
318
                         $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];

+ 19
- 12
app/controllers/SchoolsController.php View File

45
    
45
    
46
 
46
 
47
         $grad_grouped_courses = Course::
47
         $grad_grouped_courses = Course::
48
-            select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
48
+//             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
49
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
49
             ->with('semester')
50
             ->with('semester')
50
             ->with('program')
51
             ->with('program')
51
             ->whereIn('courses.program_id', $program_ids)
52
             ->whereIn('courses.program_id', $program_ids)
59
             ->get();
60
             ->get();
60
 
61
 
61
         $undergrad_grouped_courses = Course::
62
         $undergrad_grouped_courses = Course::
62
-            select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
63
+//             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
64
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
63
             ->with('semester')
65
             ->with('semester')
64
             ->with('program')
66
             ->with('program')
65
             ->whereIn('courses.program_id', $program_ids)
67
             ->whereIn('courses.program_id', $program_ids)
153
         {
155
         {
154
             // For each program with courses that do assessment
156
             // For each program with courses that do assessment
155
             $programs_with_courses = Program::with(array('courses' => function($query){
157
             $programs_with_courses = Program::with(array('courses' => function($query){
156
-                $query->whereNotNull('outcomes_attempted');
158
+//                 $query->whereNotNull('outcomes_attempted');
157
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
159
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
158
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
160
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
159
 
161
 
170
                 foreach ($program->courses as $course)
172
                 foreach ($program->courses as $course)
171
                 {
173
                 {
172
                     // If the outcome in question is being evaluated
174
                     // If the outcome in question is being evaluated
173
-                    $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
174
-                    $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
175
-                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
175
+                    $course_outcomes_attempted2 = $course->outcomes_att();
176
+//                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
177
+//                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
178
+                    $course_outcomes_achieved2 = $course->outcomes_ach();
179
+                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
176
                         && $course_outcomes_attempted2[$outcome->id]>0)
180
                         && $course_outcomes_attempted2[$outcome->id]>0)
177
                     {
181
                     {
178
                         $achieved_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
182
                         $achieved_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
225
         {
229
         {
226
             // For each program with courses that do assessment
230
             // For each program with courses that do assessment
227
             $programs_with_courses = Program::with(array('courses' => function($query){
231
             $programs_with_courses = Program::with(array('courses' => function($query){
228
-                $query->whereNotNull('outcomes_attempted');
232
+//                 $query->whereNotNull('outcomes_attempted');
229
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
233
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
230
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
234
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
231
 
235
 
242
                 foreach ($program->courses as $course)
246
                 foreach ($program->courses as $course)
243
                 {
247
                 {
244
                     // If the outcome in question is being evaluated
248
                     // If the outcome in question is being evaluated
245
-                    $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
246
-                    $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
247
-                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
249
+//                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
250
+                    $course_outcomes_attempted2 = ($course->outcomes_att());
251
+                    $course_outcomes_achieved2 = ($course->outcomes_ach());
252
+//                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
253
+                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
248
                         && $course_outcomes_attempted2[$outcome->id]>0)
254
                         && $course_outcomes_attempted2[$outcome->id]>0)
249
                     {
255
                     {
250
                         $achieved_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
256
                         $achieved_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
298
         $program_ids= $school->programs->lists('id');
304
         $program_ids= $school->programs->lists('id');
299
 
305
 
300
         $grouped_courses = Course::
306
         $grouped_courses = Course::
301
-            select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
307
+//             select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
308
+            select(DB::raw('name, code, number, semester_id, program_id'))
302
             ->with('semester')
309
             ->with('semester')
303
             ->with('program')
310
             ->with('program')
304
             ->whereIn('program_id', $program_ids)
311
             ->whereIn('program_id', $program_ids)
359
         {
366
         {
360
             // For each program with courses that do assessment
367
             // For each program with courses that do assessment
361
             foreach (Program::with(array('courses' => function($query){
368
             foreach (Program::with(array('courses' => function($query){
362
-                $query->whereNotNull('outcomes_attempted');
369
+//                 $query->whereNotNull('outcomes_attempted');
363
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
370
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
364
             }))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program)
371
             }))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program)
365
             {
372
             {

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

585
     }
585
     }
586
   }
586
   }
587
 
587
 
588
-  public function print($program_id, $typ)
588
+  public function printPlan($program_id, $typ)
589
   {
589
   {
590
 
590
 
591
     $program = DB::table('programs')->where('id', $program_id)->first();
591
     $program = DB::table('programs')->where('id', $program_id)->first();

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

59
                                         <?php
59
                                         <?php
60
 
60
 
61
                                             $sections_evaluating_outcome = Course::has('activities')
61
                                             $sections_evaluating_outcome = Course::has('activities')
62
-                                            ->whereNotNull('outcomes_attempted')
63
-                                            ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
62
+//                                             ->whereNotNull('outcomes_attempted')
63
+//                                             ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
64
                                             ->with(array('activities'=>function($query) use(&$outcome){
64
                                             ->with(array('activities'=>function($query) use(&$outcome){
65
-                                                $query->whereNotNull('outcomes_attempted');
66
-                                                $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
65
+//                                                 $query->whereNotNull('outcomes_attempted');
66
+//                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
67
+//                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
68
+                                                } ))
67
                                             ->where('code', $course->code)->where('number',$course->number)
69
                                             ->where('code', $course->code)->where('number',$course->number)
68
                                             ->whereIn('semester_id', Session::get('semesters_ids'))
70
                                             ->whereIn('semester_id', Session::get('semesters_ids'))
69
                                             ->get();
71
                                             ->get();
181
                                     <td>{{ $program->name }}</td>
183
                                     <td>{{ $program->name }}</td>
182
                                     <td>No</td>
184
                                     <td>No</td>
183
                                     <td>
185
                                     <td>
184
-                                        This program does not assess {{ $outcome->name }}.
186
+                                        This program did not assess {{ $outcome->name }}.
185
                                     </td>
187
                                     </td>
186
                                 </tr>
188
                                 </tr>
187
                             @endif
189
                             @endif

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

1
 @extends('layouts.master')
1
 @extends('layouts.master')
2
 
2
 
3
 @section('navigation')
3
 @section('navigation')
4
-@include('local.managers.sCoords._navigation')
4
+    @if(Auth::user()->role==1)
5
+        @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role==2)
7
+        @include('local.managers.sCoords._navigation')
8
+    @elseif(Auth::user()->role==3)
9
+        @include('local.managers.pCoords._navigation')
10
+    @endif
5
 @stop
11
 @stop
6
 @section('main')
12
 @section('main')
7
 
13
 

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

364
                         @if(
364
                         @if(
365
                             is_array($program_item['outcomes_attempted'])
365
                             is_array($program_item['outcomes_attempted'])
366
                             && array_key_exists($outcome->id, $program_item['outcomes_attempted'])
366
                             && array_key_exists($outcome->id, $program_item['outcomes_attempted'])
367
+                            && array_key_exists($outcome->id, $program_item['outcomes_achieved'])
367
                             && $program_item['outcomes_attempted'][$outcome->id]!=0)
368
                             && $program_item['outcomes_attempted'][$outcome->id]!=0)
368
                             {{{ ($program_item['outcomes_achieved'][$outcome->id]/$program_item['outcomes_attempted'][$outcome->id])*100 }}},
369
                             {{{ ($program_item['outcomes_achieved'][$outcome->id]/$program_item['outcomes_attempted'][$outcome->id])*100 }}},
369
                         @else
370
                         @else

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

174
                 data:[
174
                 data:[
175
                     @foreach($outcomes as $outcome)
175
                     @foreach($outcomes as $outcome)
176
                     <?php
176
                     <?php
177
-Log::info($grouped_outcomes_attempted_results[$index]);
178
-Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
179
-
180
-Log::info($grouped_outcomes_attempted_results[$index][$outcome->id]);
177
+// Log::info($grouped_outcomes_attempted_results[$index]);
178
+// Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
179
+// 
180
+// Log::info($grouped_outcomes_attempted_results[$index][$outcome->id]);
181
                          
181
                          
182
                     ?>
182
                     ?>
183
                         @if(
183
                         @if(