|
@@ -38,6 +38,30 @@ class SchoolsController extends \BaseController
|
38
|
38
|
$outcomes_grad = Outcome::active_by_semesters($semesters, 1);
|
39
|
39
|
$outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
|
40
|
40
|
|
|
41
|
+ $undergrad_stu_outcome_attempted = [];
|
|
42
|
+ $grad_stu_outcome_attempted = [];
|
|
43
|
+ $undergrad_stu_outcome_achieved = [];
|
|
44
|
+ $grad_stu_outcome_achieved = [];
|
|
45
|
+
|
|
46
|
+ $attemptedUndergradProgramsPerOutcome = [];
|
|
47
|
+ $achievedUndergradProgramsPerOutcome = [];
|
|
48
|
+ $attemptedGradProgramsPerOutcome = [];
|
|
49
|
+ $achievedGradProgramsPerOutcome = [];
|
|
50
|
+
|
|
51
|
+ foreach ($outcomes_undergrad as $outcome) {
|
|
52
|
+ $undergrad_stu_outcome_attempted[$outcome->id] = 0;
|
|
53
|
+ $undergrad_stu_outcome_achieved[$outcome->id] = 0;
|
|
54
|
+ $attemptedUndergradProgramsPerOutcome[$outcome->id] = [];
|
|
55
|
+ $achievedUndergradProgramsPerOutcome[$outcome->id] = [];
|
|
56
|
+ }
|
|
57
|
+
|
|
58
|
+ foreach ($outcomes_grad as $outcome) {
|
|
59
|
+ $grad_stu_outcome_attempted[$outcome->id] = 0;
|
|
60
|
+ $grad_stu_outcome_achieved[$outcome->id] = 0;
|
|
61
|
+ $attemptedGradProgramsPerOutcome[$outcome->id] = [];
|
|
62
|
+ $achievedGradProgramsPerOutcome[$outcome->id] = [];
|
|
63
|
+ }
|
|
64
|
+
|
41
|
65
|
/**
|
42
|
66
|
* List of grouped courses (grouped sections)
|
43
|
67
|
*/
|
|
@@ -51,6 +75,8 @@ class SchoolsController extends \BaseController
|
51
|
75
|
->orderBy('name', 'ASC')
|
52
|
76
|
->get();
|
53
|
77
|
|
|
78
|
+
|
|
79
|
+
|
54
|
80
|
$grad_programs = DB::table('programs')
|
55
|
81
|
->select('id', 'name', 'school_id', 'is_graduate')
|
56
|
82
|
->where('is_graduate', '=', 1)
|
|
@@ -59,6 +85,139 @@ class SchoolsController extends \BaseController
|
59
|
85
|
->get();
|
60
|
86
|
|
61
|
87
|
|
|
88
|
+ //quiero ver si monto el query tm aqui
|
|
89
|
+
|
|
90
|
+ $undergrad_programs_list = DB::table('programs')
|
|
91
|
+ ->select('id', 'name', 'school_id', 'is_graduate')
|
|
92
|
+ ->where('is_graduate', '=', 0)
|
|
93
|
+ ->where('school_id', '=', $id)
|
|
94
|
+ ->orderBy('name', 'ASC')
|
|
95
|
+ ->lists('id');
|
|
96
|
+
|
|
97
|
+ $grad_programs_list = DB::table('programs')
|
|
98
|
+ ->select('id', 'name', 'school_id', 'is_graduate')
|
|
99
|
+ ->where('is_graduate', '=', 1)
|
|
100
|
+ ->where('school_id', '=', $id)
|
|
101
|
+ ->orderBy('name', 'ASC')
|
|
102
|
+ ->lists('id');
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+ $undergraduate_student_query = DB::table("courses")
|
|
106
|
+ ->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
107
|
+ ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
|
|
108
|
+ ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
|
|
109
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
110
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
111
|
+ ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
|
|
112
|
+ ->join('program_criterion_objective_outcome as poco', function ($q) {
|
|
113
|
+ $q->on('courses.program_id', '=', 'poco.program_id')
|
|
114
|
+ ->on('cobo.id', '=', 'poco.cri_obj_out_id');
|
|
115
|
+ })
|
|
116
|
+ ->join('students', 'students.id', '=', 'assessments.student_id')
|
|
117
|
+ ->whereIn('poco.program_id', $undergrad_programs_list)
|
|
118
|
+ ->whereIn("courses.semester_id", Session::get('semesters_ids'))
|
|
119
|
+ ->whereIn('courses.program_id', $undergrad_programs_list)
|
|
120
|
+ ->select('students.number as student_id')
|
|
121
|
+ ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
|
|
122
|
+ ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
|
|
123
|
+ ->addSelect('outcome_id')
|
|
124
|
+ ->groupBy(array('students.id', 'outcome_id'))
|
|
125
|
+ ->get();
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+ Log::info($undergraduate_student_query);
|
|
129
|
+
|
|
130
|
+ $grad_student_query = DB::table("courses")
|
|
131
|
+ ->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
132
|
+ ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
|
|
133
|
+ ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
|
|
134
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
135
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
136
|
+ ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
|
|
137
|
+ ->join('program_criterion_objective_outcome as poco', function ($q) {
|
|
138
|
+ $q->on('courses.program_id', '=', 'poco.program_id')
|
|
139
|
+ ->on('cobo.id', '=', 'poco.cri_obj_out_id');
|
|
140
|
+ })
|
|
141
|
+ ->join('students', 'students.id', '=', 'assessments.student_id')
|
|
142
|
+ ->whereIn('poco.program_id', $grad_programs_list)
|
|
143
|
+ ->whereIn("courses.semester_id", Session::get('semesters_ids'))
|
|
144
|
+ ->whereIn('courses.program_id', $grad_programs_list)
|
|
145
|
+ ->select('students.number as student_id')
|
|
146
|
+ ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
|
|
147
|
+ ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
|
|
148
|
+ ->addSelect('outcome_id')
|
|
149
|
+ ->groupBy(array('students.id', 'outcome_id'))
|
|
150
|
+ ->get();
|
|
151
|
+
|
|
152
|
+ //school
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+ /*
|
|
157
|
+ student x, crit achieved, crit attempted, outcome 1
|
|
158
|
+ student x, crit achieved, crit attempted, outcome 2
|
|
159
|
+ student x, crit achieved, crit attempted, outcome 3
|
|
160
|
+ student x, crit achieved, crit attempted, outcome 4
|
|
161
|
+ student y, crit achieved, crit attempted, outcome 1
|
|
162
|
+ student y, crit achieved, crit attempted, outcome 2
|
|
163
|
+ student y, crit achieved, crit attempted, outcome 3
|
|
164
|
+ ....
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+ */
|
|
168
|
+
|
|
169
|
+ $grad_outcomes_attempted = [];
|
|
170
|
+ $grad_outcomes_achieved = [];
|
|
171
|
+ $undergrad_outcomes_attempted = [];
|
|
172
|
+ $undergrad_outcomes_achieved = [];
|
|
173
|
+
|
|
174
|
+ foreach ($outcomes_grad as $outcome) {
|
|
175
|
+ $grad_outcomes_attempted[$outcome->id] = 0;
|
|
176
|
+ $grad_outcomes_achieved[$outcome->id] = 0;
|
|
177
|
+ }
|
|
178
|
+
|
|
179
|
+ foreach ($outcomes_undergrad as $outcome) {
|
|
180
|
+ $undergrad_outcomes_attempted[$outcome->id] = 0;
|
|
181
|
+ $undergrad_outcomes_achieved[$outcome->id] = 0;
|
|
182
|
+ }
|
|
183
|
+
|
|
184
|
+ foreach ($grad_student_query as $result) {
|
|
185
|
+ if ($result->criteria_attempted != 0) {
|
|
186
|
+ if (!isset($grad_outcomes_attempted[$result->outcome_id]))
|
|
187
|
+ continue;
|
|
188
|
+
|
|
189
|
+ $grad_outcomes_attempted[$result->outcome_id]++;
|
|
190
|
+
|
|
191
|
+ $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
|
|
192
|
+
|
|
193
|
+ if ($percent >= 66.66) {
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+ $grad_outcomes_achieved[$result->outcome_id]++;
|
|
197
|
+ }
|
|
198
|
+ }
|
|
199
|
+ }
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+ foreach ($undergraduate_student_query as $result) {
|
|
205
|
+ if ($result->criteria_attempted != 0) {
|
|
206
|
+ if (!isset($undergrad_outcomes_attempted[$result->outcome_id]))
|
|
207
|
+ continue;
|
|
208
|
+
|
|
209
|
+ $undergrad_outcomes_attempted[$result->outcome_id]++;
|
|
210
|
+
|
|
211
|
+ $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
|
|
212
|
+
|
|
213
|
+ if ($percent >= 66.66) {
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+ $undergrad_outcomes_achieved[$result->outcome_id]++;
|
|
217
|
+ }
|
|
218
|
+ }
|
|
219
|
+ }
|
|
220
|
+
|
62
|
221
|
$grad_grouped_courses = Course::
|
63
|
222
|
// select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
|
64
|
223
|
select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
|
|
@@ -135,11 +294,116 @@ class SchoolsController extends \BaseController
|
135
|
294
|
}
|
136
|
295
|
}
|
137
|
296
|
|
|
297
|
+
|
|
298
|
+ //como resuelvo programsAttempted y eso
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+ //El query es el mismo de students, lo unico que dividido con programas,
|
|
302
|
+ //asi que lo que esta haciendo es, prog 1, y coge los dominios y estudiantes que evaluason
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+ $undergrad_prog_attempted = DB::table("courses")
|
|
306
|
+ ->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
307
|
+ ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
|
|
308
|
+ ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
|
|
309
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
310
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
311
|
+ ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
|
|
312
|
+ ->join('program_criterion_objective_outcome as poco', function ($q) {
|
|
313
|
+ $q->on('courses.program_id', '=', 'poco.program_id')
|
|
314
|
+ ->on('cobo.id', '=', 'poco.cri_obj_out_id');
|
|
315
|
+ })
|
|
316
|
+ ->join('students', 'students.id', '=', 'assessments.student_id')
|
|
317
|
+ ->whereIn("courses.semester_id", Session::get('semesters_ids'))
|
|
318
|
+ ->whereIn('poco.program_id', $undergrad_programs_list)
|
|
319
|
+
|
|
320
|
+ ->whereIn('courses.program_id', $undergrad_programs_list)
|
|
321
|
+ ->select('students.number as student_id')
|
|
322
|
+ ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
|
|
323
|
+ ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
|
|
324
|
+ ->addSelect('outcome_id')
|
|
325
|
+ ->addSelect("courses.program_id")
|
|
326
|
+ ->groupBy(array('students.id', 'outcome_id', 'program_id'))
|
|
327
|
+ ->get();
|
|
328
|
+
|
|
329
|
+ $grad_prog_attempted = DB::table("courses")
|
|
330
|
+ ->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
331
|
+ ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
|
|
332
|
+ ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
|
|
333
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
334
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
335
|
+ ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
|
|
336
|
+ ->join('program_criterion_objective_outcome as poco', function ($q) {
|
|
337
|
+ $q->on('courses.program_id', '=', 'poco.program_id')
|
|
338
|
+ ->on('cobo.id', '=', 'poco.cri_obj_out_id');
|
|
339
|
+ })
|
|
340
|
+ ->join('students', 'students.id', '=', 'assessments.student_id')
|
|
341
|
+ ->whereIn("courses.semester_id", Session::get('semesters_ids'))
|
|
342
|
+ ->whereIn('poco.program_id', $grad_programs_list)
|
|
343
|
+
|
|
344
|
+ ->whereIn('courses.program_id', $grad_programs_list)
|
|
345
|
+ ->select('students.number as student_id')
|
|
346
|
+ ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
|
|
347
|
+ ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
|
|
348
|
+ ->addSelect('outcome_id')
|
|
349
|
+ ->addSelect("courses.program_id")
|
|
350
|
+ ->groupBy(array('students.id', 'outcome_id', 'program_id'))
|
|
351
|
+ ->get();
|
|
352
|
+
|
|
353
|
+ //este arreglo va a tener attempted[outcome->id][program->id]
|
|
354
|
+
|
|
355
|
+ //so la cardinalidad de attempted[outcome->id] dice cuantos programas intentaron, achieved[outcome->id], va
|
|
356
|
+ //a decir cuantos pasaron y attempted[outcome->id][program->id] la suma de estudiantes que intentaron
|
|
357
|
+ //
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+ foreach ($undergrad_prog_attempted as $row) {
|
|
361
|
+ $program_id = $row->program_id;
|
|
362
|
+ $outcome_id = $row->outcome_id;
|
|
363
|
+ if (!isset($attemptedUndergradProgramsPerOutcome[$outcome_id][$program_id]))
|
|
364
|
+ $attemptedUndergradProgramsPerOutcome[$outcome_id][$program_id] = 0;
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+ $attemptedUndergradProgramsPerOutcome[$outcome_id][$program_id]++;
|
|
368
|
+
|
|
369
|
+ $criteria_attempted_by_stu = $row->criteria_attempted;
|
|
370
|
+ $criteria_achieved_by_stu = $row->criteria_achieved;
|
|
371
|
+ if ($criteria_attempted_by_stu != 0 && $criteria_achieved_by_stu / $criteria_attempted_by_stu * 100 >= 66.67) {
|
|
372
|
+
|
|
373
|
+ if (!isset($achievedUndergradProgramsPerOutcome[$outcome_id][$program_id]))
|
|
374
|
+ $achievedUndergradProgramsPerOutcome[$outcome_id][$program_id] = 0;
|
|
375
|
+ $achievedUndergradProgramsPerOutcome[$outcome_id][$program_id]++;
|
|
376
|
+ }
|
|
377
|
+ }
|
|
378
|
+
|
|
379
|
+ foreach ($grad_prog_attempted as $row) {
|
|
380
|
+ $program_id = $row->program_id;
|
|
381
|
+ $outcome_id = $row->outcome_id;
|
|
382
|
+ if (!isset($attemptedGradProgramsPerOutcome[$outcome_id][$program_id]))
|
|
383
|
+ $attemptedGradProgramsPerOutcome[$outcome_id][$program_id] = 0;
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+ $attemptedGradProgramsPerOutcome[$outcome_id][$program_id]++;
|
|
387
|
+
|
|
388
|
+ $criteria_attempted_by_stu = $row->criteria_attempted;
|
|
389
|
+ $criteria_achieved_by_stu = $row->criteria_achieved;
|
|
390
|
+ if ($criteria_attempted_by_stu != 0 && $criteria_achieved_by_stu / $criteria_attempted_by_stu * 100 >= 66.67) {
|
|
391
|
+ if (!isset($achievedGradProgramsPerOutcome[$outcome_id][$program_id]))
|
|
392
|
+ $achievedGradProgramsPerOutcome[$outcome_id][$program_id] = 0;
|
|
393
|
+ $achievedGradProgramsPerOutcome[$outcome_id][$program_id]++;
|
|
394
|
+ }
|
|
395
|
+ }
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
138
|
401
|
/**
|
139
|
402
|
* Calculate how many programs achieved and attempted each outcome in this school
|
140
|
403
|
*/
|
141
|
404
|
|
142
|
405
|
// For each outcome
|
|
406
|
+ /*
|
143
|
407
|
foreach ($outcomes_undergrad as $outcome) {
|
144
|
408
|
// $attempted_outcomes_per_undergrad_program[$outcome->id]=0;
|
145
|
409
|
// $achieved_outcomes_per_undergrad_program[$outcome->id]=0;
|
|
@@ -168,12 +432,12 @@ class SchoolsController extends \BaseController
|
168
|
432
|
// $query->whereNotNull('outcomes_attempted');
|
169
|
433
|
$query->whereIn('semester_id', Session::get('semesters_ids'));
|
170
|
434
|
}))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
|
171
|
|
- }
|
|
435
|
+ }*/
|
172
|
436
|
|
173
|
437
|
/**
|
174
|
438
|
* Calculate how many Graduate programs achieved and attempted each outcome in this school
|
175
|
439
|
*/
|
176
|
|
-
|
|
440
|
+ /*
|
177
|
441
|
// For each outcome
|
178
|
442
|
foreach ($outcomes_grad as $outcome) {
|
179
|
443
|
// $attempted_outcomes_per_grad_program[$outcome->id]=0;
|
|
@@ -203,7 +467,7 @@ class SchoolsController extends \BaseController
|
203
|
467
|
// $query->whereNotNull('outcomes_attempted');
|
204
|
468
|
$query->whereIn('semester_id', Session::get('semesters_ids'));
|
205
|
469
|
}))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
|
206
|
|
- }
|
|
470
|
+ }*/
|
207
|
471
|
if ($school->id == 13) {
|
208
|
472
|
// 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'));
|
209
|
473
|
return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes_grad', 'outcomes_undergrad', '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'));
|
|
@@ -213,31 +477,30 @@ class SchoolsController extends \BaseController
|
213
|
477
|
}
|
214
|
478
|
}
|
215
|
479
|
|
216
|
|
- private function cmp($a, $b)
|
217
|
|
- {
|
218
|
|
- return strcmp($a->name, $b->name);
|
219
|
|
- }
|
|
480
|
+ private function cmp($a, $b)
|
|
481
|
+ {
|
|
482
|
+ return strcmp($a->name, $b->name);
|
|
483
|
+ }
|
220
|
484
|
|
221
|
485
|
public function studentSchoolAssessmentReport($school_id)
|
222
|
486
|
{
|
223
|
|
- $id=$school_id;
|
224
|
|
- ini_set('memory_limit', -1);
|
225
|
|
- ini_set('max_execution_time', 300);
|
226
|
|
-
|
227
|
|
- $outcomes = Outcome::orderBy('name', 'asc')->get();
|
228
|
|
- $school = School::find($school_id);
|
229
|
|
- $title= $school->name;
|
230
|
|
- $outcomeCount = Outcome::all()->count();
|
231
|
|
- $programs=Program::where('school_id','=',$school_id)->get();
|
232
|
|
- $programs_ids=array();
|
233
|
|
-// var_dump($programs);exit();
|
234
|
|
- $programs_name=array();
|
235
|
|
- foreach($programs as $program)
|
236
|
|
- {
|
237
|
|
-// var_dump($program);
|
238
|
|
- $programs_ids[]=$program->id;
|
239
|
|
- $programs_name[$program->id]=$program->name;
|
240
|
|
- }
|
|
487
|
+ $id = $school_id;
|
|
488
|
+ ini_set('memory_limit', -1);
|
|
489
|
+ ini_set('max_execution_time', 300);
|
|
490
|
+
|
|
491
|
+ $outcomes = Outcome::orderBy('name', 'asc')->get();
|
|
492
|
+ $school = School::find($school_id);
|
|
493
|
+ $title = $school->name;
|
|
494
|
+ $outcomeCount = Outcome::all()->count();
|
|
495
|
+ $programs = Program::where('school_id', '=', $school_id)->get();
|
|
496
|
+ $programs_ids = array();
|
|
497
|
+ // var_dump($programs);exit();
|
|
498
|
+ $programs_name = array();
|
|
499
|
+ foreach ($programs as $program) {
|
|
500
|
+ // var_dump($program);
|
|
501
|
+ $programs_ids[] = $program->id;
|
|
502
|
+ $programs_name[$program->id] = $program->name;
|
|
503
|
+ }
|
241
|
504
|
|
242
|
505
|
$grouped_courses = Course::
|
243
|
506
|
// select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
|
|
@@ -254,219 +517,175 @@ class SchoolsController extends \BaseController
|
254
|
517
|
->get();
|
255
|
518
|
|
256
|
519
|
|
257
|
|
- $role=Auth::user()->role;
|
258
|
|
-
|
259
|
|
- $users =array();
|
260
|
|
-
|
261
|
|
-
|
262
|
|
- $resultados_todos_obj = DB::table('assessments')
|
263
|
|
- ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
|
264
|
|
- ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
|
265
|
|
- ->join('courses', 'courses.id', '=', 'activities.course_id')
|
266
|
|
- ->join('students', 'students.id', '=', 'assessments.student_id')
|
267
|
|
- ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
|
268
|
|
- ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
269
|
|
- ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
270
|
|
- ->join('semesters', 'semesters.id', '=', 'courses.semester_id')
|
271
|
|
- ->whereIn('students.program_id',$programs_ids)
|
272
|
|
- ->whereIn('semester_id', Session::get('semesters_ids'))
|
273
|
|
- ->where('semesters.is_visible','=',1)
|
274
|
|
- ->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id','score','expected_points')
|
275
|
|
- ->distinct()
|
276
|
|
- ->get();
|
277
|
|
-
|
278
|
|
- foreach($resultados_todos_obj as $resultado)
|
279
|
|
- {
|
280
|
|
- if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']))
|
281
|
|
- {
|
282
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']=array();
|
283
|
|
- }
|
284
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'][]=$resultado->code;
|
285
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']=array_unique($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']);
|
286
|
|
- if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']))
|
287
|
|
- {
|
288
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']=0;
|
289
|
|
- }
|
290
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']++;
|
291
|
|
-
|
292
|
|
- if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']))
|
293
|
|
- {
|
294
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']=0;
|
295
|
|
- }
|
296
|
|
- if($resultado->score>=$resultado->expected_points)
|
297
|
|
- {
|
298
|
|
- $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']++;
|
299
|
|
- }
|
300
|
|
- }
|
301
|
|
-
|
302
|
|
- $outcomes_colap=array();
|
303
|
|
- $programs=array();
|
304
|
|
-// $outcomes_colap=array();
|
305
|
|
- $i=0;
|
306
|
|
- $outcomes_attempted=array();
|
307
|
|
- $outcomes_attempted_colap=array();
|
308
|
|
- $outcomes_achieved_colap=array();
|
309
|
|
- $outcomes_attempted_semesters=array();
|
310
|
|
- foreach($resultados_todos as $program_id => $resultados_prog)
|
311
|
|
- {
|
312
|
|
- $outcomes_attempted_semesters[$program_id]=array();
|
313
|
|
- foreach($resultados_prog as $out=>$datos_out)
|
314
|
|
- {
|
315
|
|
- $outcomes_achieved[$program_id][$out] = 0;
|
316
|
|
- $outcomes_attempted[$program_id][$out] = 0;
|
317
|
|
-// var_dump($datos_out);outcomes_attempted_semesters
|
318
|
|
- $outcomes_attempted_semesters[$program_id][$out]=$datos_out['semesters'];
|
319
|
|
- unset($datos_out['semesters']);
|
320
|
|
-// var_dump($outcomes_attempted_semesters[$program_id][$out]);
|
321
|
|
-// var_dump($datos_out);
|
322
|
|
-// exit();
|
323
|
|
- foreach($datos_out as $res)
|
324
|
|
- {
|
325
|
|
- $outcomes_attempted[$program_id][$out]++;
|
326
|
|
- if(3*$res['achieved']>=2*$res['attempted'])
|
327
|
|
- $outcomes_achieved[$program_id][$out]++;
|
328
|
|
- }
|
329
|
|
- }
|
330
|
|
- $programs[]=Program::find($program_id);
|
331
|
|
- if(Program::find($program_id)->is_graduate)
|
332
|
|
- {
|
333
|
|
- $colapso=array(1=>array(),3=>array(),2=>array(11),12=>array(7,14),10=>array(),4=>array(6,15));
|
334
|
|
- }
|
335
|
|
- else
|
336
|
|
- {
|
337
|
|
- $colapso=array(10=>array(),1=>array(),12=>array(7),3=>array(9,8,14),2=>array(11),5=>array(),4=>array(6,13),16=>array());
|
338
|
|
- }
|
339
|
|
-
|
340
|
|
- $resultados_todos_colap[$program_id]=array();
|
341
|
|
- foreach($colapso as $out=>$pares)
|
342
|
|
- {
|
343
|
|
- $resultados_todos_colap[$program_id][$out]["semesters"]=array();
|
344
|
|
- if(isset($resultados_todos[$program_id][$out]))
|
345
|
|
- $resultados_todos_colap[$program_id][$out]=$resultados_todos[$program_id][$out];
|
346
|
|
- else $resultados_todos_colap[$program_id][$out]=array();
|
347
|
|
- foreach($pares as $par)
|
348
|
|
- {
|
349
|
|
- if(isset($resultados_todos[$program_id][$par]))
|
350
|
|
- {
|
351
|
|
-// unset($resultados_todos[$program_id][$par]['semesters']);
|
352
|
|
-
|
353
|
|
- foreach($resultados_todos[$program_id][$par] as $estu => $resus)
|
354
|
|
- {
|
355
|
|
- if($estu!="semesters")
|
356
|
|
- {
|
357
|
|
- if(!isset($resultados_todos_colap[$program_id][$out][$estu]))
|
358
|
|
- {
|
359
|
|
- $resultados_todos_colap[$program_id][$out][$estu]['attempted']=0;
|
360
|
|
- $resultados_todos_colap[$program_id][$out][$estu]['achieved']=0;
|
361
|
|
-
|
362
|
|
- }
|
363
|
|
- // print $program_id." ".$par." ".$estu."<br>";
|
364
|
|
- // var_dump($resultados_todos[$program_id][$par][$estu]);
|
365
|
|
- $resultados_todos_colap[$program_id][$out][$estu]['attempted']+=$resultados_todos[$program_id][$par][$estu]['attempted'];
|
366
|
|
- $resultados_todos_colap[$program_id][$out][$estu]['achieved']+=$resultados_todos[$program_id][$par][$estu]['achieved'];
|
367
|
|
- }
|
368
|
|
- else if(isset($resultados_todos[$program_id][$par]["semesters"]))
|
369
|
|
- {
|
370
|
|
- if(isset($resultados_todos_colap[$program_id][$out]["semesters"]))
|
371
|
|
- {
|
372
|
|
- $tmp=array_merge($resultados_todos_colap[$program_id][$out]["semesters"],$resultados_todos[$program_id][$par]["semesters"]);
|
373
|
|
-// var_dump(($tmp));
|
374
|
|
-// var_dump(array_unique($tmp));
|
375
|
|
-// exit();
|
376
|
|
-
|
377
|
|
- $resultados_todos_colap[$program_id][$out]["semesters"]=array_unique($tmp);
|
378
|
|
- }
|
379
|
|
- else
|
380
|
|
- $resultados_todos_colap[$program_id][$out]["semesters"]=array_unique($resultados_todos[$program_id][$par]["semesters"]);
|
381
|
|
- }
|
382
|
|
- }
|
383
|
|
- }
|
384
|
|
- }
|
385
|
|
-
|
386
|
|
- }
|
387
|
|
-// var_dump($resultados_todos_colap);
|
388
|
|
-
|
389
|
|
- $outcomes_attempted_colap[$program_id]=array();
|
390
|
|
- $outcomes_achieved_colap[$program_id]=array();
|
391
|
|
- $outcomes_attempted_colap_semesters[$program_id]=array();
|
392
|
|
-// print $program_id."<br>";
|
393
|
|
-// var_dump($resultados_todos_colap[$program_id]);
|
394
|
|
-// print "<br>";
|
395
|
|
- foreach($resultados_todos_colap[$program_id] as $out=>$datos_out)
|
396
|
|
- {
|
397
|
|
- if(!$i)$outcomes_colap[]=Outcome::find($out);
|
398
|
|
-// $outcomes_attempted_colap_semesters[$program_id][$out]=array();
|
399
|
|
- if(isset($datos_out['semesters']))
|
400
|
|
- {
|
401
|
|
- $outcomes_attempted_colap_semesters[$program_id][$out]=$datos_out['semesters'];
|
402
|
|
- unset($datos_out['semesters']);
|
403
|
|
- }
|
404
|
|
- foreach($datos_out as $res)
|
405
|
|
- {
|
406
|
|
- if(!isset($outcomes_attempted_colap[$program_id][$out]))
|
407
|
|
- {
|
408
|
|
- $outcomes_attempted_colap[$program_id][$out]=0;
|
409
|
|
- $outcomes_achieved_colap[$program_id][$out]=0;
|
410
|
|
-
|
411
|
|
- }
|
412
|
|
- $outcomes_attempted_colap[$program_id][$out]++;
|
413
|
|
- if(3*$res['achieved']>=2*$res['attempted'])
|
414
|
|
- $outcomes_achieved_colap[$program_id][$out]++;
|
415
|
|
- }
|
416
|
|
- if(empty($datos_out))
|
417
|
|
- {
|
418
|
|
- $outcomes_attempted_colap[$program_id][$out]=0;
|
419
|
|
- $outcomes_achieved_colap[$program_id][$out]=0;
|
420
|
|
- }
|
421
|
|
-
|
422
|
|
- }
|
423
|
|
- $i++;
|
424
|
|
- }
|
425
|
|
- usort($outcomes_colap, array($this, "cmp"));
|
426
|
|
- // var_dump($outcomes_attempted_colap); print "<br>";
|
427
|
|
- // var_dump($outcomes_achieved_colap); print "<br>";
|
428
|
|
- // exit();
|
429
|
|
- $outcomes_attempted_colap_todo=array();
|
430
|
|
- $outcomes_achieved_colap_todo=array();
|
431
|
|
- foreach($outcomes_attempted_colap as $program_id => $out_res)
|
432
|
|
- {
|
433
|
|
- foreach($out_res as $out=>$res)
|
434
|
|
- {
|
435
|
|
- if(!isset($outcomes_attempted_colap_todo[$out]))
|
436
|
|
- {
|
437
|
|
- $outcomes_attempted_colap_todo[$out]=0;
|
438
|
|
- $outcomes_achieved_colap_todo[$out]=0;
|
439
|
|
-
|
440
|
|
- }
|
441
|
|
- $outcomes_attempted_colap_todo[$out]+=$outcomes_attempted_colap[$program_id][$out];
|
442
|
|
- $outcomes_achieved_colap_todo[$out]+=$outcomes_achieved_colap[$program_id][$out];
|
443
|
|
-
|
444
|
|
-
|
445
|
|
- }
|
446
|
|
-
|
447
|
|
- }
|
448
|
|
- $outcomes_attempted_todo=array();
|
449
|
|
- $outcomes_achieved_todo=array();
|
450
|
|
- foreach($outcomes_attempted as $program_id => $out_res)
|
451
|
|
- {
|
452
|
|
- foreach($out_res as $out=>$res)
|
453
|
|
- {
|
454
|
|
- if(!isset($outcomes_attempted_todo[$out]))
|
455
|
|
- {
|
456
|
|
- $outcomes_attempted_todo[$out]=0;
|
457
|
|
- $outcomes_achieved_todo[$out]=0;
|
458
|
|
-
|
459
|
|
- }
|
460
|
|
- $outcomes_attempted_todo[$out]+=$outcomes_attempted[$program_id][$out];
|
461
|
|
- $outcomes_achieved_todo[$out]+=$outcomes_achieved[$program_id][$out];
|
462
|
|
-
|
463
|
|
-
|
464
|
|
- }
|
465
|
|
-
|
466
|
|
- }
|
467
|
|
-
|
468
|
|
-
|
469
|
|
- return View::make('local.managers.shared.school_student_result', compact('title','outcomes_attempted_colap_semesters','outcomes_attempted_semesters','outcomes_attempted_colap_todo','outcomes_achieved_colap_todo','outcomes_attempted_todo','outcomes_achieved_todo','school','programs_name','role','outcomes','outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users','program_courses','grouped_courses'));
|
|
520
|
+ $role = Auth::user()->role;
|
|
521
|
+
|
|
522
|
+ $users = array();
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+ $resultados_todos_obj = DB::table('assessments')
|
|
526
|
+ ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
|
|
527
|
+ ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
|
|
528
|
+ ->join('courses', 'courses.id', '=', 'activities.course_id')
|
|
529
|
+ ->join('students', 'students.id', '=', 'assessments.student_id')
|
|
530
|
+ ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
|
|
531
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
532
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
533
|
+ ->join('semesters', 'semesters.id', '=', 'courses.semester_id')
|
|
534
|
+ ->whereIn('students.program_id', $programs_ids)
|
|
535
|
+ ->whereIn('semester_id', Session::get('semesters_ids'))
|
|
536
|
+ ->where('semesters.is_visible', '=', 1)
|
|
537
|
+ ->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
|
|
538
|
+ ->distinct()
|
|
539
|
+ ->get();
|
|
540
|
+
|
|
541
|
+ foreach ($resultados_todos_obj as $resultado) {
|
|
542
|
+ if (!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'])) {
|
|
543
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'] = array();
|
|
544
|
+ }
|
|
545
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'][] = $resultado->code;
|
|
546
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'] = array_unique($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']);
|
|
547
|
+ if (!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted'])) {
|
|
548
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted'] = 0;
|
|
549
|
+ }
|
|
550
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']++;
|
|
551
|
+
|
|
552
|
+ if (!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved'])) {
|
|
553
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved'] = 0;
|
|
554
|
+ }
|
|
555
|
+ if ($resultado->score >= $resultado->expected_points) {
|
|
556
|
+ $resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']++;
|
|
557
|
+ }
|
|
558
|
+ }
|
|
559
|
+
|
|
560
|
+ $outcomes_colap = array();
|
|
561
|
+ $programs = array();
|
|
562
|
+ // $outcomes_colap=array();
|
|
563
|
+ $i = 0;
|
|
564
|
+ $outcomes_attempted = array();
|
|
565
|
+ $outcomes_attempted_colap = array();
|
|
566
|
+ $outcomes_achieved_colap = array();
|
|
567
|
+ $outcomes_attempted_semesters = array();
|
|
568
|
+ foreach ($resultados_todos as $program_id => $resultados_prog) {
|
|
569
|
+ $outcomes_attempted_semesters[$program_id] = array();
|
|
570
|
+ foreach ($resultados_prog as $out => $datos_out) {
|
|
571
|
+ $outcomes_achieved[$program_id][$out] = 0;
|
|
572
|
+ $outcomes_attempted[$program_id][$out] = 0;
|
|
573
|
+ // var_dump($datos_out);outcomes_attempted_semesters
|
|
574
|
+ $outcomes_attempted_semesters[$program_id][$out] = $datos_out['semesters'];
|
|
575
|
+ unset($datos_out['semesters']);
|
|
576
|
+ // var_dump($outcomes_attempted_semesters[$program_id][$out]);
|
|
577
|
+ // var_dump($datos_out);
|
|
578
|
+ // exit();
|
|
579
|
+ foreach ($datos_out as $res) {
|
|
580
|
+ $outcomes_attempted[$program_id][$out]++;
|
|
581
|
+ if (3 * $res['achieved'] >= 2 * $res['attempted'])
|
|
582
|
+ $outcomes_achieved[$program_id][$out]++;
|
|
583
|
+ }
|
|
584
|
+ }
|
|
585
|
+ $programs[] = Program::find($program_id);
|
|
586
|
+ if (Program::find($program_id)->is_graduate) {
|
|
587
|
+ $colapso = array(1 => array(), 3 => array(), 2 => array(11), 12 => array(7, 14), 10 => array(), 4 => array(6, 15));
|
|
588
|
+ } else {
|
|
589
|
+ $colapso = array(10 => array(), 1 => array(), 12 => array(7), 3 => array(9, 8, 14), 2 => array(11), 5 => array(), 4 => array(6, 13), 16 => array());
|
|
590
|
+ }
|
|
591
|
+
|
|
592
|
+ $resultados_todos_colap[$program_id] = array();
|
|
593
|
+ foreach ($colapso as $out => $pares) {
|
|
594
|
+ $resultados_todos_colap[$program_id][$out]["semesters"] = array();
|
|
595
|
+ if (isset($resultados_todos[$program_id][$out]))
|
|
596
|
+ $resultados_todos_colap[$program_id][$out] = $resultados_todos[$program_id][$out];
|
|
597
|
+ else $resultados_todos_colap[$program_id][$out] = array();
|
|
598
|
+ foreach ($pares as $par) {
|
|
599
|
+ if (isset($resultados_todos[$program_id][$par])) {
|
|
600
|
+ // unset($resultados_todos[$program_id][$par]['semesters']);
|
|
601
|
+
|
|
602
|
+ foreach ($resultados_todos[$program_id][$par] as $estu => $resus) {
|
|
603
|
+ if ($estu != "semesters") {
|
|
604
|
+ if (!isset($resultados_todos_colap[$program_id][$out][$estu])) {
|
|
605
|
+ $resultados_todos_colap[$program_id][$out][$estu]['attempted'] = 0;
|
|
606
|
+ $resultados_todos_colap[$program_id][$out][$estu]['achieved'] = 0;
|
|
607
|
+ }
|
|
608
|
+ // print $program_id." ".$par." ".$estu."<br>";
|
|
609
|
+ // var_dump($resultados_todos[$program_id][$par][$estu]);
|
|
610
|
+ $resultados_todos_colap[$program_id][$out][$estu]['attempted'] += $resultados_todos[$program_id][$par][$estu]['attempted'];
|
|
611
|
+ $resultados_todos_colap[$program_id][$out][$estu]['achieved'] += $resultados_todos[$program_id][$par][$estu]['achieved'];
|
|
612
|
+ } else if (isset($resultados_todos[$program_id][$par]["semesters"])) {
|
|
613
|
+ if (isset($resultados_todos_colap[$program_id][$out]["semesters"])) {
|
|
614
|
+ $tmp = array_merge($resultados_todos_colap[$program_id][$out]["semesters"], $resultados_todos[$program_id][$par]["semesters"]);
|
|
615
|
+ // var_dump(($tmp));
|
|
616
|
+ // var_dump(array_unique($tmp));
|
|
617
|
+ // exit();
|
|
618
|
+
|
|
619
|
+ $resultados_todos_colap[$program_id][$out]["semesters"] = array_unique($tmp);
|
|
620
|
+ } else
|
|
621
|
+ $resultados_todos_colap[$program_id][$out]["semesters"] = array_unique($resultados_todos[$program_id][$par]["semesters"]);
|
|
622
|
+ }
|
|
623
|
+ }
|
|
624
|
+ }
|
|
625
|
+ }
|
|
626
|
+ }
|
|
627
|
+ // var_dump($resultados_todos_colap);
|
|
628
|
+
|
|
629
|
+ $outcomes_attempted_colap[$program_id] = array();
|
|
630
|
+ $outcomes_achieved_colap[$program_id] = array();
|
|
631
|
+ $outcomes_attempted_colap_semesters[$program_id] = array();
|
|
632
|
+ // print $program_id."<br>";
|
|
633
|
+ // var_dump($resultados_todos_colap[$program_id]);
|
|
634
|
+ // print "<br>";
|
|
635
|
+ foreach ($resultados_todos_colap[$program_id] as $out => $datos_out) {
|
|
636
|
+ if (!$i) $outcomes_colap[] = Outcome::find($out);
|
|
637
|
+ // $outcomes_attempted_colap_semesters[$program_id][$out]=array();
|
|
638
|
+ if (isset($datos_out['semesters'])) {
|
|
639
|
+ $outcomes_attempted_colap_semesters[$program_id][$out] = $datos_out['semesters'];
|
|
640
|
+ unset($datos_out['semesters']);
|
|
641
|
+ }
|
|
642
|
+ foreach ($datos_out as $res) {
|
|
643
|
+ if (!isset($outcomes_attempted_colap[$program_id][$out])) {
|
|
644
|
+ $outcomes_attempted_colap[$program_id][$out] = 0;
|
|
645
|
+ $outcomes_achieved_colap[$program_id][$out] = 0;
|
|
646
|
+ }
|
|
647
|
+ $outcomes_attempted_colap[$program_id][$out]++;
|
|
648
|
+ if (3 * $res['achieved'] >= 2 * $res['attempted'])
|
|
649
|
+ $outcomes_achieved_colap[$program_id][$out]++;
|
|
650
|
+ }
|
|
651
|
+ if (empty($datos_out)) {
|
|
652
|
+ $outcomes_attempted_colap[$program_id][$out] = 0;
|
|
653
|
+ $outcomes_achieved_colap[$program_id][$out] = 0;
|
|
654
|
+ }
|
|
655
|
+ }
|
|
656
|
+ $i++;
|
|
657
|
+ }
|
|
658
|
+ usort($outcomes_colap, array($this, "cmp"));
|
|
659
|
+ // var_dump($outcomes_attempted_colap); print "<br>";
|
|
660
|
+ // var_dump($outcomes_achieved_colap); print "<br>";
|
|
661
|
+ // exit();
|
|
662
|
+ $outcomes_attempted_colap_todo = array();
|
|
663
|
+ $outcomes_achieved_colap_todo = array();
|
|
664
|
+ foreach ($outcomes_attempted_colap as $program_id => $out_res) {
|
|
665
|
+ foreach ($out_res as $out => $res) {
|
|
666
|
+ if (!isset($outcomes_attempted_colap_todo[$out])) {
|
|
667
|
+ $outcomes_attempted_colap_todo[$out] = 0;
|
|
668
|
+ $outcomes_achieved_colap_todo[$out] = 0;
|
|
669
|
+ }
|
|
670
|
+ $outcomes_attempted_colap_todo[$out] += $outcomes_attempted_colap[$program_id][$out];
|
|
671
|
+ $outcomes_achieved_colap_todo[$out] += $outcomes_achieved_colap[$program_id][$out];
|
|
672
|
+ }
|
|
673
|
+ }
|
|
674
|
+ $outcomes_attempted_todo = array();
|
|
675
|
+ $outcomes_achieved_todo = array();
|
|
676
|
+ foreach ($outcomes_attempted as $program_id => $out_res) {
|
|
677
|
+ foreach ($out_res as $out => $res) {
|
|
678
|
+ if (!isset($outcomes_attempted_todo[$out])) {
|
|
679
|
+ $outcomes_attempted_todo[$out] = 0;
|
|
680
|
+ $outcomes_achieved_todo[$out] = 0;
|
|
681
|
+ }
|
|
682
|
+ $outcomes_attempted_todo[$out] += $outcomes_attempted[$program_id][$out];
|
|
683
|
+ $outcomes_achieved_todo[$out] += $outcomes_achieved[$program_id][$out];
|
|
684
|
+ }
|
|
685
|
+ }
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+ return View::make('local.managers.shared.school_student_result', compact('title', 'outcomes_attempted_colap_semesters', 'outcomes_attempted_semesters', 'outcomes_attempted_colap_todo', 'outcomes_achieved_colap_todo', 'outcomes_attempted_todo', 'outcomes_achieved_todo', 'school', 'programs_name', 'role', 'outcomes', 'outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users', 'program_courses', 'grouped_courses'));
|
470
|
689
|
}
|
471
|
690
|
|
472
|
691
|
public function showQuasiOri($id)
|
|
@@ -916,4 +1135,4 @@ class SchoolsController extends \BaseController
|
916
|
1135
|
|
917
|
1136
|
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'));
|
918
|
1137
|
}
|
919
|
|
-}
|
|
1138
|
+}
|