Browse Source

un push ultimo

parent
commit
f5674dbb44

+ 44
- 7
app/controllers/AnnualPlansController.php View File

45
     $program = Program::find($program_id);
45
     $program = Program::find($program_id);
46
     $title = "Annual Plans for " . $program->name;
46
     $title = "Annual Plans for " . $program->name;
47
 
47
 
48
-    $annual_plans = DB::select("select semester_start, semester_end, program_id, annual_plans.id, academic_year from annual_plans, annual_cycle   where annual_plans.annual_cycle_id = annual_cycle.id and program_id ={$program_id} order by id desc");
48
+    $annual_plans = DB::select("select semester_start, semester_end, program_id, annual_plans.id, academic_year from annual_plans, annual_cycle   where annual_plans.annual_cycle_id = annual_cycle.id and program_id ={$program_id} order by semester_start desc");
49
 
49
 
50
 
50
 
51
     return View::make('local.managers.shared.view-annual-plans', compact('title', 'program_id', 'annual_plans'));
51
     return View::make('local.managers.shared.view-annual-plans', compact('title', 'program_id', 'annual_plans'));
156
     $annual_plans = DB::table('annual_cycle')
156
     $annual_plans = DB::table('annual_cycle')
157
       ->join('annual_plans', 'annual_cycle_id', '=', 'annual_cycle.id')
157
       ->join('annual_plans', 'annual_cycle_id', '=', 'annual_cycle.id')
158
       ->where('program_id', $program_id)
158
       ->where('program_id', $program_id)
159
-      ->orderBy('semester_start')
159
+      ->orderBy('semester_start', 'desc')
160
       ->get();
160
       ->get();
161
     /*$annual_plans = DB::select("
161
     /*$annual_plans = DB::select("
162
     
162
     
196
     }*/
196
     }*/
197
     //$alltyp = DB::select('select * from three_year_plan order by id desc');
197
     //$alltyp = DB::select('select * from three_year_plan order by id desc');
198
     //$current_typ = $current_typ->id;
198
     //$current_typ = $current_typ->id;
199
+
199
     return View::make('local.managers.shared.annual-plans', compact('title', 'annual_plans', 'current_typ', 'program', 'outcomes', 'allSemesterOrder', 'alltyp'));
200
     return View::make('local.managers.shared.annual-plans', compact('title', 'annual_plans', 'current_typ', 'program', 'outcomes', 'allSemesterOrder', 'alltyp'));
200
   }
201
   }
201
 
202
 
214
 
215
 
215
 
216
 
216
       ->where('program_id', $an_plan->program_id)
217
       ->where('program_id', $an_plan->program_id)
217
-      ->where('semester_id', $an_plan->semester_start)
218
+      ->where(function ($query) use (&$an_plan) {
219
+        $query->where('semester_id', $an_plan->semester_start)
220
+          ->orWhere('semester_id', $an_plan->semester_end);
221
+      })
218
       ->select('typ_program.*')
222
       ->select('typ_program.*')
219
       ->first();
223
       ->first();
220
     Log::info(array($an_plan));
224
     Log::info(array($an_plan));
225
 
229
 
226
     $json_to_send = [];
230
     $json_to_send = [];
227
     $json_to_send["annual_plans"] = $an_plan;
231
     $json_to_send["annual_plans"] = $an_plan;
228
-    $json_to_send["outcomes"]["first"] = DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id = {$an_plan->semester_start} and typ_program_id = {$current_typ_program->id})");
232
+
233
+    $json_to_send["outcomes"]["first"] = DB::table('outcomes')
234
+      ->join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
235
+      ->where('semester_id', $an_plan->semester_start)
236
+      ->where('typ_program_id', $current_typ_program->id)
237
+      ->select('outcomes.*', 'typ_semester_outcome.id as typ_semester_outcome_id')
238
+      ->get();
239
+
240
+    //DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id = {$an_plan->semester_start} and typ_program_id = {$current_typ_program->id})");
229
     $json_to_send["allSemesterOrder"]["first"] = DB::select("select * from semesters where id = {$an_plan->semester_start}")[0];
241
     $json_to_send["allSemesterOrder"]["first"] = DB::select("select * from semesters where id = {$an_plan->semester_start}")[0];
230
-    $json_to_send["outcomes"]["second"] = DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id ={$an_plan->semester_end} and typ_program_id  = {$current_typ_program->id})");
242
+    $json_to_send["outcomes"]["second"] = DB::table('outcomes')
243
+      ->join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
244
+      ->where('semester_id', $an_plan->semester_end)
245
+      ->where('typ_program_id', $current_typ_program->id)
246
+      ->select('outcomes.*', 'typ_semester_outcome.id as typ_semester_outcome_id')
247
+      ->get();
248
+
249
+    //DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id ={$an_plan->semester_end} and typ_program_id  = {$current_typ_program->id})");
250
+
251
+
252
+
231
     $json_to_send["allSemesterOrder"]["second"] = DB::select("select * from semesters where id = {$an_plan->semester_end}")[0];
253
     $json_to_send["allSemesterOrder"]["second"] = DB::select("select * from semesters where id = {$an_plan->semester_end}")[0];
232
     return json_encode($json_to_send);
254
     return json_encode($json_to_send);
233
   }
255
   }
244
     $typ_info = array();
266
     $typ_info = array();
245
     $semester = DB::select("select * from semesters where id=?", array(Input::get('semester')))[0];
267
     $semester = DB::select("select * from semesters where id=?", array(Input::get('semester')))[0];
246
 
268
 
247
-
269
+    $typ_semester_outcome_id = Input::get('typ_semester_outcome_id');
248
     //$typ_info['courses'] = DB::select("select * from courses where id in (select course_id from typ_semester_courses where typ_semester_outcome_id in (select id from typ_semester_outcome where semester_id ={$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id} )and outcome_id = ?))", array(Input::get('id')));
270
     //$typ_info['courses'] = DB::select("select * from courses where id in (select course_id from typ_semester_courses where typ_semester_outcome_id in (select id from typ_semester_outcome where semester_id ={$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id} )and outcome_id = ?))", array(Input::get('id')));
249
     //foreach ($typ_info['courses'] as $course) {
271
     //foreach ($typ_info['courses'] as $course) {
250
     //  $typ_info['courses_objective'][$course->id] = DB::select("select * from objectives where id in (select objective_id from typ_semester_objectives where typ_semester_course_id in (select id from typ_semester_courses where typ_semester_outcome_id in (select id from typ_semester_outcome where semester_id = {$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id}))and course_id ={$course->id}))");
272
     //  $typ_info['courses_objective'][$course->id] = DB::select("select * from objectives where id in (select objective_id from typ_semester_objectives where typ_semester_course_id in (select id from typ_semester_courses where typ_semester_outcome_id in (select id from typ_semester_outcome where semester_id = {$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id}))and course_id ={$course->id}))");
321
     $typ_info['annual_plan'] = $annual_plan;
343
     $typ_info['annual_plan'] = $annual_plan;
322
     Log::info($typ_info);
344
     Log::info($typ_info);
323
 
345
 
346
+    $typ_info['transformative_actions_for_outcome'] = DB::table('transformative_actions')
347
+      ->join('transformative_typ_outcome', 'transformative_typ_outcome.trans_id', '=', 'transformative_actions.id')
348
+      ->where('transformative_typ_outcome.typ_semester_outcome_id', $typ_semester_outcome_id)
349
+      ->get();
350
+    $typ_info['categories'] = "<option value='0'>Nothing Selected</option>";
351
+
352
+    $types = DB::table('transformative_actions')
353
+      ->select('type_of_TA')
354
+      ->where('type_of_TA', '<>', '')
355
+      ->distinct()
356
+      ->get();
357
+    foreach ($types as $type) {
358
+      $typ_info['categories'] .= "<option value = '" . $type->type_of_TA . "'>" . $type->type_of_TA . "</option>";
359
+    }
360
+    $typ_info['categories'] .= '<option value ="new"> New Type of Transformative Action</option>';
324
     return json_encode($typ_info);
361
     return json_encode($typ_info);
325
   }
362
   }
326
   public function deleteTA()
363
   public function deleteTA()
639
     $outcome->outcome_program_goal = DB::table('target_outcomes_program')
676
     $outcome->outcome_program_goal = DB::table('target_outcomes_program')
640
       ->where('program_id', $program_id)
677
       ->where('program_id', $program_id)
641
       ->where('semester_id', $semester_id)
678
       ->where('semester_id', $semester_id)
642
-      ->first()->expected_target;
679
+      ->first();
643
 
680
 
644
     foreach ($outcome->objectives as $index => $objective) {
681
     foreach ($outcome->objectives as $index => $objective) {
645
       $objective->courses = Objective::getPlanReport($objective);
682
       $objective->courses = Objective::getPlanReport($objective);

+ 3
- 13
app/controllers/OutcomesController.php View File

1056
         $title = "Program Annual Report";
1056
         $title = "Program Annual Report";
1057
 
1057
 
1058
 
1058
 
1059
-        $annual_plans = $annual_plans = DB::select("
1059
+        $annual_plans = DB::select("
1060
     
1060
     
1061
         select 
1061
         select 
1062
           academic_year, 
1062
           academic_year, 
1068
         from annual_plans 
1068
         from annual_plans 
1069
         join annual_cycle on annual_cycle_id = annual_cycle.id 
1069
         join annual_cycle on annual_cycle_id = annual_cycle.id 
1070
         where program_id = {$program_id} 
1070
         where program_id = {$program_id} 
1071
-        and(
1072
-          semester_start in(
1073
-            select semester_id 
1074
-            from typ_semester_outcome 
1075
-            join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
1076
-            where program_id = {$program_id} )
1077
-          or semester_end in(
1078
-            select semester_id 
1079
-            from typ_semester_outcome 
1080
-            join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
1081
-            where program_id = {$program_id} )
1082
-          )
1071
+        and
1072
+        annual_plans.is_submitted =1
1083
           order by semester_start desc");
1073
           order by semester_start desc");
1084
         $program = DB::table('programs')
1074
         $program = DB::table('programs')
1085
             ->where('id', $program_id)
1075
             ->where('id', $program_id)

+ 8
- 4
app/models/Course.php View File

181
   public static function getStudentReportForOutcome($course_code = null)
181
   public static function getStudentReportForOutcome($course_code = null)
182
   {
182
   {
183
     if ($course_code) {
183
     if ($course_code) {
184
+      Log::info('entré');
184
       $criteria_id = DB::table('annual_plan_objective')
185
       $criteria_id = DB::table('annual_plan_objective')
185
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
186
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
186
         ->lists('criteria_id');
187
         ->lists('criteria_id');
188
+      Log::info($criteria_id);
187
       $program = Program::where('id', $course_code->program_id)->first();
189
       $program = Program::where('id', $course_code->program_id)->first();
188
       // // Log::info($program->code);
190
       // // Log::info($program->code);
189
       if ($program->code == "") {
191
       if ($program->code == "") {
232
 
234
 
233
 
235
 
234
       //Log::info($criteria_id);
236
       //Log::info($criteria_id);
237
+      Log::info('los courseCode');
238
+      Log::info(array($course_code));
239
+      Log::info('los programas');
240
+      Log::info($program_ids);
235
 
241
 
236
-      //Log::info($program_ids);
237
-
238
-      //Log::info($table_per_student->toSql());
242
+      Log::info($table_per_student->toSql());
239
       $students = $table_per_student->get();
243
       $students = $table_per_student->get();
240
 
244
 
241
 
245
 
423
       $query->where('outcomes_attempted', 'not like', '\'%"' . $outcome_id . '":0%\'');
427
       $query->where('outcomes_attempted', 'not like', '\'%"' . $outcome_id . '":0%\'');
424
     }))->where('code', $this->code)->where('number', $this->number)->get();
428
     }))->where('code', $this->code)->where('number', $this->number)->get();
425
   }
429
   }
426
-}
430
+}

+ 1
- 1
app/models/Objective.php View File

71
     {
71
     {
72
         return $this->hasMany('Objective_Outcome', 'objective_id');
72
         return $this->hasMany('Objective_Outcome', 'objective_id');
73
     }
73
     }
74
-}
74
+}

+ 1
- 1
app/views/local/managers/pCoords/_navigation.blade.php View File

69
 
69
 
70
             </li>
70
             </li>
71
             <li><a href="{{ URL::action('OutcomesController@annualReport', Auth::user()->programs[0]->id) }}">Annual
71
             <li><a href="{{ URL::action('OutcomesController@annualReport', Auth::user()->programs[0]->id) }}">Annual
72
-                    Results</a></li>
72
+                    Report</a></li>
73
 
73
 
74
             <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Formative Actions') }}
74
             <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Formative Actions') }}
75
 
75
 

+ 1
- 1
app/views/local/managers/sCoords/_navigation.blade.php View File

52
                         </li>
52
                         </li>
53
 
53
 
54
                     @endif
54
                     @endif
55
-                    <li>{{ HTML::linkAction('AnnualPlansController@selectProgramPlan', 'Annual Results') }}</li>
55
+                    <li>{{ HTML::linkAction('AnnualPlansController@selectProgramPlan', 'Annual Reports') }}</li>
56
                     <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Formative Actions') }}
56
                     <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Formative Actions') }}
57
 
57
 
58
                 </ul>
58
                 </ul>

+ 153
- 4
app/views/local/managers/shared/annual-plans.blade.php View File

65
                                 <tr>
65
                                 <tr>
66
                                     <th>Objectives for courses</th>
66
                                     <th>Objectives for courses</th>
67
                                     <th>Criteria per Course</th>
67
                                     <th>Criteria per Course</th>
68
-                                    <th>Transformative Actions</th>
68
+                                    <th>Transformative Actions to be Implemented</th>
69
                                 </tr>
69
                                 </tr>
70
                             </thead>
70
                             </thead>
71
                             <tbody>
71
                             <tbody>
74
                         </table>
74
                         </table>
75
 
75
 
76
                     </div>
76
                     </div>
77
+                    <hr>
78
+                    <div id='transformative_actions_to_outcome'>
79
+                        
80
+                    </div>
81
+                    <hr>
82
+                    <button class='btn btn-md btn-secondary button-add-objective'
83
+                                onclick='addTransToPlan()'>
84
+                                <span class='glyphicon glyphicon-plus'>
85
+
86
+                                </span>
87
+                                Add another Transformative Action
88
+                            </button>
77
 
89
 
78
                 </div>
90
                 </div>
79
             </div>
91
             </div>
208
             var name = $(li).data('outcome-name');
220
             var name = $(li).data('outcome-name');
209
             var semester = $(li).data('semester-id');
221
             var semester = $(li).data('semester-id');
210
             var annual_plan = $(li).data('annual-plan');
222
             var annual_plan = $(li).data('annual-plan');
223
+            var typ_semester_outcome_id = $(li).data('typ-semester-outcome-id');
211
             $('#expected-outcome').data('semester-id', semester);
224
             $('#expected-outcome').data('semester-id', semester);
212
 
225
 
213
 
226
 
216
             $.post(
229
             $.post(
217
                 "../annual-plan-fetchTYP/{{ $program->id }}", {
230
                 "../annual-plan-fetchTYP/{{ $program->id }}", {
218
                     id: id,
231
                     id: id,
219
-                    semester: semester
232
+                    semester: semester, 
233
+                    typ_semester_outcome_id: typ_semester_outcome_id,
220
                 },
234
                 },
221
 
235
 
222
                 function(json) {
236
                 function(json) {
505
                         }
519
                         }
506
                         table.draw();
520
                         table.draw();
507
 
521
 
522
+                        
523
+                        //transformative actions in outcome
524
+                        
525
+                      
526
+                        
527
+
508
 
528
 
509
                     } else {
529
                     } else {
510
                         $('table').hide();
530
                         $('table').hide();
511
                     }
531
                     }
532
+                    //transformative actions in outcome
533
+                    if(!json.transformative_actions_for_outcome.length){
534
+                        div_for_name = $('<div>',{
535
+                            'class':'form-group',
536
+
537
+                        });
538
+                        input_name = $('<input>', {
539
+                            'class':'form-control',
540
+                            
541
+                            'name':'at_text[]'
542
+                        });
543
+                        div_for_name.html("<label> Name</label>");
544
+                        div_for_name.append(input_name);
545
+                        $('#transformative_actions_to_outcome').append(div_for_name);
546
+
547
+                        div_for_category=$('<div>',{
548
+                            'class':'form-group'
549
+                        }).html('<label>Type of Transformative Action</label>');
550
+
551
+                        select_for_category = $('<select>',{
552
+                            'name':'type_of_ta[]',
553
+                            'class':'form-control selectpicker',
554
+                            'onchange':'checkIfNew(this)'
555
+                        }).html(json.categories);
556
+GlobalTransCategories = json.categories;
557
+                        div_for_category.append(select_for_category);
558
+                        $('#transformative_actions_to_outcome').append(div_for_category);
559
+                        select_for_category.selectpicker('refresh');
560
+                        
512
 
561
 
513
 
562
 
563
+                        div_description = $('<div>',{
564
+                            'class':'form-group',
565
+
566
+                        }).html('<label> Description</label>');
567
+
568
+                        textarea = $('<textarea>', {
569
+                            'class':'form-control',
570
+                            'name':'description[]',
571
+                            'rows':'10'
572
+                        });
573
+
574
+                        div_description.append(textarea);
575
+
576
+                        $('#transformative_actions_to_outcome').append(div_description);
577
+
578
+
579
+                        
580
+                          
581
+                    }
582
+
514
 
583
 
515
 
584
 
516
 
585
 
524
 
593
 
525
         }
594
         }
526
 
595
 
596
+        GlobalTransCategories = '';
597
+
598
+function addTransToPlan(){
599
+                        div_for_name = $('<div>',{
600
+                            'class':'form-group',
601
+
602
+                        });
603
+                        input_name = $('<input>', {
604
+                            'class':'form-control',
605
+                            
606
+                            'name':'at_text[]'
607
+                        });
608
+                        div_for_name.html("<label> Name</label>");
609
+                        div_for_name.append(input_name);
610
+                        $('#transformative_actions_to_outcome').append(div_for_name);
611
+
612
+                        div_for_category=$('<div>',{
613
+                            'class':'form-group'
614
+                        }).html('<label>Type of Transformative Action</label>');
615
+
616
+                        select_for_category = $('<select>',{
617
+                            'name':'type_of_ta[]',
618
+                            'class':'form-control selectpicker',
619
+                            'onchange':'checkIfNew(this)'
620
+                        }).html(GlobalTransCategories);
621
+
622
+                        div_for_category.append(select_for_category);
623
+                        $('#transformative_actions_to_outcome').append(div_for_category);
624
+                        select_for_category.selectpicker('refresh');
625
+                        
626
+
627
+
628
+                        div_description = $('<div>',{
629
+                            'class':'form-group',
630
+
631
+                        }).html('<label> Description</label>');
632
+
633
+                        textarea = $('<textarea>', {
634
+                            'class':'form-control',
635
+                            'name':'description[]',
636
+                            'rows':'10'
637
+                        });
638
+
639
+                        div_description.append(textarea);
640
+
641
+                        $('#transformative_actions_to_outcome').append(div_description);
642
+
643
+
644
+                        
645
+                          
646
+                    }
647
+
648
+     function checkIfNew(select){
649
+  
650
+  if($(select).val()=="new"){
651
+    var new_div = $('<div/>',{
652
+      'class':'form-group new_type'
653
+    }).html("<label>New Type </label>");
654
+
655
+    var input = $("<input/>", {
656
+      'type': 'text',
657
+      'name':"new_type",
658
+      'class':'form-control'
659
+    });
660
+    new_div.append(input);
661
+
662
+    $(select).parent().parent().after(new_div)
663
+    
664
+  }
665
+  else{
666
+    $(select).parent().parent().next('.new_type').remove();
667
+  }
668
+  
669
+  
670
+}
671
+
527
         function posttoTransAnnual(annual_id, selectTransId, typ_course_id) {
672
         function posttoTransAnnual(annual_id, selectTransId, typ_course_id) {
528
             ta = $("#" + selectTransId).val();
673
             ta = $("#" + selectTransId).val();
529
             old_ta = $("#" + selectTransId).data('old-TA');
674
             old_ta = $("#" + selectTransId).data('old-TA');
697
                         'class': 'list-group',
842
                         'class': 'list-group',
698
                         'id': 'list'
843
                         'id': 'list'
699
                     });
844
                     });
845
+                    if(json.outcomes.first){
700
                     header5 = $('<h5/>', {
846
                     header5 = $('<h5/>', {
701
                         'style': "padding-left: 10px"
847
                         'style': "padding-left: 10px"
702
                     }).html("First Semester");
848
                     }).html("First Semester");
705
                     for (outcome in json.outcomes.first) {
851
                     for (outcome in json.outcomes.first) {
706
                         list +=
852
                         list +=
707
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
853
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
708
-                            json.annual_plans.id + "' data-semester-id = '" + json.allSemesterOrder.first.id +
854
+                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"' data-semester-id = '" + json.allSemesterOrder.first.id +
709
                             "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" + json
855
                             "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" + json
710
                             .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[outcome]
856
                             .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[outcome]
711
                             .name + " </li>";
857
                             .name + " </li>";
712
 
858
 
713
                     }
859
                     }
714
                     div.append(list);
860
                     div.append(list);
861
+                    }
862
+                    if(json.outcomes.second){
715
                     header4 = $('<h5/>', {
863
                     header4 = $('<h5/>', {
716
                         'style': "padding-left: 10px"
864
                         'style': "padding-left: 10px"
717
                     }).html("Second Semester");
865
                     }).html("Second Semester");
720
                     for (outcome in json.outcomes.second) {
868
                     for (outcome in json.outcomes.second) {
721
                         list +=
869
                         list +=
722
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
870
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
723
-                            json.annual_plans.id + "' data-semester-id = '" + json.allSemesterOrder.second.id +
871
+                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.second[outcome].typ_semester_outcome_id+"'data-semester-id = '" + json.allSemesterOrder.second.id +
724
                             "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" + json
872
                             "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" + json
725
                             .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
873
                             .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
726
                                 outcome].name + " </li>";
874
                                 outcome].name + " </li>";
727
 
875
 
728
                     }
876
                     }
729
                     div.append(list);
877
                     div.append(list);
878
+                    }
730
                     html = div[0].innerHTML;
879
                     html = div[0].innerHTML;
731
 
880
 
732
                     $("#allOutcomes").html(div[0].innerHTML);
881
                     $("#allOutcomes").html(div[0].innerHTML);

+ 16
- 5
app/views/local/managers/shared/annual_report.blade.php View File

113
             var name = $(li).data('outcome-name');
113
             var name = $(li).data('outcome-name');
114
             var semester_id = $(li).data('semester-id');
114
             var semester_id = $(li).data('semester-id');
115
             var annual_plan_id = $(li).data('annual-plan');
115
             var annual_plan_id = $(li).data('annual-plan');
116
+            var typ_semester_outcome_id = $(li).data('typ-semester-outcome-id');
116
             $('#theChange').data('annual-plan', annual_plan);
117
             $('#theChange').data('annual-plan', annual_plan);
117
             $.post(
118
             $.post(
118
                 "{{ URL::action('AnnualPlansController@fetchReportWithOutcome') }}", {
119
                 "{{ URL::action('AnnualPlansController@fetchReportWithOutcome') }}", {
119
                     semester_id: semester_id,
120
                     semester_id: semester_id,
120
                     outcome_id: outcome_id,
121
                     outcome_id: outcome_id,
121
                     program_id: {{ $program->id }},
122
                     program_id: {{ $program->id }},
122
-                    annual_plan_id: annual_plan_id
123
+                    annual_plan_id: annual_plan_id,
124
+                    typ_semester_outcome_id: typ_semester_outcome_id
123
                 },
125
                 },
124
                 function(outcome) {
126
                 function(outcome) {
125
                     if (outcome.objectives) {
127
                     if (outcome.objectives) {
129
                         $('#allLists').empty();
131
                         $('#allLists').empty();
130
                         $('#levelTabs').empty();
132
                         $('#levelTabs').empty();
131
                         $('.no-outcome').hide();
133
                         $('.no-outcome').hide();
134
+                        if(outcome.outcome_program_goal){
135
+                            outcome.outcome_program_goal = outcome.outcome_program_goal.expected_target;
136
+                        }
137
+                        else{
138
+                            outcome.outcome_program_goal ='It has not been defined';
139
+                        }
132
                         var outcomeHTML = "<h4>Performance of Students by Learning Outcome</h4>" +
140
                         var outcomeHTML = "<h4>Performance of Students by Learning Outcome</h4>" +
133
                             '<h5 style = "display: inline; margin:30px;">Target learning by learning outcome: </h5>' +
141
                             '<h5 style = "display: inline; margin:30px;">Target learning by learning outcome: </h5>' +
134
                             '<p  style = "display: inline;"> <i>>= ' + outcome.expected_outcome +
142
                             '<p  style = "display: inline;"> <i>>= ' + outcome.expected_outcome +
302
 
310
 
303
                         if (students_attempted) {
311
                         if (students_attempted) {
304
                             studentPercentage = ((students_achieved / students_attempted) * 100).toFixed(2);
312
                             studentPercentage = ((students_achieved / students_attempted) * 100).toFixed(2);
305
-                            if (studentPercentage >= outcome.outcome_program_goal) {
313
+                            if (parseFloat(studentPercentage) >= parseFloat(outcome.outcome_program_goal)) {
306
                                 FinalReport = "<br><p><strong>The students achieved the Learning Outcome with " +
314
                                 FinalReport = "<br><p><strong>The students achieved the Learning Outcome with " +
307
                                     studentPercentage + "% of students achieving.</strong></p>";
315
                                     studentPercentage + "% of students achieving.</strong></p>";
308
                             } else {
316
                             } else {
518
                         'class': 'list-group',
526
                         'class': 'list-group',
519
                         'id': 'list'
527
                         'id': 'list'
520
                     });
528
                     });
529
+                    if(json.outcomes.first){
521
                     header5 = $('<h5/>', {
530
                     header5 = $('<h5/>', {
522
                         'style': "padding-left: 10px"
531
                         'style': "padding-left: 10px"
523
                     }).html("First Semester");
532
                     }).html("First Semester");
526
                     for (outcome in json.outcomes.first) {
535
                     for (outcome in json.outcomes.first) {
527
                         list +=
536
                         list +=
528
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
537
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
529
-                            json.annual_plans.id + "' data-semester-id = '" + json.allSemesterOrder.first.id +
538
+                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"' data-semester-id = '" + json.allSemesterOrder.first.id +
530
                             "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" + json
539
                             "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" + json
531
                             .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[outcome]
540
                             .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[outcome]
532
                             .name + " </li>";
541
                             .name + " </li>";
533
 
542
 
534
                     }
543
                     }
535
                     div.append(list);
544
                     div.append(list);
545
+                    }
546
+                    if(json.outcomes.second){
536
                     header4 = $('<h5/>', {
547
                     header4 = $('<h5/>', {
537
                         'style': "padding-left: 10px"
548
                         'style': "padding-left: 10px"
538
                     }).html("Second Semester");
549
                     }).html("Second Semester");
541
                     for (outcome in json.outcomes.second) {
552
                     for (outcome in json.outcomes.second) {
542
                         list +=
553
                         list +=
543
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
554
                             "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
544
-                            json.annual_plans.id + "' data-semester-id = '" + json.allSemesterOrder.second.id +
555
+                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"'data-semester-id = '" + json.allSemesterOrder.second.id +
545
                             "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" + json
556
                             "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" + json
546
                             .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
557
                             .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
547
                                 outcome].name + " </li>";
558
                                 outcome].name + " </li>";
548
 
559
 
549
                     }
560
                     }
550
-                    div.append(list);
561
+                    div.append(list);}
551
                     html = div[0].innerHTML;
562
                     html = div[0].innerHTML;
552
 
563
 
553
                     $("#allOutcomes").html(div[0].innerHTML);
564
                     $("#allOutcomes").html(div[0].innerHTML);