Browse Source

Navigation

parent
commit
c92a70bec3

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

892
                             ->has('activities')
892
                             ->has('activities')
893
                             //                             ->whereNotNull('outcomes_attempted')
893
                             //                             ->whereNotNull('outcomes_attempted')
894
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
894
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
895
+                            ->join('activities', 'activities.course_id', '=', 'courses.id')
896
+                            ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
897
+                            ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
898
+                            ->where('activities.draft', 0)
899
+                            ->select('courses.*')->distinct()
895
                             ->whereIn('semester_id', Session::get('semesters_ids'))
900
                             ->whereIn('semester_id', Session::get('semesters_ids'))
896
                             ->groupBy(array('code', 'number'));
901
                             ->groupBy(array('code', 'number'));
897
                     }));
902
                     }));

+ 47
- 10
app/controllers/ProgramsController.php View File

73
      * List of grouped courses (grouped sections)
73
      * List of grouped courses (grouped sections)
74
      */
74
      */
75
 
75
 
76
-//     $grouped_courses = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
77
-    $grouped_courses = Course::select(DB::raw('name, code, number, 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('courses.name, code, number, semester_id, program_id, activities.id as activity_assessed'))
78
+      ->leftJoin('activities', function ($query) {
79
+        $query->on('activities.course_id', '=', 'courses.id');
80
+        $query->on('activities.draft', '=', DB::raw('0'));
81
+      })
78
       ->with('semester')
82
       ->with('semester')
79
       ->with('program')
83
       ->with('program')
80
       ->where('program_id', $program->id)
84
       ->where('program_id', $program->id)
85
+
81
       ->whereIn('semester_id', Session::get('semesters_ids'))
86
       ->whereIn('semester_id', Session::get('semesters_ids'))
87
+
82
       ->groupBy(array('code', 'number', 'semester_id'))
88
       ->groupBy(array('code', 'number', 'semester_id'))
83
       ->orderBy('code')
89
       ->orderBy('code')
84
       ->orderBy('number')
90
       ->orderBy('number')
85
       ->orderBy('semester_id')
91
       ->orderBy('semester_id')
86
       ->get();
92
       ->get();
87
 
93
 
94
+
95
+
88
     // Program contact information
96
     // Program contact information
89
     $users = User::select('users.*')
97
     $users = User::select('users.*')
90
       ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
98
       ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
166
     //OUTCOMES Join criteria join program
174
     //OUTCOMES Join criteria join program
167
     foreach ($programs as $program) {
175
     foreach ($programs as $program) {
168
       $info_by_id = Program::find($program->id);
176
       $info_by_id = Program::find($program->id);
177
+      $domains = DB::table('outcomes')
178
+        ->join('criterion_objective_outcome as cobo', 'cobo.outcome_id', '=', 'outcomes.id')
179
+        ->join('criteria', 'criteria.id', '=', 'cobo.criterion_id')
180
+        ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
181
+        ->join('courses', 'courses.program_id', '=', 'program_criterion.program_id')
182
+        ->where('program_criterion.program_id', $program->id)
183
+        ->select('outcomes.name', 'outcomes.activation_date')
184
+        ->distinct()
185
+        ->orderBy('outcomes.name', 'asc')
186
+        ->get();
187
+
188
+      /*
169
 
189
 
170
       $domains = DB::table('outcomes')
190
       $domains = DB::table('outcomes')
171
         ->join('criteria', 'criteria.outcome_id', '=', 'outcomes.id')
191
         ->join('criteria', 'criteria.outcome_id', '=', 'outcomes.id')
176
         ->distinct()
196
         ->distinct()
177
         ->orderBy('outcomes.name', 'asc')
197
         ->orderBy('outcomes.name', 'asc')
178
         ->get();
198
         ->get();
199
+        */
200
+
201
+      $courses_used =  DB::table('outcomes')
202
+        ->join('criterion_objective_outcome as cobo', 'cobo.outcome_id', '=', 'outcomes.id')
203
+        ->join('criteria', 'criteria.id', '=', 'cobo.criterion_id')
204
+        ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
205
+        ->join('courses', 'courses.program_id', '=', 'program_criterion.program_id')
206
+        ->where('program_criterion.program_id', $program->id)
207
+        ->select('courses.number', 'outcomes.name as domain_name', 'courses.code')
208
+        ->distinct()
209
+        ->orderBy('courses.name', 'asc')
210
+        ->get();
179
 
211
 
212
+      /*
180
       $courses_used = DB::table('outcomes')
213
       $courses_used = DB::table('outcomes')
181
         ->join('criteria', 'criteria.outcome_id', '=', 'outcomes.id')
214
         ->join('criteria', 'criteria.outcome_id', '=', 'outcomes.id')
182
         ->join('programs', 'programs.id', '=', 'criteria.program_id')
215
         ->join('programs', 'programs.id', '=', 'criteria.program_id')
185
         ->select('courses.number', 'outcomes.name as domain_name', 'courses.code')
218
         ->select('courses.number', 'outcomes.name as domain_name', 'courses.code')
186
         ->distinct()
219
         ->distinct()
187
         ->orderBy('courses.name', 'asc')
220
         ->orderBy('courses.name', 'asc')
188
-        ->get();
221
+        ->get(); */
189
 
222
 
190
       $transformative_actions = DB::table('outcomes')
223
       $transformative_actions = DB::table('outcomes')
191
-        ->join('criteria', 'criteria.outcome_id', '=', 'outcomes.id')
192
-        ->join('programs', 'programs.id', '=', 'criteria.program_id')
193
-        ->join('courses', 'courses.program_id', '=', 'programs.id')
224
+        ->join('criterion_objective_outcome as cobo', 'cobo.outcome_id', '=', 'outcomes.id')
225
+        ->join('criteria', 'criteria.id', '=', 'cobo.criterion_id')
226
+        ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
227
+        ->join('courses', 'courses.program_id', '=', 'program_criterion.program_id')
228
+
194
         ->join('activities', 'activities.course_id', '=', 'courses.id')
229
         ->join('activities', 'activities.course_id', '=', 'courses.id')
195
         ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
230
         ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
196
-        ->where('programs.id', $program->id)
197
-        ->select('activity_criterion.transformative_actions', 'outcomes.name as domain_name')
231
+        ->join('transformative_activity_criterion as taa', 'taa.activity_criterion_id', '=', 'activity_criterion.id')
232
+        ->join('transformative_actions', 'transformative_actions.id', '=', 'taa.trans_action_id')
233
+        ->where('program_criterion.program_id', $program->id)
234
+        ->select('transformative_actions.description', 'outcomes.name as domain_name')
198
         ->distinct()
235
         ->distinct()
199
-        ->orderBy('activity_criterion.transformative_actions', 'asc')
236
+        ->orderBy('transformative_actions.description', 'asc')
200
         ->get();
237
         ->get();
201
       $info = array($info_by_id, $domains, $courses_used, $transformative_actions);
238
       $info = array($info_by_id, $domains, $courses_used, $transformative_actions);
202
       array_push($programs_info, $info);
239
       array_push($programs_info, $info);
365
       $program_array['assessed_courses_count'] = 0;
402
       $program_array['assessed_courses_count'] = 0;
366
       foreach ($program_array['program_courses'] as $course) {
403
       foreach ($program_array['program_courses'] as $course) {
367
         if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
404
         if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
368
-//           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
405
+          //           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
369
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
406
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
370
           Log::info($program_array['course_outcomes_achieved']);
407
           Log::info($program_array['course_outcomes_achieved']);
371
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
408
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {

+ 1
- 0
app/controllers/RubricsController.php View File

460
                 ->join('criterion_objective_outcome', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
460
                 ->join('criterion_objective_outcome', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
461
                 ->where('criterion_objective_outcome.criterion_id', '=', $single_cr->criterion_id)->lists('name'));
461
                 ->where('criterion_objective_outcome.criterion_id', '=', $single_cr->criterion_id)->lists('name'));
462
         }
462
         }
463
+
463
         $title = $activity->name . ': ' . $rubric->name;
464
         $title = $activity->name . ': ' . $rubric->name;
464
         return View::make('local.professors.printrubric', compact('rubric', 'rubric_criterion', 'activity', 'title', 'course'));
465
         return View::make('local.professors.printrubric', compact('rubric', 'rubric_criterion', 'activity', 'title', 'course'));
465
     }
466
     }

+ 55
- 0
app/controllers/TemplatesController.php View File

15
 		$schools = School::with('programs.templates')
15
 		$schools = School::with('programs.templates')
16
 			->orderBy('name')
16
 			->orderBy('name')
17
 			->get();
17
 			->get();
18
+		$role = Auth::user()->role;
19
+		switch ($role) {
20
+			case 1:
21
+				$templates = Template::orderBy('name')->get();
22
+				break;
23
+
24
+			case 2:
25
+
26
+				$templates = Template::orderBy('name')
27
+					->whereNull("school_id")
28
+					->orWhere('school_id', Auth::user()->school_id)
29
+					->get();
30
+				break;
31
+			case 3:
32
+				$program_id = DB::table("program_user")
33
+					->where('user_id', Auth::user()->id)
34
+					->lists('program_id')[0];
35
+				$school_id = DB::table('programs')
36
+					->where('id', $program_id)
37
+					->lists('school_id')[0];
38
+
18
 
39
 
40
+				$templates = Template::orderBy('name')
41
+					->whereNull("school_id")
42
+					->orWhere('school_id', $school_id)
43
+					->orWhere('program_id', $program_id)
44
+
45
+					->get();
46
+				break;
47
+		}
19
 		$templates = Template::orderBy('name')->get();
48
 		$templates = Template::orderBy('name')->get();
20
 
49
 
21
 		return View::make('local.managers.admins.rubric_list', compact('title', 'global_templates', 'schools', 'templates'));
50
 		return View::make('local.managers.admins.rubric_list', compact('title', 'global_templates', 'schools', 'templates'));
40
 	{
69
 	{
41
 		$title = $template->name;
70
 		$title = $template->name;
42
 
71
 
72
+		$template->titles = DB::table('titles')
73
+			->join('template_title', 'template_title.title_id', '=', "titles.id")
74
+			->where('template_id', $template->id)
75
+			->orderBy('position', 'ASC')
76
+			->lists('text');
77
+
78
+		$template->criteria = DB::table('criteria')
79
+			->join('template_criterion', 'template_criterion.criterion_id', '=', 'criteria.id')
80
+			->where('template_id', $template->id)
81
+			->orderBy('position')
82
+			->get();
83
+
84
+		foreach ($template->criteria as $criterion) {
85
+			$criterion->scales = DB::table('criterion_scale')
86
+				->join('scales', 'scales.id', '=', 'criterion_scale.scale_id')
87
+				->where('criterion_id', $criterion->criterion_id)
88
+				->orderBy('position')
89
+				->lists('description');
90
+			$criterion->outcomes = DB::table('criterion_objective_outcome as cobo')
91
+				->join('outcomes', 'outcomes.id', '=', 'cobo.outcome_id')
92
+				->where('cobo.criterion_id', $criterion->criterion_id)
93
+				->select('outcomes.*')
94
+				->distinct()
95
+				->get();
96
+		}
97
+
43
 		return View::make('local.managers.admins.view_template', compact('template', 'title'));
98
 		return View::make('local.managers.admins.view_template', compact('template', 'title'));
44
 	}
99
 	}
45
 
100
 

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

393
 
393
 
394
       //
394
       //
395
       // // insert the multiple TA_course
395
       // // insert the multiple TA_course
396
-      DB::table('TA_course')->insert(
396
+      DB::table('ta_course')->insert(
397
         array(
397
         array(
398
           'ta_id' => $ta_id,
398
           'ta_id' => $ta_id,
399
           'course_number' => $course_code_number[1],
399
           'course_number' => $course_code_number[1],

+ 3
- 14
app/models/Activity.php View File

38
     $activity_criterion = DB::table('activity_criterion')
38
     $activity_criterion = DB::table('activity_criterion')
39
       ->where('activity_id', '=', $this->id)
39
       ->where('activity_id', '=', $this->id)
40
       ->get();
40
       ->get();
41
-    Log::info('activity_criterion');
42
-    Log::info($activity_criterion);
43
 
41
 
44
     $criteria_achieved = [];
42
     $criteria_achieved = [];
45
     foreach ($activity_criterion as $index => $single_ac) {
43
     foreach ($activity_criterion as $index => $single_ac) {
83
       )
81
       )
84
       ->addSelect('criteria.name', 'criteria.subcriteria')
82
       ->addSelect('criteria.name', 'criteria.subcriteria')
85
       ->get();
83
       ->get();
86
-    Log::info($criterias);
87
-    Log::info($this->rubric);
88
-    Log::info("this is rubric");
84
+
89
     foreach ($criterias as $index => $single_crit) {
85
     foreach ($criterias as $index => $single_crit) {
90
 
86
 
91
 
87
 
92
       $single_crit->outcome_id = json_encode(DB::table('criterion_objective_outcome')
88
       $single_crit->outcome_id = json_encode(DB::table('criterion_objective_outcome')
93
         ->where('criterion_id', '=', $single_crit->criterion_id)
89
         ->where('criterion_id', '=', $single_crit->criterion_id)
94
         ->lists('outcome_id'));
90
         ->lists('outcome_id'));
95
-      Log::info(json_decode($single_crit->outcome_id));
96
       $amount_of_students = count(DB::table('assessments')
91
       $amount_of_students = count(DB::table('assessments')
97
         ->where("activity_criterion_id", '=', $single_crit->id)
92
         ->where("activity_criterion_id", '=', $single_crit->id)
98
         ->lists('student_id'));
93
         ->lists('student_id'));
99
-      Log::info($amount_of_students);
100
-      Log::info($single_crit->id);
101
-      Log::info('lmaoOOOO');
94
+
102
 
95
 
103
       $student_pass = DB::table('assessments')
96
       $student_pass = DB::table('assessments')
104
         ->where("activity_criterion_id", '=', $single_crit->id)
97
         ->where("activity_criterion_id", '=', $single_crit->id)
105
         ->where('score', '>=', $this->rubric[0]->expected_points)
98
         ->where('score', '>=', $this->rubric[0]->expected_points)
106
         ->lists('student_id');
99
         ->lists('student_id');
107
-      Log::info($student_pass);
108
       $amount_of_students_passed = count(DB::table('assessments')
100
       $amount_of_students_passed = count(DB::table('assessments')
109
         ->where("activity_criterion_id", '=', $single_crit->id)
101
         ->where("activity_criterion_id", '=', $single_crit->id)
110
         ->where('score', '>=', $this->rubric[0]->expected_points)
102
         ->where('score', '>=', $this->rubric[0]->expected_points)
111
         ->lists('student_id'));
103
         ->lists('student_id'));
112
-      Log::info($amount_of_students_passed);
113
-      Log::info('es aqui');
114
 
104
 
115
       $single_crit->score_percentage = ($amount_of_students_passed / $amount_of_students) * 100;
105
       $single_crit->score_percentage = ($amount_of_students_passed / $amount_of_students) * 100;
116
       $criteria_achieved_percentage[$single_crit->criterion_id] = $single_crit;
106
       $criteria_achieved_percentage[$single_crit->criterion_id] = $single_crit;
117
-      Log::info("?");
118
     }
107
     }
119
     return $criteria_achieved_percentage;
108
     return $criteria_achieved_percentage;
120
   }
109
   }
209
       ->whereIn('activity_criterion_id', $all_criterion)
198
       ->whereIn('activity_criterion_id', $all_criterion)
210
       ->lists('id');
199
       ->lists('id');
211
 
200
 
212
-//     return boolval(count($assessments));
201
+    //     return boolval(count($assessments));
213
     return (bool)(count($assessments));
202
     return (bool)(count($assessments));
214
   }
203
   }
215
 
204
 

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

157
 			->where('programs.id', '=', $this->id)
157
 			->where('programs.id', '=', $this->id)
158
 			->whereIn('courses.semester_id', $semesters_array)
158
 			->whereIn('courses.semester_id', $semesters_array)
159
 			->count(DB::raw('DISTINCT criterion_objective_outcome.outcome_id'));
159
 			->count(DB::raw('DISTINCT criterion_objective_outcome.outcome_id'));
160
+
161
+
162
+		Log::info(DB::table('activity_criterion')
163
+			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
164
+			->join('courses', 'activities.course_id', '=', 'courses.id')
165
+			->join('programs', 'programs.id', '=', 'courses.program_id')
166
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
167
+			->where('criterion_objective_outcome.outcome_id', '=', $outcome_id)
168
+			->where('programs.id', '=', $this->id)
169
+			->whereIn('courses.semester_id', $semesters_array)
170
+			->toSql());
160
 		return $conteo;
171
 		return $conteo;
161
 	}
172
 	}
162
 
173
 

+ 5
- 0
app/routes.php View File

345
         Route::get('school/{id}', 'SchoolsController@show');
345
         Route::get('school/{id}', 'SchoolsController@show');
346
         Route::get('program/{id}', 'ProgramsController@show');
346
         Route::get('program/{id}', 'ProgramsController@show');
347
         Route::post('programs/report', 'ProgramsController@showReport');
347
         Route::post('programs/report', 'ProgramsController@showReport');
348
+        Route::get('template/{template}', 'TemplatesController@show');
349
+
348
         // Route::post('storeTypInfo', 'OutcomesController@storeCycleInfo'); //TODO: where is this route supposed to be placed?
350
         // Route::post('storeTypInfo', 'OutcomesController@storeCycleInfo'); //TODO: where is this route supposed to be placed?
349
         Route::get('programs', 'ProgramsController@index');
351
         Route::get('programs', 'ProgramsController@index');
350
         Route::get('template-list', 'TemplatesController@schoolCoordinatorIndex');
352
         Route::get('template-list', 'TemplatesController@schoolCoordinatorIndex');
397
         Route::get('program-coordinator', 'ProgramCoordinatorsController@overview');
399
         Route::get('program-coordinator', 'ProgramCoordinatorsController@overview');
398
         Route::post('deleteObjective', 'Objective2Controller@delete');
400
         Route::post('deleteObjective', 'Objective2Controller@delete');
399
         Route::get('rubrics', 'TemplatesController@newTemplate');
401
         Route::get('rubrics', 'TemplatesController@newTemplate');
402
+        Route::get('template/{template}', 'TemplatesController@show');
403
+
400
         Route::post('saveTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@create'));
404
         Route::post('saveTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@create'));
401
         Route::post('updateTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@update'));
405
         Route::post('updateTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@update'));
402
         Route::post('deleteTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@destroy'));
406
         Route::post('deleteTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@destroy'));
407
         Route::get('printRubric/{id}', 'TemplatesController@printview');
411
         Route::get('printRubric/{id}', 'TemplatesController@printview');
408
         Route::get('rubric/{rubric_id}', 'RubricsController@show_limited');
412
         Route::get('rubric/{rubric_id}', 'RubricsController@show_limited');
409
         Route::get('grouped_course/{code}/{number}/{semester_code}', 'CoursesController@showGrouped');
413
         Route::get('grouped_course/{code}/{number}/{semester_code}', 'CoursesController@showGrouped');
414
+        Route::get('template-list', 'TemplatesController@schoolCoordinatorIndex');
410
 
415
 
411
         //Criteria and objectives
416
         //Criteria and objectives
412
         Route::get('program-criteria', 'CriteriaController@editProgram');
417
         Route::get('program-criteria', 'CriteriaController@editProgram');

+ 50
- 30
app/views/local/managers/admins/assessment_report.blade.php View File

58
 
58
 
59
                                         <?php
59
                                         <?php
60
 
60
 
61
-                                            $sections_evaluating_outcome = Course::has('activities')
61
+                                           /* $sections_evaluating_outcome = Course::has('activities')
62
 //                                             ->whereNotNull('outcomes_attempted')
62
 //                                             ->whereNotNull('outcomes_attempted')
63
 //                                             ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
63
 //                                             ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
64
                                             ->with(array('activities'=>function($query) use(&$outcome){
64
                                             ->with(array('activities'=>function($query) use(&$outcome){
68
                                                 } ))
68
                                                 } ))
69
                                             ->where('code', $course->code)->where('number',$course->number)
69
                                             ->where('code', $course->code)->where('number',$course->number)
70
                                             ->whereIn('semester_id', Session::get('semesters_ids'))
70
                                             ->whereIn('semester_id', Session::get('semesters_ids'))
71
-                                            ->get();
71
+                                            ->get();*/
72
+
73
+                                            $sections_evaluating_outcome = Course::has('activities')
74
+                            
75
+                          ->with(array('activities'=>function($query) use(&$outcome, &$course){
76
+                                $activities = DB::table('activities')
77
+                                ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
78
+                                ->join('assessments', 'assessments.activity_criterion_id', '=','activity_criterion.id')
79
+                                ->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
80
+                                ->join('courses','courses.id','=','activities.course_id')
81
+                                ->where('courses.code', $course->code)
82
+                                ->where('courses.number',$course->number)
83
+                                ->where('criterion_objective_outcome.outcome_id', $outcome->id)
84
+                                ->select('activity_id')
85
+                                ->lists('activity_id');
86
+
87
+                               $query->whereIn('id', $activities);
88
+                        } ))
89
+                                
90
+
91
+                            ->where('code', $course->code)->where('number',$course->number)
92
+                            ->whereIn('semester_id', Session::get('semesters_ids'))
93
+                            ->get();
72
 
94
 
73
                                             
95
                                             
74
                                         ?>
96
                                         ?>
82
 
104
 
83
                                                 <!-- For each activity in the section -->
105
                                                 <!-- For each activity in the section -->
84
                                                 @foreach($section->activities as $activity_index => $activity)
106
                                                 @foreach($section->activities as $activity_index => $activity)
107
+                                                        <?php
85
 
108
 
109
+Log::info($activity->o_att_array);
110
+Log::info(array_key_exists($outcome->id, $activity->o_att_array));
111
+Log::info($activity->o_att_array[$outcome->id] >=1);
112
+Log::info(isset($section)); 
113
+Log::info($activity->rubric[0]);
114
+
115
+?>
86
                                                     <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
116
                                                     <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
87
-                                                    @if(array_key_exists($outcome->id, (array)$activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1 && isset($section)&& isset($activity->rubric))
117
+                                                    @if($activity->draft == 0 && array_key_exists($outcome->id, $activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1 && isset($section)&& isset($activity->rubric[0]))
88
                                                         <h5>Measure {{ $activity_index + 1 }}</h5>
118
                                                         <h5>Measure {{ $activity_index + 1 }}</h5>
89
                                                         <?php
119
                                                         <?php
90
                                                         /*
120
                                                         /*
104
 
134
 
105
                                                         <p>A rubric was used in the {{ $section->code }}-{{ $section->number }} ({{ $section->name }}) course ({{ date('M Y', strtotime($activity->date))}}) to assess students’ <u>{{ strtolower($outcome->name) }}</u> in the activity: "<strong>{{ $activity->name }}</strong>". N= {{ count($section->students) }}. </p>
135
                                                         <p>A rubric was used in the {{ $section->code }}-{{ $section->number }} ({{ $section->name }}) course ({{ date('M Y', strtotime($activity->date))}}) to assess students’ <u>{{ strtolower($outcome->name) }}</u> in the activity: "<strong>{{ $activity->name }}</strong>". N= {{ count($section->students) }}. </p>
106
                                                         
136
                                                         
107
-                                                        <p>The expected performance level was that <strong>{{ $activity->rubric->expected_percentage }}%</strong> of students participating in the activity would score <strong>{{ $activity->rubric->expected_points }} points</strong> or more in the 1-8 point scale used.</p>
137
+                                                        <p>The expected performance level was that <strong>{{ $activity->rubric[0]->expected_percentage }}%</strong> of students participating in the activity would score <strong>{{ $activity->rubric[0]->expected_points }} points</strong> or more in the 1-{{$activity->rubric[0]->max_score}} point scale used.</p>
108
                                                         
138
                                                         
109
                                                         <p>The results for each criterion were as follows:</p>
139
                                                         <p>The results for each criterion were as follows:</p>
110
 
140
 
111
                                                         <?php
141
                                                         <?php
112
 
142
 
113
-                                                            $rubric_contents = json_decode($activity->rubric->contents);
143
+                                                            //$rubric_contents = json_decode($activity->rubric->contents);
114
                                                         ?>
144
                                                         ?>
115
 
145
 
116
                                                         <table class="table table-condensed table-bordered">
146
                                                         <table class="table table-condensed table-bordered">
117
                                                             <tbody>
147
                                                             <tbody>
118
-                                                                @foreach((array)$activity->cap_array as $criterion_id => $criteria_achieved_percentage)
148
+                                                                @foreach((array)$activity->cap_array as $criterion_id => $criterion)
149
+                                                                @if(in_array($outcome->id, json_decode($criterion->outcome_id))  /*== $outcome->id*/ && $criterion->score_percentage >= $activity->rubric[0]->expected_percentage )
150
+                                                                    <tr>
151
+                                                                        <td>{{ $criterion->name }}</td>
152
+                                                                        <td class="col-md-1 success">{{ $criterion->score_percentage }}%</td>
153
+                                                                    </tr>
154
+                                                                @elseif(in_array($outcome->id, json_decode($criterion->outcome_id)) && $criterion->score_percentage < $activity->rubric[0]->expected_percentage )
119
                                                                     <tr>
155
                                                                     <tr>
120
-                                                                    <?php
121
-                                                                        $rubric_criterion_outcome_id = NULL;
122
-                                                                        foreach ($rubric_contents as $rubric_criterion) {
123
-                                                                            if($rubric_criterion->id == $criterion_id) {
124
-                                                                                $rubric_criterion_outcome_id = $rubric_criterion->outcome_id;
125
-                                                                                break;
126
-                                                                            }
127
-
128
-                                                                        }
129
-                                                                        $criterion = Criterion::find($criterion_id);
130
-
131
-                                                                    ?>
132
-                                                                    @if($rubric_criterion_outcome_id == $outcome->id && $criteria_achieved_percentage >= $activity->rubric->expected_percentage )
133
-                                                                        <td>{{ $criterion['name'] }}</td>
134
-                                                                        <td class="col-md-1 success">{{ $criteria_achieved_percentage }}%</td>
135
-                                                                    @elseif($rubric_criterion_outcome_id == $outcome->id && $criteria_achieved_percentage < $activity->rubric->expected_percentage )
136
-                                                                        <td>{{ $criterion['name'] }}</td>
137
-                                                                        <td class="col-md-1 danger">{{ $criteria_achieved_percentage }}%</td>
138
-                                                                    @endif
156
+                                                                        <td>{{ $criterion->name }}</td>
157
+                                                                        <td class="col-md-1 danger">{{ $criterion->score_percentage }}%</td>
139
                                                                     </tr>
158
                                                                     </tr>
140
-                                                                @endforeach
159
+                                                                @endif  
160
+                                                            @endforeach
141
                                                             </tbody>
161
                                                             </tbody>
142
                                                         </table>
162
                                                         </table>
143
 
163
 
144
                                                         <p>
164
                                                         <p>
145
                                                             <?php
165
                                                             <?php
146
-                                                                $o_att_array = $activity->o_att_array;
147
-                                                                $o_ach_array = $activity->o_ach_array;
148
-                                                                $percentage = ($o_ach_array[$outcome->id]/$o_att_array[$outcome->id])*100;
149
-                                                            ?>
166
+                                                                  $o_att_array = $activity->o_att_array;
167
+                                                            $o_ach_array = $activity->o_ach_array;
168
+                                                            $percentage = ($o_ach_array[$outcome->id]/$o_att_array[$outcome->id])*100;
169
+                                                        ?>
150
                                                             @if($percentage >= 100)
170
                                                             @if($percentage >= 100)
151
                                                                 The expected goal was reached in <strong>all</strong> (100%) of the criteria assessed. Therefore, the goal for this outcome ({{ $outcome->expected_outcome }}%) was <strong>met</strong>.
171
                                                                 The expected goal was reached in <strong>all</strong> (100%) of the criteria assessed. Therefore, the goal for this outcome ({{ $outcome->expected_outcome }}%) was <strong>met</strong>.
152
                                                             @elseif ($percentage < 1)
172
                                                             @elseif ($percentage < 1)

+ 32
- 4
app/views/local/managers/admins/view_template.blade.php View File

24
             
24
             
25
             <th>Criterion</th>
25
             <th>Criterion</th>
26
             @for($i = 0; $i <$template->num_scales; $i++)
26
             @for($i = 0; $i <$template->num_scales; $i++)
27
-              <th>Scale {{$i+1}} ({{1+($i*($template->max_score/$template->num_scales))}} - {{(1+$i)*($template->max_score/$template->num_scales)}})</th>
27
+              <th>{{$template->titles[$i]}}  ({{1+($i*($template->max_score/$template->num_scales))}} - {{(1+$i)*($template->max_score/$template->num_scales)}})</th>
28
               
28
               
29
                            
29
                            
30
             @endfor
30
             @endfor
33
           </tr>
33
           </tr>
34
         </thead>
34
         </thead>
35
       <tbody id ="bodyRubric">
35
       <tbody id ="bodyRubric">
36
+        @foreach($template->criteria as $index=> $criterion)
37
+      <tr data-criterion-copyright="{{$criterion->copyright}}" data-criterion-notes="{{$criterion->notes}}">
38
+        <td>{{$index+1}}.</td>
39
+
40
+        @if($criterion->notes)
41
+            
42
+          <td><span><em data-toggle="tooltip" data-placement="top" title="{{$criterion->notes}}">{{$criterion->name}}</em></span><sup></sup></td>
43
+          
44
+
45
+        
46
+        @else
47
+          
48
+          <td><span>{{$criterion->name}}</span><sup></sup></td>
49
+
50
+        
51
+@endif
52
+
53
+@foreach ($criterion->scales as $scale)
54
+<td>{{$scale}}</td>
55
+    
56
+@endforeach
57
+<td><ol>
58
+@foreach ($criterion->outcomes as $outcome)
59
+    <li>{{$outcome->name}}</li>
60
+@endforeach
61
+</ol></td>
62
+        @endforeach
36
 
63
 
37
       </tbody>
64
       </tbody>
38
     </table>
65
     </table>
56
   </div>
83
   </div>
57
 </div>
84
 </div>
58
 
85
 
59
-<script>
86
+<script> 
87
+/*
60
   function createTable(){
88
   function createTable(){
61
     $.post("{{URL::action('TemplatesController@onLoadFetch')}}",
89
     $.post("{{URL::action('TemplatesController@onLoadFetch')}}",
62
         {id :{{$template->id}}},
90
         {id :{{$template->id}}},
96
         
124
         
97
         }, 'json'
125
         }, 'json'
98
         );
126
         );
99
-  }
127
+  }**/
100
   </script>
128
   </script>
101
 @stop
129
 @stop
102
 
130
 
109
 // --------------------------------------------------------------------------
137
 // --------------------------------------------------------------------------
110
 // Page load
138
 // Page load
111
 // --------------------------------------------------------------------------
139
 // --------------------------------------------------------------------------
112
-createTable();
140
+
113
 buildCopyrightList();
141
 buildCopyrightList();
114
 
142
 
115
 // --------------------------------------------------------------------------
143
 // --------------------------------------------------------------------------

+ 5
- 2
app/views/local/managers/pCoords/_navigation.blade.php View File

9
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Management<span class="caret"></span></a>
9
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Management<span class="caret"></span></a>
10
         <ul class="dropdown-menu" role="menu">
10
         <ul class="dropdown-menu" role="menu">
11
           <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
11
           <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
12
-        <li>{{ HTML::linkAction('Objective2Controller@editProgram', 'Objectives')}}</li>
13
-      <li>{{ HTML::linkAction('CriteriaController@editProgram', 'Criteria') }}</li>
12
+          <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
13
+      
14
+          <li>{{ HTML::linkAction('Objective2Controller@editProgram', 'Objectives')}}</li>
15
+      
16
+        <li>{{ HTML::linkAction('CriteriaController@editProgram', 'Criteria') }}</li>
14
       <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>
17
       <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>
15
 
18
 
16
     
19
     

+ 2
- 0
app/views/local/managers/sCoords/_navigation.blade.php View File

18
 <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives')}}</li>
18
 <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives')}}</li>
19
       <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
19
       <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
20
  <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
20
  <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
21
+ <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
22
+         
21
  <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>
23
  <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>
22
 
24
 
23
 
25
 

+ 1
- 1
app/views/local/managers/shared/print_rubric.blade.php View File

136
       <td>
136
       <td>
137
         {{{ $criterion->name }}}
137
         {{{ $criterion->name }}}
138
 
138
 
139
-        @if(property_exists($criterion, 'subcriteria'))
139
+        @if($criterion->subcriteria)
140
           <ul class="list-unstyled">
140
           <ul class="list-unstyled">
141
             @foreach(json_decode($criterion->subcriteria) as $subcriterion)
141
             @foreach(json_decode($criterion->subcriteria) as $subcriterion)
142
                 <li>{{ $subcriterion }}</li>
142
                 <li>{{ $subcriterion }}</li>

+ 2
- 2
app/views/local/managers/shared/program.blade.php View File

62
                                 <td class="col-md-4">{{{ $grouped_course->name}}}</td>
62
                                 <td class="col-md-4">{{{ $grouped_course->name}}}</td>
63
                                 <td class="col-md-3">{{{ $grouped_course->program->name }}}</td>
63
                                 <td class="col-md-3">{{{ $grouped_course->program->name }}}</td>
64
                                 <td class="col-md-1">
64
                                 <td class="col-md-1">
65
-                                    @if($grouped_course->outcomes_attempted!=NULL)
65
+                                    @if($grouped_course->activity_assessed!=NULL)
66
                                     Yes
66
                                     Yes
67
                                     @else
67
                                     @else
68
                                     No
68
                                     No
111
                                 <td>{{{ $course->name}}}</td>
111
                                 <td>{{{ $course->name}}}</td>
112
                                 <td>{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
112
                                 <td>{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
113
                                 <td>
113
                                 <td>
114
-                                    @if($course->outcomes_attempted!=NULL)
114
+                                    @if($course->outcomes_att())
115
                                     Yes
115
                                     Yes
116
                                     @else
116
                                     @else
117
                                     No
117
                                     No