|
@@ -45,7 +45,8 @@ class SchoolsController extends \BaseController
|
45
|
45
|
|
46
|
46
|
|
47
|
47
|
$grad_grouped_courses = Course::
|
48
|
|
- select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
|
|
48
|
+// select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
|
|
49
|
+ select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
|
49
|
50
|
->with('semester')
|
50
|
51
|
->with('program')
|
51
|
52
|
->whereIn('courses.program_id', $program_ids)
|
|
@@ -59,7 +60,8 @@ class SchoolsController extends \BaseController
|
59
|
60
|
->get();
|
60
|
61
|
|
61
|
62
|
$undergrad_grouped_courses = Course::
|
62
|
|
- select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
|
|
63
|
+// select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
|
|
64
|
+ select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
|
63
|
65
|
->with('semester')
|
64
|
66
|
->with('program')
|
65
|
67
|
->whereIn('courses.program_id', $program_ids)
|
|
@@ -153,7 +155,7 @@ class SchoolsController extends \BaseController
|
153
|
155
|
{
|
154
|
156
|
// For each program with courses that do assessment
|
155
|
157
|
$programs_with_courses = Program::with(array('courses' => function($query){
|
156
|
|
- $query->whereNotNull('outcomes_attempted');
|
|
158
|
+// $query->whereNotNull('outcomes_attempted');
|
157
|
159
|
$query->whereIn('semester_id', Session::get('semesters_ids'));
|
158
|
160
|
}))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
|
159
|
161
|
|
|
@@ -170,9 +172,11 @@ class SchoolsController extends \BaseController
|
170
|
172
|
foreach ($program->courses as $course)
|
171
|
173
|
{
|
172
|
174
|
// If the outcome in question is being evaluated
|
173
|
|
- $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
|
174
|
|
- $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
|
175
|
|
- if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
|
|
175
|
+ $course_outcomes_attempted2 = $course->outcomes_att();
|
|
176
|
+// $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
|
|
177
|
+// $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
|
|
178
|
+ $course_outcomes_achieved2 = $course->outcomes_ach();
|
|
179
|
+ if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
|
176
|
180
|
&& $course_outcomes_attempted2[$outcome->id]>0)
|
177
|
181
|
{
|
178
|
182
|
$achieved_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
|
|
@@ -225,7 +229,7 @@ class SchoolsController extends \BaseController
|
225
|
229
|
{
|
226
|
230
|
// For each program with courses that do assessment
|
227
|
231
|
$programs_with_courses = Program::with(array('courses' => function($query){
|
228
|
|
- $query->whereNotNull('outcomes_attempted');
|
|
232
|
+// $query->whereNotNull('outcomes_attempted');
|
229
|
233
|
$query->whereIn('semester_id', Session::get('semesters_ids'));
|
230
|
234
|
}))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
|
231
|
235
|
|
|
@@ -242,9 +246,11 @@ class SchoolsController extends \BaseController
|
242
|
246
|
foreach ($program->courses as $course)
|
243
|
247
|
{
|
244
|
248
|
// If the outcome in question is being evaluated
|
245
|
|
- $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
|
246
|
|
- $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
|
247
|
|
- if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
|
|
249
|
+// $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
|
|
250
|
+ $course_outcomes_attempted2 = ($course->outcomes_att());
|
|
251
|
+ $course_outcomes_achieved2 = ($course->outcomes_ach());
|
|
252
|
+// $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
|
|
253
|
+ if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
|
248
|
254
|
&& $course_outcomes_attempted2[$outcome->id]>0)
|
249
|
255
|
{
|
250
|
256
|
$achieved_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
|
|
@@ -298,7 +304,8 @@ class SchoolsController extends \BaseController
|
298
|
304
|
$program_ids= $school->programs->lists('id');
|
299
|
305
|
|
300
|
306
|
$grouped_courses = Course::
|
301
|
|
- select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
|
|
307
|
+// select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
|
|
308
|
+ select(DB::raw('name, code, number, semester_id, program_id'))
|
302
|
309
|
->with('semester')
|
303
|
310
|
->with('program')
|
304
|
311
|
->whereIn('program_id', $program_ids)
|
|
@@ -359,7 +366,7 @@ class SchoolsController extends \BaseController
|
359
|
366
|
{
|
360
|
367
|
// For each program with courses that do assessment
|
361
|
368
|
foreach (Program::with(array('courses' => function($query){
|
362
|
|
- $query->whereNotNull('outcomes_attempted');
|
|
369
|
+// $query->whereNotNull('outcomes_attempted');
|
363
|
370
|
$query->whereIn('semester_id', Session::get('semesters_ids'));
|
364
|
371
|
}))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program)
|
365
|
372
|
{
|