Просмотр исходного кода

Cambios hechos para resolver cuando no hay datos y otros bugs

Carlos J Corrada Bravo 3 лет назад
Родитель
Сommit
c5b6a972fa

+ 4
- 3
app/controllers/AnnualPlansController.php Просмотреть файл

@@ -135,9 +135,10 @@ class AnnualPlansController extends \BaseController
135 135
     $title = "Annual Plans";
136 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 144
     $program = Program::where('id', '=', $program_id)->first();

+ 2
- 2
app/controllers/OutcomesController.php Просмотреть файл

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

+ 2
- 3
app/controllers/ProgramCoordinatorsController.php Просмотреть файл

@@ -75,8 +75,8 @@ class ProgramCoordinatorsController extends \BaseController
75 75
 
76 76
       $program_array['assessed_courses_count'] = 0;
77 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 80
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
81 81
           Log::info($program_array['course_outcomes_achieved']);
82 82
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
@@ -146,7 +146,6 @@ class ProgramCoordinatorsController extends \BaseController
146 146
       $programs_contact[] = $users;
147 147
     }
148 148
 
149
-
150 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 Просмотреть файл

@@ -73,7 +73,8 @@ class ProgramsController extends \BaseController
73 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 78
       ->with('semester')
78 79
       ->with('program')
79 80
       ->where('program_id', $program->id)
@@ -363,8 +364,8 @@ class ProgramsController extends \BaseController
363 364
 
364 365
       $program_array['assessed_courses_count'] = 0;
365 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 369
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
369 370
           Log::info($program_array['course_outcomes_achieved']);
370 371
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {

+ 2
- 2
app/controllers/SchoolCoordinatorsController.php Просмотреть файл

@@ -238,7 +238,7 @@ class SchoolCoordinatorsController extends \BaseController
238 238
                     $course_outcomes_attempted2 = $course->outcomes_att(); //json_decode($course->outcomes_attempted, true);
239 239
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
240 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 242
                         && $course_outcomes_attempted2[$outcome->id] > 0
243 243
                     ) {
244 244
                         $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
@@ -312,7 +312,7 @@ class SchoolCoordinatorsController extends \BaseController
312 312
                     $course_outcomes_attempted2 = $course->outcomes_att();  // json_decode($course->outcomes_attempted, true);
313 313
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
314 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 316
                         && $course_outcomes_attempted2[$outcome->id] > 0
317 317
                     ) {
318 318
                         $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];

+ 19
- 12
app/controllers/SchoolsController.php Просмотреть файл

@@ -45,7 +45,8 @@ class SchoolsController extends \BaseController
45 45
    
46 46
 
47 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 50
             ->with('semester')
50 51
             ->with('program')
51 52
             ->whereIn('courses.program_id', $program_ids)
@@ -59,7 +60,8 @@ class SchoolsController extends \BaseController
59 60
             ->get();
60 61
 
61 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 65
             ->with('semester')
64 66
             ->with('program')
65 67
             ->whereIn('courses.program_id', $program_ids)
@@ -153,7 +155,7 @@ class SchoolsController extends \BaseController
153 155
         {
154 156
             // For each program with courses that do assessment
155 157
             $programs_with_courses = Program::with(array('courses' => function($query){
156
-                $query->whereNotNull('outcomes_attempted');
158
+//                 $query->whereNotNull('outcomes_attempted');
157 159
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
158 160
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
159 161
 
@@ -170,9 +172,11 @@ class SchoolsController extends \BaseController
170 172
                 foreach ($program->courses as $course)
171 173
                 {
172 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 180
                         && $course_outcomes_attempted2[$outcome->id]>0)
177 181
                     {
178 182
                         $achieved_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
@@ -225,7 +229,7 @@ class SchoolsController extends \BaseController
225 229
         {
226 230
             // For each program with courses that do assessment
227 231
             $programs_with_courses = Program::with(array('courses' => function($query){
228
-                $query->whereNotNull('outcomes_attempted');
232
+//                 $query->whereNotNull('outcomes_attempted');
229 233
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
230 234
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
231 235
 
@@ -242,9 +246,11 @@ class SchoolsController extends \BaseController
242 246
                 foreach ($program->courses as $course)
243 247
                 {
244 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 254
                         && $course_outcomes_attempted2[$outcome->id]>0)
249 255
                     {
250 256
                         $achieved_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
@@ -298,7 +304,8 @@ class SchoolsController extends \BaseController
298 304
         $program_ids= $school->programs->lists('id');
299 305
 
300 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 309
             ->with('semester')
303 310
             ->with('program')
304 311
             ->whereIn('program_id', $program_ids)
@@ -359,7 +366,7 @@ class SchoolsController extends \BaseController
359 366
         {
360 367
             // For each program with courses that do assessment
361 368
             foreach (Program::with(array('courses' => function($query){
362
-                $query->whereNotNull('outcomes_attempted');
369
+//                 $query->whereNotNull('outcomes_attempted');
363 370
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
364 371
             }))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program)
365 372
             {

+ 1
- 1
app/controllers/ThreeYearPlanController.php Просмотреть файл

@@ -585,7 +585,7 @@ class ThreeYearPlanController extends \BaseController
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 591
     $program = DB::table('programs')->where('id', $program_id)->first();

+ 7
- 5
app/views/local/managers/admins/assessment_report.blade.php Просмотреть файл

@@ -59,11 +59,13 @@
59 59
                                         <?php
60 60
 
61 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 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 69
                                             ->where('code', $course->code)->where('number',$course->number)
68 70
                                             ->whereIn('semester_id', Session::get('semesters_ids'))
69 71
                                             ->get();
@@ -181,7 +183,7 @@
181 183
                                     <td>{{ $program->name }}</td>
182 184
                                     <td>No</td>
183 185
                                     <td>
184
-                                        This program does not assess {{ $outcome->name }}.
186
+                                        This program did not assess {{ $outcome->name }}.
185 187
                                     </td>
186 188
                                 </tr>
187 189
                             @endif

+ 7
- 1
app/views/local/managers/admins/criteria.blade.php Просмотреть файл

@@ -1,7 +1,13 @@
1 1
 @extends('layouts.master')
2 2
 
3 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 11
 @stop
6 12
 @section('main')
7 13
 

+ 1
- 0
app/views/local/managers/pCoords/overview.blade.php Просмотреть файл

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

+ 4
- 4
app/views/local/professors/overview.blade.php Просмотреть файл

@@ -174,10 +174,10 @@ function loadGraphs() {
174 174
                 data:[
175 175
                     @foreach($outcomes as $outcome)
176 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 183
                         @if(