Browse Source

varios bugs resueltos

parent
commit
17e1a9357d

+ 5
- 1
app/controllers/ActivitiesController.php View File

@@ -137,7 +137,7 @@ class ActivitiesController extends \BaseController
137 137
             $active_semesters[] = $active_semester->id;
138 138
         }
139 139
 
140
-        Log::info($active_semesters);
140
+//         Log::info($active_semesters);
141 141
         // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
142 142
         $title = $course->code . $course->number . '-' . $course->section . ': ' . htmlspecialchars($activity->name, ENT_QUOTES) . ' <span class="small attention">(' . $course->semester->code . ')</span>';
143 143
 
@@ -162,6 +162,7 @@ class ActivitiesController extends \BaseController
162 162
             ->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
163 163
             ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
164 164
             ->where('activity_id', $activity->id)
165
+            ->whereNotNull('score')
165 166
             ->get();
166 167
         //if ($assessment) {
167 168
         //    $outcomes_achieved = $activity->o_ach_array;
@@ -191,6 +192,9 @@ class ActivitiesController extends \BaseController
191 192
             ->join('transformative_actions', 'transformative_activity_criterion.trans_action_id', '=', 'transformative_actions.id')
192 193
             ->where('activity_criterion.activity_id', $id)
193 194
             ->get();
195
+  
196
+          Log::info(json_encode($activity->cap_array));
197
+
194 198
         return View::make('local.professors.activity', compact('activity', 'outcomes_activity', 'transformative_actions', 'activity_criterion', 'title', 'outcomes', 'outcomes_achieved', 'outcomes_attempted', 'course', 'student_count', 'active_semesters'));
195 199
     }
196 200
 

+ 15
- 10
app/controllers/AnnualPlansController.php View File

@@ -750,7 +750,19 @@ class AnnualPlansController extends \BaseController
750 750
     $outcome = Outcome::where('id', $outcome_id)
751 751
       ->addSelect('outcomes.*', DB::raw("'{$typ_semester_outcome_id}' as typ_semester_outcome_id"), DB::raw("'{$semester_id}' as `semester_id`"), DB::raw("'{$program_id}' as `program_id`"))
752 752
       ->first();
753
-    $outcome->objectives = $outcome->fetchObjectivesReport($semester_id, $program_id);
753
+//     Log::info("Comments");    
754
+ Log::info('En AnnualPlansController antes'.json_encode($outcome->objectives));		//exit();
755
+ 	unset($outcome->objectives);
756
+    $outcome->objectives2 = $outcome->fetchObjectivesReport($semester_id, $program_id);
757
+    Log::info("En AnnualPlansController".$semester_id." ". $program_id); //exit();    
758
+ Log::info('En AnnualPlansController'.json_encode($outcome->objectives2));		//exit();
759
+    foreach ($outcome->objectives2 as $index => $objective) {
760
+      //       Log::info("Ella son besties");
761
+      //       Log::info(array($objective));
762
+      $objective->courses = Objective::getPlanReport($objective);
763
+//       $outcome->objectives[$index]->courses = Objective::getPlanReport($objective);
764
+    }
765
+   
754 766
     $outcome->outcome_program_goal = DB::table('target_outcomes_program')
755 767
       ->where('program_id', $program_id)
756 768
       ->where('semester_id', $semester_id)
@@ -773,15 +785,8 @@ class AnnualPlansController extends \BaseController
773 785
     //  ->toSql());
774 786
     //Log::info($outcome->comments);
775 787
     $outcome->transformative_actions_categories_html = TransformativeAction::getCategoriesHtml($program_id);
776
-
777
-
778
-
779
-
780
-    foreach ($outcome->objectives as $index => $objective) {
781
-      //       Log::info("Ella son besties");
782
-      //       Log::info(array($objective));
783
-      $objective->courses = Objective::getPlanReport($objective);
784
-    }
788
+// 	Log::info("Ella son besties".json_encode($outcome->objectives));
789
+// exit();
785 790
 
786 791
     return $outcome;
787 792
   }

+ 0
- 3
app/controllers/OutcomesController.php View File

@@ -1054,7 +1054,6 @@ class OutcomesController extends \BaseController
1054 1054
 
1055 1055
 
1056 1056
         $annual_plans = DB::select("
1057
-    
1058 1057
         select 
1059 1058
           academic_year, 
1060 1059
           semester_start, 
@@ -1065,8 +1064,6 @@ class OutcomesController extends \BaseController
1065 1064
         from annual_plans 
1066 1065
         join annual_cycle on annual_cycle_id = annual_cycle.id 
1067 1066
         where program_id = {$program_id} 
1068
-        
1069
-        
1070 1067
           order by semester_start desc");
1071 1068
         $program = DB::table('programs')
1072 1069
             ->where('id', $program_id)

+ 8
- 2
app/controllers/ThreeYearPlanController.php View File

@@ -101,12 +101,18 @@ class ThreeYearPlanController extends \BaseController
101 101
   {
102 102
 
103 103
     $path = DB::table('paths_for_three_year_plans')->where('id', $path_id)->first();
104
+    Log::info($path->path_to_pdf);
104 105
 
105
-    if (isset($path)) {
106
+    if (isset($path) and file_exists($path->path_to_pdf)) {
106 107
 
107 108
       $path = trim($path->path_to_pdf, app_path() . "/views/three_year_plan_htmls/");
109
+//     Log::info($path);
108 110
       $path = trim($path, ".blade.php");
109
-      return View::make("three_year_plan_htmls." . $path);
111
+//     Log::info($path);
112
+//       if (file_exists("three_year_plan_htmls." .$path)) 
113
+      {
114
+	      return View::make("three_year_plan_htmls." . $path);
115
+      }
110 116
     }
111 117
     Session::flash('status', 'warning');
112 118
     Session::flash('message', 'Error loading typ. Please try again later.');

+ 5
- 5
app/database/seeds/CourseStudentTableSeeder.php View File

@@ -15,7 +15,7 @@ class CourseStudentTableSeeder extends Seeder {
15 15
         $time_start = microtime(true);
16 16
 
17 17
         // Open file
18
-        if($file = fopen('app/database/csv/estusLabC21.txt', 'r'))
18
+        if($file = fopen('app/database/csv/estusEspaIngl.txt', 'r'))
19 19
         {
20 20
             // Initialize count variables
21 21
             $read = 0;
@@ -96,10 +96,10 @@ class CourseStudentTableSeeder extends Seeder {
96 96
             }
97 97
 
98 98
             // Delete all inactive users for current term
99
-            DB::table('course_student')
100
-                ->where('updated_at', '<', date('Y-m-d'))
101
-                ->where('semester_id', $semester_id)
102
-                ->delete();
99
+//             DB::table('course_student')
100
+//                 ->where('updated_at', '<', date('Y-m-d'))
101
+//                 ->where('semester_id', $semester_id)
102
+//                 ->delete();
103 103
 
104 104
             // Stop time
105 105
             $time_end = microtime(true);

+ 24
- 11
app/models/Activity.php View File

@@ -28,10 +28,11 @@ class Activity extends Eloquent
28 28
     return  DB::table('students')
29 29
     	-> join('assessments','assessments.student_id','=','students.id')    
30 30
     	-> join('activity_criterion','assessments.activity_criterion_id','=','activity_criterion.id')
31
-      ->where('activity_criterion.activity_id', '=', $this->id)
32
-      ->select('students.*')
33
-      ->distinct()
34
-      ->get();;
31
+ 		->whereNotNull('score')
32
+     	->where('activity_criterion.activity_id', '=', $this->id)
33
+      	->select('students.*')
34
+      	->distinct()
35
+      	->get();;
35 36
   }
36 37
   
37 38
   public function student_scores($student_id)
@@ -51,8 +52,9 @@ class Activity extends Eloquent
51 52
 //       ->orderBy('criterion_id')
52 53
 //       ->get();
53 54
     $activity_id=$this->id;
54
-    $assessments=DB::select(DB::raw("select id,  COALESCE(score,0) score from 
55
-    	(select activity_criterion_id, score from`assessments` where student_id= $student_id) a right OUTER join 
55
+//     $assessments=DB::select(DB::raw("select id,  COALESCE(score,0) score from 
56
+    $assessments=DB::select(DB::raw("select id,  score from 
57
+    	(select activity_criterion_id, score from`assessments` where score is not null and student_id= $student_id) a right OUTER join 
56 58
     	(select id from `activity_criterion` where `activity_criterion`.`activity_id` = $activity_id) b on a.activity_criterion_id = b.id"));
57 59
   
58 60
     
@@ -85,8 +87,9 @@ class Activity extends Eloquent
85 87
 //       ->get();
86 88
       //rubrics->expected_points
87 89
     $activity_id=$this->id;
88
- $percentage=DB::select(DB::raw("select COALESCE(ROUND(100*sum(score*weight)/sum(max_score*weight),2),0) percentage from (select activity_criterion_id, score from`assessments` where
89
-  student_id= $student_id) a right OUTER join 
90
+//  $percentage=DB::select(DB::raw("select COALESCE(ROUND(100*sum(score*weight)/sum(max_score*weight),2),0) percentage from (select activity_criterion_id, score from`assessments` where
91
+ $percentage=DB::select(DB::raw("select (ROUND(100*sum(score*weight)/sum(max_score*weight),2)) percentage from (select activity_criterion_id, score from`assessments` where
92
+  score is not null  and student_id= $student_id) a right OUTER join 
90 93
   (select id, weight, activity_id from `activity_criterion` where `activity_criterion`.`activity_id` = $activity_id) b on a.activity_criterion_id = b.id join 
91 94
   rubric_activity on rubric_activity.activity_id=b.activity_id join rubrics on rubrics.id=rubric_activity.rubric_id"));
92 95
     
@@ -97,7 +100,7 @@ class Activity extends Eloquent
97 100
   {
98 101
 
99 102
     $activity_criterion = DB::table('activity_criterion')->where('activity_id', '=', $this->id)->lists('id');
100
-    $amount_of_students = DB::table('assessments')->whereIn('activity_criterion_id', $activity_criterion)->lists('student_id');
103
+    $amount_of_students = DB::table('assessments')->whereNotNull('score')->whereIn('activity_criterion_id', $activity_criterion)->lists('student_id');
101 104
 
102 105
     return count($amount_of_students);
103 106
   }
@@ -114,10 +117,12 @@ class Activity extends Eloquent
114 117
 
115 118
 
116 119
       $assessments_passed = count(DB::table('assessments')
120
+        ->whereNotNull('score')
117 121
         ->where('score', '>=', $this->rubric[0]->expected_points)
118 122
         ->where('activity_criterion_id', '=', $single_ac->id)
119 123
         ->lists('student_id'));
120 124
       $assessments_attempted = count(DB::table('assessments')
125
+        ->whereNotNull('score')
121 126
         ->where('activity_criterion_id', '=', $single_ac->id)
122 127
         ->lists('student_id'));
123 128
 
@@ -150,6 +155,7 @@ class Activity extends Eloquent
150 155
       ->join('activity_criterion', 'activity_criterion.criterion_id', '=', 'criteria.id')
151 156
       ->join('assessments', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
152 157
       ->where('activity_criterion.activity_id', '=', $this->id)
158
+      ->whereNotNull('score')
153 159
       ->select(
154 160
         array(
155 161
           'activity_criterion.id as id',
@@ -167,16 +173,19 @@ class Activity extends Eloquent
167 173
         ->where('criterion_id', '=', $single_crit->criterion_id)
168 174
         ->lists('outcome_id'));
169 175
       $amount_of_students = count(DB::table('assessments')
170
-        ->where("activity_criterion_id", '=', $single_crit->id)
176
+        ->whereNotNull('score')
177
+	    ->where("activity_criterion_id", '=', $single_crit->id)
171 178
         ->lists('student_id'));
172 179
 
173 180
 
174 181
       $student_pass = DB::table('assessments')
175 182
         ->where("activity_criterion_id", '=', $single_crit->id)
176 183
         ->where('score', '>=', $this->rubric[0]->expected_points)
184
+        ->whereNotNull('score')
177 185
         ->lists('student_id');
178 186
       $amount_of_students_passed = count(DB::table('assessments')
179 187
         ->where("activity_criterion_id", '=', $single_crit->id)
188
+        ->whereNotNull('score')
180 189
         ->where('score', '>=', $this->rubric[0]->expected_points)
181 190
         ->lists('student_id'));
182 191
 
@@ -319,6 +328,7 @@ class Activity extends Eloquent
319 328
       $students_attempted = DB::table('assessments as a')
320 329
         ->whereIn('a.activity_criterion_id', $ac_criteria)
321 330
         ->groupBy('a.student_id')
331
+        ->whereNotNull('score')
322 332
         ->select(
323 333
           'a.student_id',
324 334
           DB::raw('count(`a`.`activity_criterion_id`) attempted'),
@@ -448,6 +458,7 @@ class Activity extends Eloquent
448 458
       ->lists('id');
449 459
 
450 460
     $assessments = DB::table('assessments')
461
+      ->whereNotNull('score')
451 462
       ->whereIn('activity_criterion_id', $all_criterion)
452 463
       ->lists('id');
453 464
 
@@ -460,6 +471,7 @@ class Activity extends Eloquent
460 471
     return DB::table('activities')
461 472
       ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
462 473
       ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
474
+      ->whereNotNull('score')
463 475
       ->where('activity_id', $this->id)
464 476
       ->where('student_id', $student_id)
465 477
       ->count();
@@ -488,7 +500,8 @@ class Activity extends Eloquent
488 500
 
489 501
     $all_criterion = DB::table('activity_criterion')
490 502
       ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
491
-      ->where('activity_criterion.activity_id', '=', $this->id)
503
+      ->whereNotNull('score')
504
+	  ->where('activity_criterion.activity_id', '=', $this->id)
492 505
       ->groupBy('criterion_id')
493 506
 
494 507
       ->lists('criterion_id');

+ 11
- 0
app/models/Course.php View File

@@ -165,6 +165,7 @@ class Course extends Eloquent
165 165
         $join->on("assessments.student_id", '=', 'program_student_semester.student_id')
166 166
           ->on('assessments.activity_criterion_id', '=', 'activity_criterion.id');
167 167
       })
168
+      ->whereNotNull('score')
168 169
       ->where('courses.semester_id', $this->semester_id)
169 170
       ->whereIn('courses.program_id', $program_ids)
170 171
       ->where('courses.code', $this->code)
@@ -222,6 +223,7 @@ class Course extends Eloquent
222 223
     $activitiesAssessed = DB::table('activities')
223 224
       ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
224 225
       ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
226
+	  ->whereNotNull('score')
225 227
       ->where('activities.course_id', $this->id)
226 228
       ->select('activities.id')
227 229
       ->distinct()
@@ -335,6 +337,7 @@ class Course extends Eloquent
335 337
     $activitiesAssessed = DB::table('activities')
336 338
       ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
337 339
       ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
340
+	  ->whereNotNull('score')
338 341
       ->where('activities.course_id', $this->id)
339 342
       ->where('activities.draft', 0)
340 343
       ->where('activities.diagnostic', 0)
@@ -349,6 +352,7 @@ class Course extends Eloquent
349 352
     $activitiesAssessed = DB::table('activities')
350 353
       ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
351 354
       ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
355
+	  ->whereNotNull('score')
352 356
       ->where('activities.course_id', $this->id)
353 357
       ->where('activities.draft', 0)
354 358
       ->where('activities.diagnostic', 1)
@@ -450,6 +454,7 @@ class Course extends Eloquent
450 454
           $join->on("assessments.student_id", '=', 'program_student_semester.student_id')
451 455
             ->on('assessments.activity_criterion_id', '=', 'activity_criterion.id');
452 456
         })
457
+  	    ->whereNotNull('score')
453 458
         ->where('courses.semester_id', $course_code->semester_id)
454 459
         ->whereIn('courses.program_id', $program_ids)
455 460
         ->where('courses.code', $course_code->code)
@@ -578,6 +583,7 @@ class Course extends Eloquent
578 583
         ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
579 584
         ->join('semesters', 'semesters.id', '=', 'courses.semester_id')
580 585
         ->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
586
+	    ->whereNotNull('score')
581 587
         ->whereIn('students.program_id', $program_ids)
582 588
         ->where('semester_id', $course_code->semester_id)
583 589
         ->where('semesters.is_visible', '=', 1)
@@ -613,6 +619,7 @@ class Course extends Eloquent
613 619
           $join->on("assessments.student_id", '=', 'course_student.student_id')
614 620
             ->on('assessments.activity_criterion_id', '=', 'activity_criterion.id');
615 621
         })
622
+	    ->whereNotNull('score')
616 623
         ->where('activities.draft', 0)
617 624
         ->where('activities.diagnostic', 0);
618 625
 
@@ -786,6 +793,7 @@ class Course extends Eloquent
786 793
        count(case when assessments.score >= rubrics.expected_points then 1 else NULL end) as achieved,
787 794
        criteria.*"
788 795
       ))
796
+	  ->whereNotNull('score')
789 797
       ->where('courses.id', $this->id)
790 798
       ->groupBy('criteria.id')
791 799
       ->get();
@@ -805,6 +813,7 @@ class Course extends Eloquent
805 813
         count(case when assessments.score >= rubrics.expected_points then 1 else null end) as achieved"
806 814
         )
807 815
       )
816
+	  ->whereNotNull('score')
808 817
       ->where('courses.id', $this->id)
809 818
       ->groupBy(array('outcome_id', 'student_id'))
810 819
       ->get();
@@ -883,6 +892,7 @@ class Course extends Eloquent
883 892
         'program_id',
884 893
         $this->program_id
885 894
       )
895
+	  ->whereNotNull('score')
886 896
       ->where('activities.draft', 0)
887 897
       ->where('activities.diagnostic', 0)
888 898
       ->groupBy('courses.id')
@@ -896,6 +906,7 @@ class Course extends Eloquent
896 906
     $assessed = DB::table('assessments')
897 907
       ->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
898 908
       ->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
909
+	  ->whereNotNull('score')
899 910
       ->where('activities.course_id', $this->id)
900 911
       ->count();
901 912
     //             Log::info("aqui".$assessed);

+ 1
- 0
app/models/Criterion.php View File

@@ -145,6 +145,7 @@ class Criterion extends Eloquent
145 145
 
146 146
 			$students_achieved += DB::table('assessments')
147 147
 				->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
148
+				->whereNotNull('score')
148 149
 				->where('activity_criterion.id', $activity_criterion->id)
149 150
 				->where('assessments.score', '>=', $activity_criterion->expected_points)
150 151
 				->count();

+ 2
- 1
app/models/Objective.php View File

@@ -101,6 +101,7 @@ class Objective extends Eloquent
101 101
     // 
102 102
     public static function getPlanReport($objective)
103 103
     {
104
+        Log::info("getPlanReport". json_encode($objective));//exit();
104 105
         $course_codes = DB::table('typ_semester_courses')
105 106
             ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
106 107
             ->where('typ_semester_objective_id', $objective->typ_semester_objective_id)
@@ -108,7 +109,7 @@ class Objective extends Eloquent
108 109
             ->select('courses.code', 'courses.number', 'courses.id as course_id', 'typ_semester_courses.id as typ_semester_course_id', DB::raw("{$objective->semester_id} as semester_id"), "courses.program_id")
109 110
             ->get();
110 111
         //Log::info($course_codes);
111
-        Log::info("No es aqui");
112
+//         Log::info("No es aqui");
112 113
 
113 114
         //$course_codes['studentPerOutcome'] = array();
114 115
 

+ 7
- 4
app/models/Outcome.php View File

@@ -186,8 +186,8 @@ class Outcome extends Eloquent
186 186
 			->select('objectives.id as objective_id', 'objectives.text', 'typ_semester_objectives.id as typ_semester_objective_id', 'program_id', 'semester_id')
187 187
 			->distinct();
188 188
 
189
-		Log::info('agooooo me');
190
-		////Log::info($objectives->toSql());
189
+// 		Log::info('agooooo me');
190
+// 		Log::info($objectives->toSql());exit();
191 191
 		//Log::info('semester_program_outcome' . $semester_id . ',' . $program_id . ',' . $this->id);
192 192
 
193 193
 		if ($with_model) {
@@ -210,8 +210,11 @@ class Outcome extends Eloquent
210 210
 			return $objectives;
211 211
 		}
212 212
 
213
-
214
-		return $objectives->get();
213
+// 		Log::info('agooooo me');
214
+		$objectives_result=$objectives->get();
215
+ Log::info('En fetchObjectivesReport'.json_encode($objectives_result));		//exit();
216
+		return $objectives_result;
217
+// 		return $objectives;
215 218
 	}
216 219
 
217 220
 	//Intento de get objectives pareados en un plan

+ 4
- 1
app/models/Program.php View File

@@ -74,6 +74,7 @@ class Program extends Eloquent
74 74
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
75 75
 			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
76 76
 			->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
77
+      		->whereNotNull('score')
77 78
 			->where('students.program_id', $this->id)
78 79
 			->whereIn('semester_id', Session::get('semesters_ids'))
79 80
 			->where('semesters.is_visible', '=', 1)
@@ -211,7 +212,7 @@ class Program extends Eloquent
211 212
 	public function getCoursesWithAssessmentCountAttribute()
212 213
 	{
213 214
 		return DB::table('courses')
214
-			->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) {
215
+			->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 and score is not null) as q"), function ($j) {
215 216
 				$j->on('q.semester_id', '=', 'courses.semester_id')
216 217
 					->on('q.program_id', '=', 'courses.program_id');
217 218
 			})
@@ -245,6 +246,7 @@ class Program extends Eloquent
245 246
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
246 247
 			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
247 248
 			->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
249
+      		->whereNotNull('score')
248 250
 			->where('courses.program_id', $this->id)
249 251
 			->whereIn('semester_id', Session::get('semesters_ids'))
250 252
 			->where('semesters.is_visible', '=', 1)
@@ -377,6 +379,7 @@ class Program extends Eloquent
377 379
 		foreach ($this->publishedActivities as $activity) {
378 380
 			$assessed = DB::table('activity_criterion')
379 381
 				->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
382
+     		 	->whereNotNull('score')
380 383
 				->where('activity_id', $activity->id)
381 384
 				->first();
382 385
 			if (!$assessed) continue;

+ 4
- 0
app/models/School.php View File

@@ -82,6 +82,7 @@ class School extends Eloquent
82 82
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
83 83
 			->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
84 84
 			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
85
+      		->whereNotNull('score')
85 86
 			->whereIn('courses.program_id', $this->undergraduate_programs->lists('id'))
86 87
 			->whereIn('semester_id', Session::get('semesters_ids'))
87 88
 			->where('semesters.is_visible', '=', 1)
@@ -109,6 +110,7 @@ class School extends Eloquent
109 110
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
110 111
 			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
111 112
 			->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
113
+	      	->whereNotNull('score')
112 114
 			->whereIn('courses.program_id', $this->graduate_programs->lists('id'))
113 115
 			->whereIn('semester_id', Session::get('semesters_ids'))
114 116
 			->where('semesters.is_visible', '=', 1)
@@ -429,6 +431,7 @@ class School extends Eloquent
429 431
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
430 432
 			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
431 433
 			->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
434
+	      	->whereNotNull('score')
432 435
 			->whereIn('students.program_id', $this->undergraduate_programs->lists('id'))
433 436
 			->whereIn('semester_id', Session::get('semesters_ids'))
434 437
 			->where('semesters.is_visible', '=', 1)
@@ -456,6 +459,7 @@ class School extends Eloquent
456 459
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
457 460
 			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
458 461
 			->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
462
+	      	->whereNotNull('score')
459 463
 			->whereIn('students.program_id', $this->graduate_programs->lists('id'))
460 464
 			->whereIn('semester_id', Session::get('semesters_ids'))
461 465
 			->where('semesters.is_visible', '=', 1)

+ 6
- 4
app/routes.php View File

@@ -208,10 +208,12 @@ Route::group(array('before' => 'auth|has_access'), function () {
208 208
         'uses' => 'AnnualPlansController@selectProgramPlan'
209 209
     ));
210 210
 
211
-    Route::post("fetchReportWithOutcome", array(
212
-        'as' => 'fetchReportWithOutcome',
213
-        'uses' => 'AnnualPlansController@fetchReportWithOutcome'
214
-    ));
211
+    Route::post("fetchReportWithOutcome", 'AnnualPlansController@fetchReportWithOutcome');
212
+
213
+//     Route::post("fetchReportWithOutcome", array(
214
+//         'as' => 'fetchReportWithOutcome',
215
+//         'uses' => 'AnnualPlansController@fetchReportWithOutcome'
216
+//     ));
215 217
 
216 218
     Route::get('annual_plan_report/{program_id}', array(
217 219
         'as' => 'annual_plan_report/{program_id}',

+ 5
- 3
app/views/local/managers/shared/annual_report.blade.php View File

@@ -970,13 +970,15 @@
970 970
                     typ_semester_outcome_id: typ_semester_outcome_id
971 971
                 },
972 972
                 function(outcome) {
973
-                    if (outcome.objectives) {
973
+                        console.log("outcome: " + JSON.stringify(outcome));                
974
+                    if (outcome.objectives2) {
974 975
                         $('table').show();
975 976
                         $('#outcome-display').parent().show();
976 977
                         $('#outcome-display .panel-title').html(name);
977 978
                         $('#allLists').empty();
978 979
                         $('#levelTabs').empty();
979 980
                         $('.no-outcome').hide();
981
+//                         console.log("outcome: " + outcome.jSon());
980 982
                         if (outcome.outcome_program_goal) {
981 983
                             outcome.outcome_program_goal = outcome.outcome_program_goal.expected_target;
982 984
                         } else {
@@ -1010,8 +1012,8 @@
1010 1012
                             '<th>Percentage</th>' +
1011 1013
                             '<th>Outcome Achieved</th>' +
1012 1014
                             '</tr></thead><tbody></tbody>');
1013
-                        first_objective_id = outcome.objectives[0].id;
1014
-                        $.each(outcome.objectives, function(index, objective) {
1015
+                        first_objective_id = outcome.objectives2[0].id;
1016
+                        $.each(outcome.objectives2, function(index, objective) {
1015 1017
 
1016 1018
                             li = $('<li/>', {
1017 1019
                                 'role': 'presentation',