Selaa lähdekoodia

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

debugging assessment, rubrics y activities
Carlos J Corrada Bravo 3 vuotta sitten
vanhempi
commit
da81a5fa0c

+ 29
- 1
app/controllers/CriteriaController.php Näytä tiedosto

@@ -160,7 +160,35 @@ class CriteriaController extends \BaseController
160 160
             $json['objectives_assoc'][$outId] = DB::select("select objectives.id, objectives.text, outcomes.name from objectives, objective_outcome, outcomes where  objective_outcome.outcome_id ={$outId} and objective_outcome.objective_id = objectives.id and objectives.active=1 and outcomes.id = objective_outcome.outcome_id");
161 161
         }*/
162 162
 
163
-        return json_encode($json);
163
+        $criterion =  DB::table('criteria')->where('id', Input::get('id'))->first();
164
+        $criterion->outcomes = DB::table('criterion_objective_outcome')
165
+            ->join('outcomes', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
166
+            ->where('criterion_id', $criterion->id)
167
+            ->distinct()
168
+            ->get();
169
+
170
+        foreach ($criterion->outcomes as $outcome) {
171
+            $outcome->assoc_objectives = DB::table('objective_outcome')
172
+                ->join('objectives', 'objectives.id', '=', 'objective_outcome.objective_id')
173
+                ->where('outcome_id', $outcome->outcome_id)
174
+                ->get();
175
+            $outcome->objectives_criteria = DB::table('criterion_objective_outcome')
176
+                ->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
177
+                ->where('criterion_id', $criterion->id)
178
+                ->where('outcome_id', $outcome->id)
179
+                ->get();
180
+        }
181
+        $criterion->scales = DB::table('criterion_scale')
182
+            ->join('scales', 'criterion_scale.scale_id', '=', 'scales.id')
183
+            ->where('criterion_id', $criteria_id)
184
+            ->orderBy('position')
185
+            ->get();
186
+        $criterion->program =  DB::table('program_criterion')->where('criterion_id', $criteria_id)->get();
187
+        $criterion->activity_criterion = DB::table('assessments')
188
+            ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
189
+            ->where('activity_criterion.criterion_id', $criteria_id)
190
+            ->get();
191
+        return array($criterion);
164 192
     }
165 193
 
166 194
     public function delete()

+ 21
- 8
app/controllers/Objective2Controller.php Näytä tiedosto

@@ -370,17 +370,21 @@ class Objective2Controller extends \BaseController
370 370
 			$message .= '</ul>';
371 371
 
372 372
 			/** Send error message and old data */
373
-			Session::flash('status', 'danger');
374
-			Session::flash('message', $message);
373
+			//Session::flash('status', 'danger');
374
+			//Session::flash('message', $message);
375
+			$MessageArray = array('status' => 'danger', 'message' => $message);
375 376
 			$role = Auth::user()['role'];
376 377
 			switch ($role) {
377 378
 				case 1:
379
+					return $MessageArray;
378 380
 					return Redirect::to('objective')->withInput();
379 381
 
380 382
 				case 2:
383
+					return $MessageArray;
381 384
 					return Redirect::to('school-objective')->withInput();
382 385
 
383 386
 				case 3:
387
+					return $MessageArray;
384 388
 					return Redirect::to('program-objective')->withInput();
385 389
 			}
386 390
 		} else {
@@ -396,10 +400,10 @@ class Objective2Controller extends \BaseController
396 400
 
397 401
 			// Set status
398 402
 
399
-			Log::info("dimelo papi");
403
+
400 404
 			/** If Objective is updated, send success message */
401 405
 			if ($Objective->save()) {
402
-				Log::info("dimelo papi2");
406
+
403 407
 				$objectiveId = $Objective->id;
404 408
 				DB::delete("delete from `objective_outcome` where objective_id ={$objectiveId}");
405 409
 				DB::delete("delete from objective_program where objective_id = {$objectiveId}");
@@ -411,34 +415,43 @@ class Objective2Controller extends \BaseController
411 415
 					DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
412 416
 				}
413 417
 
414
-				Session::flash('status', 'success');
415
-				Session::flash('message', 'Updated Objective: "' . $Objective->text . '"');
418
+				//Session::flash('status', 'success');
419
+				//Session::flash('message', 'Updated Objective: "' . $Objective->text . '"');
420
+				$MessageArray = array('status' => 'success', 'message' => 'Updated Objective: "' . $Objective->text . '"');
416 421
 				$role = Auth::user()['role'];
422
+
417 423
 				switch ($role) {
418 424
 					case 1:
425
+						return $MessageArray;
419 426
 						return Redirect::to('objective')->withInput();
420 427
 
421 428
 					case 2:
429
+						return $MessageArray;
422 430
 						return Redirect::to('school-objective')->withInput();
423 431
 
424 432
 					case 3:
433
+						return $MessageArray;
425 434
 						return Redirect::to('program-objective')->withInput();
426 435
 				}
427 436
 			}
428 437
 
429 438
 			/** If saving fails, send error message and old data */
430 439
 			else {
431
-				Session::flash('status', 'danger');
432
-				Session::flash('message', 'Error updating the Objective. Please try again later.');
440
+				//Session::flash('status', 'danger');
441
+				////Session::flash('message', 'Error updating the Objective. Please try again later.');
442
+				$MessageArray = array('status' => 'danger', 'message' => 'Error updating the Objective. Please try again later.');
433 443
 				$role = Auth::user()['role'];
434 444
 				switch ($role) {
435 445
 					case 1:
446
+						return $MessageArray;
436 447
 						return Redirect::to('objective')->withInput();
437 448
 
438 449
 					case 2:
450
+						return $MessageArray;
439 451
 						return Redirect::to('school-objective')->withInput();
440 452
 
441 453
 					case 3:
454
+						return $MessageArray;
442 455
 						return Redirect::to('program-objective')->withInput();
443 456
 				}
444 457
 			}

+ 70
- 69
app/controllers/OutcomesController.php Näytä tiedosto

@@ -621,6 +621,7 @@ class OutcomesController extends \BaseController
621 621
                 ->where('criterion_objective_outcome.outcome_id', $id)
622 622
                 ->where('criteria.num_scales', $level)
623 623
                 ->select('criteria.id', 'criteria.name', 'criteria.deleted_at')
624
+                ->distinct()
624 625
                 ->orderBy('criteria.name', 'asc')
625 626
                 ->get();
626 627
             // $outcome_criterias = $outcome_criterias;
@@ -726,75 +727,75 @@ class OutcomesController extends \BaseController
726 727
 
727 728
     public function totalAssessmentReport()
728 729
     {
729
-    	//SELECT sm.name, s.name, p.name, p.code, a.outcomes_attempted, stu.number, ass.scores, c.code, c.number, r.expected_points 
730
-//     	FROM students stu, schools s, programs p, courses c, activities a, assessments ass, rubrics r, semesters sm 
731
-//     	where stu.id=ass.student_id and sm.id=c.semester_id and s.id=p.school_id and p.id=c.program_id and a.course_id=c.id and ass.activity_id=a.id and a.rubric_id=r.id 
732
-//     	and c.semester_id in (12,13) and a.outcomes_attempted is not null
733
-    ini_set('memory_limit', -1);
734
-	ini_set('max_execution_time', 300);
735
-// 		$total_assessments_temp = DB::table('assessments')
736
-//          						->join('students', 'students.id', '=', 'assessments.student_id')
737
-//          						->join('activities', 'activities.id', '=', 'assessments.activity_id')
738
-//          						->join('rubrics', 'rubrics.id', '=', 'activities.rubric_id')
739
-//          						->join('courses', 'courses.id', '=', 'activities.course_id')
740
-//          						->join('programs', 'programs.id', '=', 'courses.program_id')
741
-//          						->join('schools', 'schools.id', '=', 'programs.school_id')
742
-//           						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
743
-//                    			   	->whereIn('courses.semester_id', Session::get('semesters_ids'))
744
-//                     			->whereRaw('activities.outcomes_attempted is not null')
745
-//                     			->select('activities.id as activity_id','semesters.name as semester','schools.name as school','programs.name as program','programs.id as program_id','programs.code as program_code','students.number as student_number','students.conc_code as student_conc_code','assessments.scores as results','courses.name as course','courses.code as course_code','courses.number as course_number','rubrics.expected_points as expected_result')
746
-//                     			->orderBy('semesters.id','school','program','course','student_number')
747
-// 								->distinct()
748
-//                     			->get();
749
-//                     			    
750
-//         $total_assessments=array();
751
-// 		foreach($total_assessments_temp as $total_assessment)
752
-// 		{
753
-// 			$results=json_decode($total_assessment->results, TRUE);
754
-// 			$total_assessment->course=$total_assessment->course_code.$total_assessment->course_number." ".$total_assessment->course;
755
-// 			foreach($results as $criterion_id => $result)
756
-// 			{	
757
-// 				if($result and $result!="N/A")
758
-// 				{
759
-// 					$trans_temp=clone $total_assessment;
760
-// 					$criterion=Criterion::find($criterion_id);
761
-// 					if($criterion)
762
-// 					{
763
-// 	// 					var_dump($total_assessment->activity_id);
764
-// 	// 					var_dump($criterion_id);
765
-// 						if($criterion_id==1398)var_dump($criterion);
766
-// 	// 					exit();
767
-// 						$trans_temp->result=$result;
768
-// 						$trans_temp->criterion=$criterion->name;
769
-// 						$trans_temp->outcome=Outcome::find($criterion->outcome_id)->name;
770
-// 						$total_assessments[]=$trans_temp;
771
-// 					}
772
-// 				}
773
-// 			}
774
-// 		
775
-// 		}
776
-		$total_assessments = DB::table('assessments')
777
-         						->join('students', 'students.id', '=', 'assessments.student_id')
778
-         						->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
779
-         						->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
780
-         						->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
781
-         						->join('criterion_objective_outcome', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
782
-         						->join('outcomes', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
783
-         						->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
784
-         						->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
785
-         						->join('courses', 'courses.id', '=', 'activities.course_id')
786
-         						->join('programs', 'programs.id', '=', 'courses.program_id')
787
-         						->join('schools', 'schools.id', '=', 'programs.school_id')
788
-          						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
789
-                   			   	->whereIn('courses.semester_id', Session::get('semesters_ids'))
790
-                    			->select('criteria.name as criterion','outcomes.name as outcome','activities.id as activity_id','semesters.name as semester','schools.name as school','programs.name as program','programs.id as program_id','programs.code as program_code','students.number as student_number','students.conc_code as student_conc_code','assessments.score as result','courses.name as course','courses.code as course_code','courses.number as course_number','rubrics.expected_points as expected_result')
791
-                    			->orderBy('semesters.id','school','program','course','student_number')
792
-								->distinct()
793
-                    			->get();
794
-
795
-
796
-       $title = "Total Assessment Report";
797
-		
730
+        //SELECT sm.name, s.name, p.name, p.code, a.outcomes_attempted, stu.number, ass.scores, c.code, c.number, r.expected_points 
731
+        //     	FROM students stu, schools s, programs p, courses c, activities a, assessments ass, rubrics r, semesters sm 
732
+        //     	where stu.id=ass.student_id and sm.id=c.semester_id and s.id=p.school_id and p.id=c.program_id and a.course_id=c.id and ass.activity_id=a.id and a.rubric_id=r.id 
733
+        //     	and c.semester_id in (12,13) and a.outcomes_attempted is not null
734
+        ini_set('memory_limit', -1);
735
+        ini_set('max_execution_time', 300);
736
+        // 		$total_assessments_temp = DB::table('assessments')
737
+        //          						->join('students', 'students.id', '=', 'assessments.student_id')
738
+        //          						->join('activities', 'activities.id', '=', 'assessments.activity_id')
739
+        //          						->join('rubrics', 'rubrics.id', '=', 'activities.rubric_id')
740
+        //          						->join('courses', 'courses.id', '=', 'activities.course_id')
741
+        //          						->join('programs', 'programs.id', '=', 'courses.program_id')
742
+        //          						->join('schools', 'schools.id', '=', 'programs.school_id')
743
+        //           						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
744
+        //                    			   	->whereIn('courses.semester_id', Session::get('semesters_ids'))
745
+        //                     			->whereRaw('activities.outcomes_attempted is not null')
746
+        //                     			->select('activities.id as activity_id','semesters.name as semester','schools.name as school','programs.name as program','programs.id as program_id','programs.code as program_code','students.number as student_number','students.conc_code as student_conc_code','assessments.scores as results','courses.name as course','courses.code as course_code','courses.number as course_number','rubrics.expected_points as expected_result')
747
+        //                     			->orderBy('semesters.id','school','program','course','student_number')
748
+        // 								->distinct()
749
+        //                     			->get();
750
+        //                     			    
751
+        //         $total_assessments=array();
752
+        // 		foreach($total_assessments_temp as $total_assessment)
753
+        // 		{
754
+        // 			$results=json_decode($total_assessment->results, TRUE);
755
+        // 			$total_assessment->course=$total_assessment->course_code.$total_assessment->course_number." ".$total_assessment->course;
756
+        // 			foreach($results as $criterion_id => $result)
757
+        // 			{	
758
+        // 				if($result and $result!="N/A")
759
+        // 				{
760
+        // 					$trans_temp=clone $total_assessment;
761
+        // 					$criterion=Criterion::find($criterion_id);
762
+        // 					if($criterion)
763
+        // 					{
764
+        // 	// 					var_dump($total_assessment->activity_id);
765
+        // 	// 					var_dump($criterion_id);
766
+        // 						if($criterion_id==1398)var_dump($criterion);
767
+        // 	// 					exit();
768
+        // 						$trans_temp->result=$result;
769
+        // 						$trans_temp->criterion=$criterion->name;
770
+        // 						$trans_temp->outcome=Outcome::find($criterion->outcome_id)->name;
771
+        // 						$total_assessments[]=$trans_temp;
772
+        // 					}
773
+        // 				}
774
+        // 			}
775
+        // 		
776
+        // 		}
777
+        $total_assessments = DB::table('assessments')
778
+            ->join('students', 'students.id', '=', 'assessments.student_id')
779
+            ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
780
+            ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
781
+            ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
782
+            ->join('criterion_objective_outcome', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
783
+            ->join('outcomes', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
784
+            ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
785
+            ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
786
+            ->join('courses', 'courses.id', '=', 'activities.course_id')
787
+            ->join('programs', 'programs.id', '=', 'courses.program_id')
788
+            ->join('schools', 'schools.id', '=', 'programs.school_id')
789
+            ->join('semesters', 'semesters.id', '=', 'courses.semester_id')
790
+            ->whereIn('courses.semester_id', Session::get('semesters_ids'))
791
+            ->select('criteria.name as criterion', 'outcomes.name as outcome', 'activities.id as activity_id', 'semesters.name as semester', 'schools.name as school', 'programs.name as program', 'programs.id as program_id', 'programs.code as program_code', 'students.number as student_number', 'students.conc_code as student_conc_code', 'assessments.score as result', 'courses.name as course', 'courses.code as course_code', 'courses.number as course_number', 'rubrics.expected_points as expected_result')
792
+            ->orderBy('semesters.id', 'school', 'program', 'course', 'student_number')
793
+            ->distinct()
794
+            ->get();
795
+
796
+
797
+        $title = "Total Assessment Report";
798
+
798 799
         return View::make('local.managers.admins.total_assessment', compact('title', 'total_assessments'));
799 800
     }
800 801
 

+ 16
- 7
app/controllers/SchoolCoordinatorsController.php Näytä tiedosto

@@ -5,7 +5,10 @@ class SchoolCoordinatorsController extends \BaseController
5 5
 
6 6
     private function participatingPrograms($school)
7 7
     {
8
-        return DB::table('VIEW_participating_programs')
8
+        return DB::table('programs')
9
+            ->join('courses', 'courses.program_id', '=', 'programs.id')
10
+            ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
11
+            ->addSelect('courses.semester_id')
9 12
             ->where('school_id', $school->id)
10 13
             ->whereIn('semester_id', Session::get('semesters_ids'))
11 14
             ->lists('id');
@@ -158,8 +161,8 @@ class SchoolCoordinatorsController extends \BaseController
158 161
         foreach ($school->programs as $program) {
159 162
             foreach ($program->courses as $course) {
160 163
                 if (!$course->program->is_graduate) {
161
-                    if ($course->outcomes_achieved != NULL) {
162
-                        $course_outcomes_achieved = $course->outcomes_ach();
164
+                    if ($course_outcomes_achieved = $course->outcomes_ach()) {
165
+                        //$course_outcomes_achieved = $course->outcomes_ach();
163 166
                         $course_outcomes_attempted = $course->outcomes_att();
164 167
                         foreach ($course_outcomes_attempted as $i => $score) {
165 168
 
@@ -172,8 +175,8 @@ class SchoolCoordinatorsController extends \BaseController
172 175
                     }
173 176
                     $undergrad_school_sections_count += 1;
174 177
                 } else {
175
-                    if ($course->outcomes_achieved != NULL) {
176
-                        $course_outcomes_achieved = $course->outcomes_ach();
178
+                    if ($course_outcomes_achieved = $course->outcomes_ach()) {
179
+                        //$course_outcomes_achieved = $course->outcomes_ach();
177 180
                         $course_outcomes_attempted = $course->outcomes_att();
178 181
                         foreach ($course_outcomes_attempted as $i => $score) {
179 182
 
@@ -200,7 +203,10 @@ class SchoolCoordinatorsController extends \BaseController
200 203
         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
201 204
 
202 205
         // Fetch programs with participation for the school
203
-        $participating_undergrad_programs = DB::table('VIEW_participating_programs')
206
+        $participating_undergrad_programs = DB::table('programs')
207
+            ->join('courses', 'courses.program_id', '=', 'programs.id')
208
+            ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
209
+            ->addSelect('courses.semester_id')
204 210
             ->whereIn('semester_id', Session::get('semesters_ids'))
205 211
             ->where('is_graduate', 0)
206 212
             ->where('school_id', $school->id)
@@ -274,7 +280,10 @@ class SchoolCoordinatorsController extends \BaseController
274 280
         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
275 281
 
276 282
         // Fetch programs with participation for the school
277
-        $participating_grad_programs = DB::table('VIEW_participating_programs')
283
+        $participating_grad_programs = DB::table('programs')
284
+            ->join('courses', 'courses.program_id', '=', 'programs.id')
285
+            ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
286
+            ->addSelect('courses.semester_id')
278 287
             ->whereIn('semester_id', Session::get('semesters_ids'))
279 288
             ->where('is_graduate', 1)
280 289
             ->where('school_id', $school->id)

+ 125
- 142
app/controllers/SchoolsController.php Näytä tiedosto

@@ -5,18 +5,21 @@ class SchoolsController extends \BaseController
5 5
 
6 6
     private function participatingPrograms($school)
7 7
     {
8
-        return DB::table('VIEW_participating_programs')
8
+        return DB::table('programs')
9
+            ->join('courses', 'courses.program_id', '=', 'programs.id')
10
+            ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
11
+            ->addSelect('courses.semester_id')
9 12
             ->where('school_id', $school->id)
10 13
             ->whereIn('semester_id', Session::get('semesters_ids'))
11 14
             ->lists('id');
12 15
     }
13 16
 
14
-	public function show($id)
15
-	{
17
+    public function show($id)
18
+    {
16 19
         ini_set('memory_limit', '256M');
17 20
         DB::connection()->disableQueryLog();
18 21
         $school = School::find($id);
19
-        $title= $school->name;
22
+        $title = $school->name;
20 23
         $schools = School::all();
21 24
 
22 25
         $outcomes = Outcome::orderBy('name', 'asc')->get();
@@ -27,25 +30,25 @@ class SchoolsController extends \BaseController
27 30
          * List of grouped courses (grouped sections)
28 31
          */
29 32
 
30
-        $program_ids= $school->programs->lists('id');
33
+        $program_ids = $school->programs->lists('id');
31 34
 
32 35
         $undergrad_programs = DB::table('programs')
33
-        ->select('id', 'name', 'school_id', 'is_graduate')
34
-        ->where('is_graduate', '=', 0)
35
-        ->where('school_id', '=', $id)
36
-        ->orderBy('name', 'ASC')
37
-        ->get();
36
+            ->select('id', 'name', 'school_id', 'is_graduate')
37
+            ->where('is_graduate', '=', 0)
38
+            ->where('school_id', '=', $id)
39
+            ->orderBy('name', 'ASC')
40
+            ->get();
38 41
 
39 42
         $grad_programs = DB::table('programs')
40
-        ->select('id', 'name', 'school_id', 'is_graduate')
41
-        ->where('is_graduate', '=', 1)
42
-        ->where('school_id', '=', $id)
43
-        ->orderBy('name', 'ASC')
44
-        ->get();
45
-   
43
+            ->select('id', 'name', 'school_id', 'is_graduate')
44
+            ->where('is_graduate', '=', 1)
45
+            ->where('school_id', '=', $id)
46
+            ->orderBy('name', 'ASC')
47
+            ->get();
48
+
46 49
 
47 50
         $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'))
51
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
49 52
             select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
50 53
             ->with('semester')
51 54
             ->with('program')
@@ -60,7 +63,7 @@ class SchoolsController extends \BaseController
60 63
             ->get();
61 64
 
62 65
         $undergrad_grouped_courses = Course::
63
-//             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
66
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
64 67
             select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
65 68
             ->with('semester')
66 69
             ->with('program')
@@ -92,41 +95,32 @@ class SchoolsController extends \BaseController
92 95
         $grad_assessed_sections_count = 0;
93 96
         $grad_school_sections_count = 0;
94 97
 
95
-        foreach($school->programs as $program)
96
-        {
97
-        	foreach ($program->courses as $course)
98
-        	{
99
-                if(!$course->program->is_graduate)
100
-                {
101
-                    if($course->outcomes_achieved != NULL)
102
-                    {
103
-                        $course_outcomes_achieved =json_decode($course->outcomes_achieved, true);
104
-                        $course_outcomes_attempted =json_decode($course->outcomes_attempted, true);
105
-                        for($i=1; $i<=count($undergrad_outcomes_attempted); $i++)
106
-                        {
107
-                            $undergrad_outcomes_achieved[$i]+=$course_outcomes_achieved[$i];
108
-                            $undergrad_outcomes_attempted[$i]+=$course_outcomes_attempted[$i];
98
+        foreach ($school->programs as $program) {
99
+            foreach ($program->courses as $course) {
100
+                if (!$course->program->is_graduate) {
101
+                    if ($course->outcomes_achieved != NULL) {
102
+                        $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
103
+                        $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
104
+                        for ($i = 1; $i <= count($undergrad_outcomes_attempted); $i++) {
105
+                            $undergrad_outcomes_achieved[$i] += $course_outcomes_achieved[$i];
106
+                            $undergrad_outcomes_attempted[$i] += $course_outcomes_attempted[$i];
109 107
                         }
110
-                        $undergrad_assessed_sections_count+=1;
108
+                        $undergrad_assessed_sections_count += 1;
111 109
                     }
112
-                    $undergrad_school_sections_count+=1;
113
-                }
114
-                else
115
-                {
116
-                    if($course->outcomes_achieved != NULL)
117
-                    {
118
-                        $course_outcomes_achieved =json_decode($course->outcomes_achieved, true);
119
-                        $course_outcomes_attempted =json_decode($course->outcomes_attempted, true);
120
-                        for($i=1; $i<=count($grad_outcomes_attempted); $i++)
121
-                        {
122
-                            $grad_outcomes_achieved[$i]+=$course_outcomes_achieved[$i];
123
-                            $grad_outcomes_attempted[$i]+=$course_outcomes_attempted[$i];
110
+                    $undergrad_school_sections_count += 1;
111
+                } else {
112
+                    if ($course->outcomes_achieved != NULL) {
113
+                        $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
114
+                        $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
115
+                        for ($i = 1; $i <= count($grad_outcomes_attempted); $i++) {
116
+                            $grad_outcomes_achieved[$i] += $course_outcomes_achieved[$i];
117
+                            $grad_outcomes_attempted[$i] += $course_outcomes_attempted[$i];
124 118
                         }
125
-                        $grad_assessed_sections_count+=1;
119
+                        $grad_assessed_sections_count += 1;
126 120
                     }
127
-                    $grad_school_sections_count+=1;
121
+                    $grad_school_sections_count += 1;
128 122
                 }
129
-            }    
123
+            }
130 124
         }
131 125
 
132 126
         /**
@@ -140,7 +134,10 @@ class SchoolsController extends \BaseController
140 134
         $attemptedUndergradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
141 135
 
142 136
         // Fetch programs with participation for the school
143
-        $participating_undergrad_programs = DB::table('VIEW_participating_programs')
137
+        $participating_undergrad_programs = DB::table('programs')
138
+            ->join('courses', 'courses.program_id', '=', 'programs.id')
139
+            ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
140
+            ->addSelect('courses.semester_id')
144 141
             ->whereIn('semester_id', Session::get('semesters_ids'))
145 142
             ->where('is_graduate', 0)
146 143
             ->where('school_id', $school->id)
@@ -151,42 +148,39 @@ class SchoolsController extends \BaseController
151 148
 
152 149
 
153 150
         // For each outcome 
154
-        foreach ($outcomes as $outcome)
155
-        {
151
+        foreach ($outcomes as $outcome) {
156 152
             // For each program with courses that do assessment
157
-            $programs_with_courses = Program::with(array('courses' => function($query){
158
-//                 $query->whereNotNull('outcomes_attempted');
153
+            $programs_with_courses = Program::with(array('courses' => function ($query) {
154
+                //                 $query->whereNotNull('outcomes_attempted');
159 155
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
160 156
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
161 157
 
162
-            foreach ($programs_with_courses as $program)
163
-            {
158
+            foreach ($programs_with_courses as $program) {
164 159
                 // To acummulate all criteria for one program
165 160
                 $achieved_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
166 161
                 $attempted_outcomes_per_undergrad_program = array_fill(1, $outcomeCount, 0);
167 162
 
168 163
                 //Flag for counting programs
169
-                $flag =false;
164
+                $flag = false;
170 165
 
171 166
                 // For each course in the program
172
-                foreach ($program->courses as $course)
173
-                {
167
+                foreach ($program->courses as $course) {
174 168
                     // If the outcome in question is being evaluated
175 169
                     $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);
170
+                    //                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
171
+                    //                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
178 172
                     $course_outcomes_achieved2 = $course->outcomes_ach();
179
-                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
180
-                        && $course_outcomes_attempted2[$outcome->id]>0)
181
-                    {
182
-                        $achieved_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
183
-                        $attempted_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_attempted2[$outcome->id];
173
+                    if (
174
+                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
175
+                        && $course_outcomes_attempted2[$outcome->id] > 0
176
+                    ) {
177
+                        $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
178
+                        $attempted_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
184 179
 
185 180
                         // Add one to the programs assessing, if it wasn't added before
186
-                        if(!$flag)
187
-                        {
188
-                            $attemptedUndergradProgramsPerOutcome[$outcome->id]+=1;
189
-                            $flag= true;
181
+                        if (!$flag) {
182
+                            $attemptedUndergradProgramsPerOutcome[$outcome->id] += 1;
183
+                            $flag = true;
190 184
                         }
191 185
                     }
192 186
 
@@ -195,9 +189,8 @@ class SchoolsController extends \BaseController
195 189
 
196 190
                 }
197 191
                 //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
198
-                if($attempted_outcomes_per_undergrad_program[$outcome->id]!=0 && (float)$achieved_outcomes_per_undergrad_program[$outcome->id]/$attempted_outcomes_per_undergrad_program[$outcome->id]*100 >= $outcome->expected_outcome)
199
-                {
200
-                    $achievedUndergradProgramsPerOutcome[$outcome->id]+=1;
192
+                if ($attempted_outcomes_per_undergrad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_undergrad_program[$outcome->id] / $attempted_outcomes_per_undergrad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
193
+                    $achievedUndergradProgramsPerOutcome[$outcome->id] += 1;
201 194
                     // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
202 195
                 }
203 196
             }
@@ -214,7 +207,10 @@ class SchoolsController extends \BaseController
214 207
         $attemptedGradProgramsPerOutcome = array_fill(1, $outcomeCount, 0);
215 208
 
216 209
         // Fetch programs with participation for the school
217
-        $participating_grad_programs = DB::table('VIEW_participating_programs')
210
+        $participating_grad_programs = DB::table('programs')
211
+            ->join('courses', 'courses.program_id', '=', 'programs.id')
212
+            ->select('programs.id', 'programs.name', 'programs.is_graduate', 'programs.school_id')
213
+            ->addSelect('courses.semester_id')
218 214
             ->whereIn('semester_id', Session::get('semesters_ids'))
219 215
             ->where('is_graduate', 1)
220 216
             ->where('school_id', $school->id)
@@ -225,42 +221,39 @@ class SchoolsController extends \BaseController
225 221
 
226 222
 
227 223
         // For each outcome 
228
-        foreach ($outcomes as $outcome)
229
-        {
224
+        foreach ($outcomes as $outcome) {
230 225
             // For each program with courses that do assessment
231
-            $programs_with_courses = Program::with(array('courses' => function($query){
232
-//                 $query->whereNotNull('outcomes_attempted');
226
+            $programs_with_courses = Program::with(array('courses' => function ($query) {
227
+                //                 $query->whereNotNull('outcomes_attempted');
233 228
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
234 229
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
235 230
 
236
-            foreach ($programs_with_courses as $program)
237
-            {
231
+            foreach ($programs_with_courses as $program) {
238 232
                 // To acummulate all criteria for one program
239 233
                 $achieved_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
240 234
                 $attempted_outcomes_per_grad_program = array_fill(1, $outcomeCount, 0);
241 235
 
242 236
                 //Flag for counting programs
243
-                $flag =false;
237
+                $flag = false;
244 238
 
245 239
                 // For each course in the program
246
-                foreach ($program->courses as $course)
247
-                {
240
+                foreach ($program->courses as $course) {
248 241
                     // If the outcome in question is being evaluated
249
-//                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
242
+                    //                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
250 243
                     $course_outcomes_attempted2 = ($course->outcomes_att());
251 244
                     $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 )
254
-                        && $course_outcomes_attempted2[$outcome->id]>0)
255
-                    {
256
-                        $achieved_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
257
-                        $attempted_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_attempted2[$outcome->id];
245
+                    //                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
246
+                    if (
247
+                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
248
+                        && $course_outcomes_attempted2[$outcome->id] > 0
249
+                    ) {
250
+                        $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
251
+                        $attempted_outcomes_per_grad_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
258 252
 
259 253
                         // Add one to the programs assessing, if it wasn't added before
260
-                        if(!$flag)
261
-                        {
262
-                            $attemptedGradProgramsPerOutcome[$outcome->id]+=1;
263
-                            $flag= true;
254
+                        if (!$flag) {
255
+                            $attemptedGradProgramsPerOutcome[$outcome->id] += 1;
256
+                            $flag = true;
264 257
                         }
265 258
                     }
266 259
 
@@ -269,17 +262,16 @@ class SchoolsController extends \BaseController
269 262
 
270 263
                 }
271 264
                 //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
272
-                if($attempted_outcomes_per_grad_program[$outcome->id]!=0 && (float)$achieved_outcomes_per_grad_program[$outcome->id]/$attempted_outcomes_per_grad_program[$outcome->id]*100 >= $outcome->expected_outcome)
273
-                {
274
-                    $achievedGradProgramsPerOutcome[$outcome->id]+=1;
265
+                if ($attempted_outcomes_per_grad_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_grad_program[$outcome->id] / $attempted_outcomes_per_grad_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
266
+                    $achievedGradProgramsPerOutcome[$outcome->id] += 1;
275 267
                     // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
276 268
                 }
277 269
             }
278 270
         }
279
-        if($school->id == 13){
280
-            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'));
281
-        }else{
282
-            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'));
271
+        if ($school->id == 13) {
272
+            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'));
273
+        } else {
274
+            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'));
283 275
         }
284 276
     }
285 277
 
@@ -289,7 +281,7 @@ class SchoolsController extends \BaseController
289 281
         DB::connection()->disableQueryLog();
290 282
 
291 283
         $school = School::find($id);
292
-        $title= $school->name.' Assessment Report - '.date('m/d/Y');
284
+        $title = $school->name . ' Assessment Report - ' . date('m/d/Y');
293 285
 
294 286
         $outcomes = Outcome::orderBy('name', 'asc')->get();
295 287
         $outcomeCount = Outcome::all()->count();
@@ -301,10 +293,10 @@ class SchoolsController extends \BaseController
301 293
          * List of courses (grouped sections)
302 294
          */
303 295
 
304
-        $program_ids= $school->programs->lists('id');
296
+        $program_ids = $school->programs->lists('id');
305 297
 
306 298
         $grouped_courses = Course::
307
-//             select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
299
+            //             select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
308 300
             select(DB::raw('name, code, number, semester_id, program_id'))
309 301
             ->with('semester')
310 302
             ->with('program')
@@ -328,23 +320,19 @@ class SchoolsController extends \BaseController
328 320
         $assessed_sections_count = 0;
329 321
         $school_sections_count = 0;
330 322
 
331
-        foreach($school->programs as $program)
332
-        {
333
-            foreach ($program->courses as $course)
334
-            {
335
-              if($course->outcomes_achieved!=NULL)
336
-              {
337
-                $course_outcomes_achieved =json_decode($course->outcomes_achieved, true);
338
-                $course_outcomes_attempted =json_decode($course->outcomes_attempted, true);
339
-                for($i=1; $i<=count($outcomes_attempted); $i++)
340
-                {
341
-                  $outcomes_achieved[$i]+=$course_outcomes_achieved[$i];
342
-                  $outcomes_attempted[$i]+=$course_outcomes_attempted[$i];
343
-                }
323
+        foreach ($school->programs as $program) {
324
+            foreach ($program->courses as $course) {
325
+                if ($course->outcomes_achieved != NULL) {
326
+                    $course_outcomes_achieved = json_decode($course->outcomes_achieved, true);
327
+                    $course_outcomes_attempted = json_decode($course->outcomes_attempted, true);
328
+                    for ($i = 1; $i <= count($outcomes_attempted); $i++) {
329
+                        $outcomes_achieved[$i] += $course_outcomes_achieved[$i];
330
+                        $outcomes_attempted[$i] += $course_outcomes_attempted[$i];
331
+                    }
344 332
 
345
-                $assessed_sections_count+=1;
346
-              }
347
-              $school_sections_count+=1;
333
+                    $assessed_sections_count += 1;
334
+                }
335
+                $school_sections_count += 1;
348 336
             }
349 337
         }
350 338
 
@@ -362,38 +350,35 @@ class SchoolsController extends \BaseController
362 350
 
363 351
 
364 352
         // For each outcome
365
-        foreach ($outcomes as $outcome)
366
-        {
353
+        foreach ($outcomes as $outcome) {
367 354
             // For each program with courses that do assessment
368
-            foreach (Program::with(array('courses' => function($query){
369
-//                 $query->whereNotNull('outcomes_attempted');
355
+            foreach (Program::with(array('courses' => function ($query) {
356
+                //                 $query->whereNotNull('outcomes_attempted');
370 357
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
371
-            }))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program)
372
-            {
358
+            }))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program) {
373 359
                 // To acummulate all criteria for one program
374 360
                 $achieved_outcomes_per_program = array_fill(1, $outcomeCount, 0);
375 361
                 $attempted_outcomes_per_program = array_fill(1, $outcomeCount, 0);
376 362
 
377 363
                 //Flag for counting programs
378
-                $flag =false;
364
+                $flag = false;
379 365
 
380 366
                 // For each course in the program
381
-                foreach ($program->courses as $course)
382
-                {
367
+                foreach ($program->courses as $course) {
383 368
                     // If the outcome in question is being evaluated
384 369
                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
385 370
                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
386
-                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
387
-                        && $course_outcomes_attempted2[$outcome->id]>0)
388
-                    {
389
-                        $achieved_outcomes_per_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
390
-                        $attempted_outcomes_per_program[$outcome->id]+=$course_outcomes_attempted2[$outcome->id];
371
+                    if (
372
+                        array_key_exists($outcome->id, $course_outcomes_attempted2)
373
+                        && $course_outcomes_attempted2[$outcome->id] > 0
374
+                    ) {
375
+                        $achieved_outcomes_per_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
376
+                        $attempted_outcomes_per_program[$outcome->id] += $course_outcomes_attempted2[$outcome->id];
391 377
 
392 378
                         // Add one to the programs assessing, if it wasn't added before
393
-                        if(!$flag)
394
-                        {
395
-                            $attemptedProgramsPerOutcome[$outcome->id]+=1;
396
-                            $flag= true;
379
+                        if (!$flag) {
380
+                            $attemptedProgramsPerOutcome[$outcome->id] += 1;
381
+                            $flag = true;
397 382
                         }
398 383
                     }
399 384
 
@@ -402,15 +387,13 @@ class SchoolsController extends \BaseController
402 387
 
403 388
                 }
404 389
                 //If the accumulated achieved criteria for a specific outcome in a program divided by the accumulated attempted criteria for a specific outcome in a program is greated than the expected outcome
405
-                if($attempted_outcomes_per_program[$outcome->id]!=0 && (float)$achieved_outcomes_per_program[$outcome->id]/$attempted_outcomes_per_program[$outcome->id]*100 >= $outcome->expected_outcome)
406
-                {
407
-                    $achievedProgramsPerOutcome[$outcome->id]+=1;
390
+                if ($attempted_outcomes_per_program[$outcome->id] != 0 && (float)$achieved_outcomes_per_program[$outcome->id] / $attempted_outcomes_per_program[$outcome->id] * 100 >= $outcome->expected_outcome) {
391
+                    $achievedProgramsPerOutcome[$outcome->id] += 1;
408 392
                     // $output[]= 'END OF PROGRAM: '.$program->name.'-'.json_encode($achievedProgramsPerOutcome);
409 393
                 }
410 394
             }
411 395
         }
412 396
 
413
-       return View::make('local.managers.shared.print_school', compact('title', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'school', 'assessed_sections_count', 'school_sections_count', 'achievedProgramsPerOutcome', 'attemptedProgramsPerOutcome', 'grouped_courses', 'participating_programs'));
397
+        return View::make('local.managers.shared.print_school', compact('title', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'school', 'assessed_sections_count', 'school_sections_count', 'achievedProgramsPerOutcome', 'attemptedProgramsPerOutcome', 'grouped_courses', 'participating_programs'));
414 398
     }
415
-
416 399
 }

+ 2
- 1
app/models/Activity.php Näytä tiedosto

@@ -198,7 +198,7 @@ class Activity extends Eloquent
198 198
     return $outcomes_achieved;
199 199
   }
200 200
 
201
-  // o_att_array
201
+
202 202
   public function is_assessed()
203 203
   {
204 204
     $all_criterion = DB::table('activity_criterion')
@@ -236,6 +236,7 @@ class Activity extends Eloquent
236 236
     else return '';
237 237
   }
238 238
 
239
+  // o_att_array
239 240
 
240 241
   public function getOAttArrayAttribute()
241 242
   {

+ 30
- 2
app/views/local/managers/admins/objectives.blade.php Näytä tiedosto

@@ -4,7 +4,11 @@
4 4
 @include('local.managers.admins._navigation')
5 5
 @stop
6 6
 @section('main')
7
+<div class="row">
8
+    <div class="col-md-12" id = 'message'>
7 9
 
10
+    </div>
11
+    </div>
8 12
 <div class="row">
9 13
     <div class="col-md-6">
10 14
         <!-- Form to add a new objective -->
@@ -524,8 +528,32 @@ $('#counterAssoc').val(counterAssoc);
524 528
                 text:text,
525 529
                 id:id
526 530
             },
527
-   function(){
528
-       location.reload(true);
531
+            function($array){
532
+       div = $('<div/>', {
533
+           'class':'alert alert-dismissible alert-'+$array.status,
534
+           'role':'alert'
535
+       })
536
+       button = $('<button/>', {
537
+           'class':'close',
538
+           'type':'button',
539
+           'data-dismiss':'alert',
540
+           'aria-label':'Close'
541
+
542
+       }).html('<span aria-hidden="true">&times;</span>');
543
+       div.append(button);
544
+       if($array.status == 'danger'){
545
+       span = $('<span/>',{
546
+           'class':'glyphicon glyphicon-remove-sign'
547
+       });
548
+       }
549
+       else{
550
+        span = $('<span/>',{
551
+           'class':'glyphicon glyphicon-ok-sign'
552
+       });
553
+       }
554
+       div.append(span);
555
+    div.append($array.message);
556
+    div.appendTo('#message');
529 557
    }
530 558
         )
531 559
     })

+ 31
- 3
app/views/local/managers/pCoords/objectives.blade.php Näytä tiedosto

@@ -4,7 +4,11 @@
4 4
 @include('local.managers.pCoords._navigation')
5 5
 @stop
6 6
 @section('main')
7
+<div class="row">
8
+    <div class="col-md-12" id = 'message'>
7 9
 
10
+    </div>
11
+    </div>
8 12
 <div class="row">
9 13
     <div class="col-md-6">
10 14
         <!-- Form to add a new objective -->
@@ -16,7 +20,7 @@
16 20
                 {{ Form::open(array('action' => 'Objective2Controller@create' )) }}
17 21
                 <div id='outcomeGroup'>
18 22
                     <label> Associated Outcome</label>
19
-                    <div class="form-group col-md-11" id='outcomeForm='>
23
+                    <div class="form-group col-md-11" id='outcomeForm'>
20 24
 
21 25
 
22 26
                         <select id="outcome[0]" name="outcome[0]" class="form-control selectpicker">
@@ -549,8 +553,32 @@
549 553
                 text:text,
550 554
                 id:id
551 555
             },
552
-   function(){
553
-       location.reload(true);
556
+            function($array){
557
+       div = $('<div/>', {
558
+           'class':'alert alert-dismissible alert-'+$array.status,
559
+           'role':'alert'
560
+       })
561
+       button = $('<button/>', {
562
+           'class':'close',
563
+           'type':'button',
564
+           'data-dismiss':'alert',
565
+           'aria-label':'Close'
566
+
567
+       }).html('<span aria-hidden="true">&times;</span>');
568
+       div.append(button);
569
+       if($array.status == 'danger'){
570
+       span = $('<span/>',{
571
+           'class':'glyphicon glyphicon-remove-sign'
572
+       });
573
+       }
574
+       else{
575
+        span = $('<span/>',{
576
+           'class':'glyphicon glyphicon-ok-sign'
577
+       });
578
+       }
579
+       div.append(span);
580
+    div.append($array.message);
581
+    div.appendTo('#message');
554 582
    }
555 583
         )
556 584
     })

+ 1
- 2
app/views/local/managers/sCoords/criteria.blade.php Näytä tiedosto

@@ -1176,8 +1176,7 @@ $('#alert_placeholder').html('<div class="alert alert-danger alert-dismissible"
1176 1176
 
1177 1177
 
1178 1178
 
1179
-            },
1180
-            'json'
1179
+            }
1181 1180
         );
1182 1181
     }
1183 1182
 </script>@stop

+ 30
- 2
app/views/local/managers/sCoords/objectives.blade.php Näytä tiedosto

@@ -4,7 +4,11 @@
4 4
 @include('local.managers.sCoords._navigation')
5 5
 @stop
6 6
 @section('main')
7
+<div class="row">
8
+    <div class="col-md-12" id = 'message'>
7 9
 
10
+    </div>
11
+    </div>
8 12
 <div class="row">
9 13
     <div class="col-md-6">
10 14
         <!-- Form to add a new objective -->
@@ -529,8 +533,32 @@
529 533
                 text:text,
530 534
                 id:id
531 535
             },
532
-   function(){
533
-       location.reload(true);
536
+   function($array){
537
+       div = $('<div/>', {
538
+           'class':'alert alert-dismissible alert-'+$array.status,
539
+           'role':'alert'
540
+       })
541
+       button = $('<button/>', {
542
+           'class':'close',
543
+           'type':'button',
544
+           'data-dismiss':'alert',
545
+           'aria-label':'Close'
546
+
547
+       }).html('<span aria-hidden="true">&times;</span>');
548
+       div.append(button);
549
+       if($array.status == 'danger'){
550
+       span = $('<span/>',{
551
+           'class':'glyphicon glyphicon-remove-sign'
552
+       });
553
+       }
554
+       else{
555
+        span = $('<span/>',{
556
+           'class':'glyphicon glyphicon-ok-sign'
557
+       });
558
+       }
559
+       div.append(span);
560
+    div.append($array.message);
561
+    div.appendTo('#message');
534 562
    }
535 563
         )
536 564
     })

+ 1
- 1
app/views/local/professors/assessment.blade.php Näytä tiedosto

@@ -376,7 +376,7 @@ $('#button-submit-assessment, #button-draft-assessment').on('click', function(e)
376 376
 
377 377
 
378 378
 // Enable fixed headers
379
-$('#assessment-table').stickyTableHeaders();
379
+//$('#assessment-table').stickyTableHeaders();
380 380
 
381 381
 
382 382
 // Hide spanish instructions by default

+ 2
- 2
app/views/local/professors/course.blade.php Näytä tiedosto

@@ -86,12 +86,12 @@
86 86
                         <td>{{ date('M d, Y', strtotime($activity->date)) }}</td>
87 87
                         <td>{{ date('M d, Y', strtotime($activity->updated_at)) }}</td>
88 88
                         <td>
89
-                            @if($activity->outcomes_attempted!=NULL)
89
+                            @if($activity->o_att_array)
90 90
                                 <span class="glyphicon glyphicon-ok"></span>
91 91
                             @endif
92 92
                         </td>
93 93
                         <td>
94
-                            @if($activity->outcomes_attempted!=NULL && !$activity->draft)
94
+                            @if($activity->o_att_array && !$activity->draft)
95 95
                                 <span class="glyphicon glyphicon-ok"></span>
96 96
                             @endif
97 97
                         </td>

+ 1
- 1
app/views/local/professors/printrubric.blade.php Näytä tiedosto

@@ -134,7 +134,7 @@ echo '<style type="text/css" media="print">
134 134
       <td>
135 135
         {{{ $criterion->name }}}
136 136
 
137
-        @if(property_exists($criterion, 'subcriteria'))
137
+        @if($criterion->subcriteria)
138 138
           <ul class="list-unstyled">
139 139
             @foreach(json_decode($criterion->subcriteria) as $subcriterion)
140 140
                 <li>{{ $subcriterion }}</li>

+ 3
- 2
app/views/local/professors/viewrubric.blade.php Näytä tiedosto

@@ -46,8 +46,9 @@
46 46
             <td>
47 47
               <span><em data-toggle="tooltip" data-placement="top" title="{{ $criterion->notes }}">{{{ $criterion->name }}}</em></span>
48 48
               <sup></sup>
49
-              @if(property_exists($criterion, 'subcriteria'))
49
+              @if($criterion->subcriteria)
50 50
                 <ul class="list-unstyled">
51
+                 
51 52
                   @foreach(json_decode($criterion->subcriteria) as $subcriterion)
52 53
                       <li>{{ $subcriterion }}</li>
53 54
                   @endforeach
@@ -57,7 +58,7 @@
57 58
             @else
58 59
             <td>
59 60
               <span>{{{ $criterion->name }}}</span><sup></sup>
60
-              @if(property_exists($criterion, 'subcriteria'))
61
+              @if($criterion->subcriteria)
61 62
                 <ul class="list-unstyled">
62 63
                   @foreach(json_decode($criterion->subcriteria) as $subcriterion)
63 64
                       <li>{{ $subcriterion }}</li>