Gabriel Santiago Plaza преди 2 години
родител
ревизия
68854b022f
променени са 2 файла, в които са добавени 17 реда и са изтрити 4 реда
  1. 6
    2
      app/models/Objective.php
  2. 11
    2
      app/views/local/managers/shared/annual_report.blade.php

+ 6
- 2
app/models/Objective.php Целия файл

@@ -41,7 +41,11 @@ class Objective extends Eloquent
41 41
         //$course_codes['studentPerOutcome'] = array();
42 42
 
43 43
         foreach ($course_codes as $course_code) {
44
-
44
+            $course_code->transforming_actions = DB::table('annual_plan_transformative')
45
+                ->join('transformative_actions', 'transformative_actions.id', '=', 'annual_plan_transformative.trans_id')
46
+                ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
47
+                ->select('transformative_actions.*')
48
+                ->get();
45 49
             $course_code->students = Course::getStudentReportForOutcome($course_code);
46 50
             Log::info(array($course_code));
47 51
             $course_code->criteria = Course::getCriteriaPlanReport($course_code);
@@ -67,4 +71,4 @@ class Objective extends Eloquent
67 71
     {
68 72
         return $this->hasMany('Objective_Outcome', 'objective_id');
69 73
     }
70
-}
74
+}

+ 11
- 2
app/views/local/managers/shared/annual_report.blade.php Целия файл

@@ -184,7 +184,7 @@ $(document).ready(function()
184 184
                 if(objective.courses){
185 185
                   $.each(objective.courses, function(index, course_code){
186 186
                     if(course_code.criteria.length){
187
-                      
187
+                    
188 188
                       $.each(course_code.students, function(index, student){
189 189
                         if(wholeDict[student.student_id] === undefined){
190 190
                           wholeDict[student.student_id] = { 'student':student.student_id, 
@@ -213,7 +213,16 @@ $(document).ready(function()
213 213
                         tbody.append(tr);
214 214
                       });
215 215
                       table.append(tbody);
216
-                      div.append('<h3>'+course_code.code + ' '+ course_code.number+'</h3>')
216
+                      Course_and_transformative = '<h3>'+course_code.code + ' '+ course_code.number+'</h3><hr>';
217
+                      if(course_code.transforming_actions.length){
218
+                        Course_and_transformative += '<h5> This course was tied to the following transformative actions</h5>';
219
+                        Course_and_transformative += '<ol>';
220
+                        $.each(course_code.transforming_actions, function(index, transformative_action){
221
+                          Course_and_transformative += '<li><p><strong>'+transformative_action.at_text+'</strong>: '+transformative_action.description+'</p></li>'
222
+                        })
223
+                      }
224
+
225
+                      div.append(Course_and_transformative)
217 226
                       div.append(table);
218 227
                       table.DataTable();
219 228