|
@@ -80,6 +80,8 @@ class Course extends Eloquent
|
80
|
80
|
// SELECT distinct cr.outcome_id FROM courses c, activities a, activity_criterion ac, criteria cr WHERE c.id=a.course_id and a.id=ac.activity_id and ac.criterion_id=cr.id and c.id=1
|
81
|
81
|
// return $this->id;
|
82
|
82
|
}
|
|
83
|
+
|
|
84
|
+
|
83
|
85
|
public function outcomes_att()
|
84
|
86
|
{
|
85
|
87
|
$criteria_attempted = DB::table('courses')
|
|
@@ -111,6 +113,48 @@ class Course extends Eloquent
|
111
|
113
|
return $outcomes_attempted;
|
112
|
114
|
}
|
113
|
115
|
|
|
116
|
+ public function getReportObject()
|
|
117
|
+ {
|
|
118
|
+ $reportObject = new stdClass();
|
|
119
|
+
|
|
120
|
+ $reportObject->criteriaReport = DB::table('courses')
|
|
121
|
+ ->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
122
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
123
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
124
|
+ ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
|
|
125
|
+ ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
|
|
126
|
+ ->join('assessments', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
|
|
127
|
+ ->select(DB::raw(
|
|
128
|
+ "count(assessments.score) as assessed,
|
|
129
|
+ count(case when assessments.score >= rubrics.expected_points then 1 else NULL end) as achieved,
|
|
130
|
+ criteria.*"
|
|
131
|
+ ))
|
|
132
|
+ ->where('courses.id', $this->id)
|
|
133
|
+ ->groupBy('criteria.id')
|
|
134
|
+ ->get();
|
|
135
|
+ Log::info($this->id);
|
|
136
|
+ $reportObject->outcomesReport = DB::table('courses')
|
|
137
|
+ ->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
138
|
+ ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
|
|
139
|
+ ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
|
|
140
|
+ ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
|
|
141
|
+ ->join('assessments', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
|
|
142
|
+ ->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
|
|
143
|
+ ->join('outcomes', 'criterion_objective_outcome.outcome_id', '=', 'outcomes.id')
|
|
144
|
+ ->select(
|
|
145
|
+ DB::raw(
|
|
146
|
+ "student_id, outcomes.name, outcomes.id,
|
|
147
|
+ count(activity_criterion.criterion_id) as attempted,
|
|
148
|
+ count(case when assessments.score >= rubrics.expected_points then 1 else null end) as achieved"
|
|
149
|
+ )
|
|
150
|
+ )
|
|
151
|
+ ->where('courses.id', $this->id)
|
|
152
|
+ ->groupBy(array('outcome_id', 'student_id'))
|
|
153
|
+ ->get();
|
|
154
|
+
|
|
155
|
+ return $reportObject;
|
|
156
|
+ }
|
|
157
|
+
|
114
|
158
|
public function outcomes_ach()
|
115
|
159
|
{
|
116
|
160
|
$criteria = DB::table('criteria')
|