|
@@ -13,17 +13,17 @@ class ProfessorsController extends \BaseController
|
13
|
13
|
public function overview()
|
14
|
14
|
{
|
15
|
15
|
$title = 'My Courses';
|
16
|
|
- $grouped_courses = Course::where('user_id', Auth::user()->id)->whereIn('semester_id', Session::get('semesters_ids'))->groupBy(array('code', 'number', 'semester_id'))->get();
|
|
16
|
+ $grouped_courses = Course::with('program')->where('user_id', Auth::user()->id)->whereIn('semester_id', Session::get('semesters_ids'))->groupBy(array('code', 'number', 'semester_id'))->get();
|
17
|
17
|
$semesters = Session::get('semesters_ids');
|
18
|
18
|
$semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
|
19
|
19
|
Log::info($semesters->start);
|
20
|
|
- $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
|
|
20
|
+ $outcomes = Outcome::select(array('id', 'name', 'expected_outcome', 'level'))
|
21
|
21
|
->whereNull('deleted_at')
|
22
|
22
|
->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
|
23
|
23
|
->orderBy('name', 'ASC')->get();
|
24
|
24
|
$outcomeCount = count($outcomes);
|
25
|
25
|
|
26
|
|
-
|
|
26
|
+Log::info($grouped_courses);
|
27
|
27
|
$grouped_outcomes_achieved_results = array();
|
28
|
28
|
$grouped_outcomes_attempted_results = array();
|
29
|
29
|
$grouped_sections = array();
|
|
@@ -38,13 +38,16 @@ class ProfessorsController extends \BaseController
|
38
|
38
|
$outcomes_attempted = [];
|
39
|
39
|
|
40
|
40
|
// Find sections belonging to user with identifier of one course
|
41
|
|
- $sections = Course::where('user_id', Auth::user()->id)
|
|
41
|
+ $sections = Course::with('program')
|
|
42
|
+ ->where('user_id', Auth::user()->id)
|
42
|
43
|
->where('code', $grouped_course->code)
|
43
|
44
|
->whereIn('semester_id', Session::get('semesters_ids'))
|
44
|
45
|
->where('number', $grouped_course->number)
|
45
|
46
|
->where('semester_id', $grouped_course->semester_id)
|
46
|
47
|
->get();
|
47
|
48
|
|
|
49
|
+// Log::info($sections);
|
|
50
|
+
|
48
|
51
|
// For each of the professor's course sections, add the attempted and achieved criteria per outcome
|
49
|
52
|
foreach ($sections as $section) {
|
50
|
53
|
|
|
@@ -94,12 +97,15 @@ class ProfessorsController extends \BaseController
|
94
|
97
|
$program_courses = Course::where('program_id', '=', $program->id)->whereIn('semester_id', Session::get('semesters_ids'))->get();
|
95
|
98
|
$semesters = Session::get('semesters_ids');
|
96
|
99
|
$semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
|
97
|
|
-
|
98
|
|
- $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
|
99
|
|
- ->whereNull('deleted_at')
|
100
|
|
- ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
|
101
|
|
- ->orderBy('name', 'ASC')->get();
|
102
|
|
- $outcomeCount = count($outcomes);
|
|
100
|
+ $semesters2 = Semester::whereIn('id',Session::get('semesters_ids'))->get();
|
|
101
|
+
|
|
102
|
+// $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
|
|
103
|
+// ->where('level','=',)
|
|
104
|
+// ->whereNull('deleted_at')
|
|
105
|
+// ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
|
|
106
|
+// ->orderBy('name', 'ASC')->get();
|
|
107
|
+ $outcomes = Outcome::active_by_semesters($semesters2, $program->is_graduate);
|
|
108
|
+ $outcomeCount = count($outcomes);
|
103
|
109
|
$outcomes_achieved = [];
|
104
|
110
|
$outcomes_attempted = [];
|
105
|
111
|
|