Parcourir la source

Formative actions y criteria bugs

Gabriel Santiago Plaza il y a 3 ans
Parent
révision
c620777b80

+ 9
- 1
app/models/Activity.php Voir le fichier

@@ -60,7 +60,15 @@ class Activity extends Eloquent
60 60
     return  $criteria_achieved;
61 61
   }
62 62
 
63
-
63
+  public function formativeActionsWithCriteria()
64
+  {
65
+    return DB::table('activity_criterion')
66
+      ->join('transformative_activity_criterion', 'transformative_activity_criterion.activity_criterion_id', '=', 'activity_criterion.id')
67
+      ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
68
+      ->join('transformative_actions', 'transformative_actions.id', '=', 'transformative_activity_criterion.trans_action_id')
69
+      ->where('activity_id', $this->id)
70
+      ->get();
71
+  }
64 72
 
65 73
   // cap_array
66 74
   public function getCapArrayAttribute()

+ 1323
- 1011
app/views/local/managers/admins/criteria.blade.php
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 37
- 11
app/views/local/managers/admins/new_assessment_report.blade.php Voir le fichier

@@ -58,14 +58,14 @@
58 58
                                     <?php
59 59
                                     
60 60
                                     /*$sections_evaluating = Course::has('activities')
61
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->whereNotNull('outcomes_attempted')
62
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
63
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->with(array('activities'=>function($query) use(&$outcome){
64
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                $query->whereNotNull('outcomes_attempted');
65
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
66
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->where('code', $course->code)->where('number',$course->number)
67
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->whereIn('semester_id', Session::get('semesters_ids'))
68
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->get();*/
61
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->whereNotNull('outcomes_attempted')
62
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
63
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->with(array('activities'=>function($query) use(&$outcome){
64
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $query->whereNotNull('outcomes_attempted');
65
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
66
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->where('code', $course->code)->where('number',$course->number)
67
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->whereIn('semester_id', Session::get('semesters_ids'))
68
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->get();*/
69 69
                                     
70 70
                                     $sections_evaluating = Course::has('activities')
71 71
                                     
@@ -163,6 +163,32 @@
163 163
                                                 <i>{{ $activity->rubric[0]->expected_percentage }}
164 164
                                                     %</i>
165 165
                                             </p>
166
+
167
+                                            <br>
168
+                                            <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
169
+                                            <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
170
+                                            @if ($formative_actions)
171
+                                                <p style="display: inline;">
172
+                                                    <strong>{{ $formative_actions[0]->at_text }}:
173
+                                                    </strong>
174
+
175
+                                                    <i>{{ $formative_actions[0]->description }}
176
+                                                    </i>
177
+                                                </p>
178
+                                                <br>
179
+                                                <h5>Formative Action's Associated
180
+                                                    Criteria: </h5>
181
+                                                <ul>
182
+                                                    @foreach ($formative_actions as $criteria)
183
+                                                        <li> <i>{{ $criteria->name }} <i></li>
184
+
185
+                                                    @endforeach
186
+                                                </ul>
187
+
188
+                                            @else
189
+                                                <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
190
+
191
+                                            @endif
166 192
                                             <br>
167 193
                                             <table class='table table-striped table-condensed datatable'>
168 194
                                                 <thead>
@@ -251,9 +277,9 @@
251 277
                                                     $expected = DB::table('target_outcomes_program')
252 278
                                                         ->where('program_id', $course->program_id)
253 279
                                                         ->where('semester_id', $course->semester_id)
254
-                                                        ->first();//->expected_target;
255
-                                                    if(!$expected){
256
-                                                        $expected = "It has not been defined in the annual plan";
280
+                                                        ->first(); //->expected_target;
281
+                                                    if (!$expected) {
282
+                                                        $expected = 'It has not been defined in the annual plan';
257 283
                                                     }
258 284
                                                     ?>
259 285
                                                     {{ $expected }}

+ 1217
- 928
app/views/local/managers/pCoords/criteria.blade.php
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 42
- 14
app/views/local/managers/pCoords/new_assessment_report.blade.php Voir le fichier

@@ -44,14 +44,14 @@
44 44
                         <?php
45 45
                         
46 46
                         /*$sections_evaluating = Course::has('activities')
47
-                                                                ->whereNotNull('outcomes_attempted')
48
-                                                                ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
49
-                                                                ->with(array('activities'=>function($query) use(&$outcome){
50
-                                                                    $query->whereNotNull('outcomes_attempted');
51
-                                                                    $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
52
-                                                                ->where('code', $course->code)->where('number',$course->number)
53
-                                                                ->whereIn('semester_id', Session::get('semesters_ids'))
54
-                                                                ->get();*/
47
+                                                                                        ->whereNotNull('outcomes_attempted')
48
+                                                                                        ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
49
+                                                                                        ->with(array('activities'=>function($query) use(&$outcome){
50
+                                                                                            $query->whereNotNull('outcomes_attempted');
51
+                                                                                            $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
52
+                                                                                        ->where('code', $course->code)->where('number',$course->number)
53
+                                                                                        ->whereIn('semester_id', Session::get('semesters_ids'))
54
+                                                                                        ->get();*/
55 55
                         
56 56
                         $sections_evaluating = Course::has('activities')
57 57
                         
@@ -95,7 +95,8 @@
95 95
 
96 96
                                     <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
97 97
                                     <p style="display: inline;">{{ $activity->name }}
98
-                                        <strong>({{ $activity->date }})</strong></p>
98
+                                        <strong>({{ $activity->date }})</strong>
99
+                                    </p>
99 100
                                     <br>
100 101
                                     <br>
101 102
                                     <h5 style="display: inline;">Performance Indicators: </h5>
@@ -125,20 +126,47 @@
125 126
                                     @if ($activity->rubric[0]->max_score == 1)
126 127
                                         <p style="display: inline;">1 point scale</p>
127 128
                                     @else
128
-                                        <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point scale</p>
129
+                                        <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point scale
130
+                                        </p>
129 131
 
130 132
                                     @endif
131 133
                                     <br>
132 134
                                     <br>
133 135
                                     <h4>Perfomance by Learning Outcome Criteria</h4>
134 136
                                     <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
135
-                                    <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }} or more</i>
137
+                                    <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }} or
138
+                                            more</i>
136 139
                                     </p>
137 140
                                     <br>
138 141
                                     <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
139 142
                                         target by criterion: </h5>
140 143
                                     <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_percentage }} %</i>
141 144
                                     </p>
145
+
146
+                                    <br>
147
+                                    <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
148
+                                    <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
149
+                                    @if ($formative_actions)
150
+                                        <p style="display: inline;"> <strong>{{ $formative_actions[0]->at_text }}:
151
+                                            </strong>
152
+
153
+                                            <i>{{ $formative_actions[0]->description }}
154
+                                            </i>
155
+                                        </p>
156
+                                        <br>
157
+                                        <h5>Formative Action's Associated
158
+                                            Criteria: </h5>
159
+                                        <ul>
160
+                                            @foreach ($formative_actions as $criteria)
161
+                                                <li> <i>{{ $criteria->name }} <i></li>
162
+
163
+                                            @endforeach
164
+                                        </ul>
165
+
166
+                                    @else
167
+                                        <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
168
+
169
+                                    @endif
142 170
                                     <br>
143 171
                                     <table class='table table-striped table-condensed datatable'>
144 172
                                         <thead>
@@ -227,9 +255,9 @@
227 255
                                                 ->where('program_id', $course->program_id)
228 256
                                                 ->where('semester_id', $course->semester_id)
229 257
                                                 ->first();
230
-                                                if(!$expected){
231
-                                                        $expected = "It has not been defined in the annual plan";
232
-                                                    }
258
+                                            if (!$expected) {
259
+                                                $expected = 'It has not been defined in the annual plan';
260
+                                            }
233 261
                                             
234 262
                                             ?>
235 263
                                             {{ $expected }}

+ 3
- 13
app/views/local/managers/sCoords/criteria.blade.php Voir le fichier

@@ -25,7 +25,7 @@
25 25
                                 {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class' => 'form-control selectpicker', 'id' => 'outcome0', 'onchange' => 'fetchObjectiveForSelect("outcome0", "objectiveGroupFor0")']) }}
26 26
                             </div>
27 27
 
28
-                            <div id='objectiveGroupFor0' class='createObjective' class data-value='1'>
28
+                            <div id='objectiveGroupFor0' class='createObjective' data-value='1'>
29 29
                                 <div class="form-group col-md-11 selectObjective">
30 30
                                     <label>Associated Objectives for Outcome 1</label>
31 31
                                     <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker"
@@ -80,7 +80,7 @@
80 80
                         {{ Form::text('name', '', ['class' => 'form-control']) }}
81 81
                     </div>
82 82
 
83
-                    <div class="form-group  ">
83
+                    <div class="form-group">
84 84
                         {{ Form::label('subcriteria', 'Subcriteria') }}
85 85
                         <p class="help-block"><strong>Manually add</strong> bullets or numbering.</p>
86 86
                         {{ Form::textarea('subcriteria', '', ['class' => 'form-control', 'rows' => 3, 'aria-labelledby' => 'subcriteria']) }}
@@ -151,15 +151,7 @@
151 151
                             onchange='fetchCriterionForEditing()'>
152 152
                             @foreach ($criteria as $criterion)
153 153
                                 <option value="{{ $criterion->id }}" data-subtext="
154
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
155
-                                                                                                                                                                                                                                                                                                                                                                                                                               
156
-                                                                                                                                                                                                                                                                                                                                                                               
157
-                                                                                                                                                                                                                                                                                                                               
158
-                                                                                                                                                                                                                                                                               
159
-                                                                                                                                                                                                                               
160
-                                                                                                                                                                               
161
-                                                                                                                               
162
-                                                                            @if ($criterion->program)
154
+               @if ($criterion->program)
163 155
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
164 156
                             @endif
165 157
                             ">
@@ -565,7 +557,6 @@
565 557
         visibleProgram["allAssocOutcomes"] = {}
566 558
         visibleProgram["allOutcomes"] = {}
567 559
 
568
-
569 560
         function visiblePrograms(allOutcomesDiv) {
570 561
             checkedPrograms = {}
571 562
             $('#' + allOutcomesDiv).parent().find('input:checkbox').each(function(index) {
@@ -575,7 +566,6 @@
575 566
                     checkedPrograms[$(this).attr('id')] = 1;
576 567
                     $(this).prop("checked", false);
577 568
                 }
578
-
579 569
                 program_id = $(this).val();
580 570
                 if (!(program_id in visibleProgram[allOutcomesDiv])) {
581 571
                     visibleProgram[allOutcomesDiv][program_id] = {};

+ 33
- 8
app/views/local/managers/sCoords/new_assessment_report.blade.php Voir le fichier

@@ -56,14 +56,14 @@
56 56
                                 <?php
57 57
                                 
58 58
                                 /*$sections_evaluating = Course::has('activities')
59
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->whereNotNull('outcomes_attempted')
60
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
61
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->with(array('activities'=>function($query) use(&$outcome){
62
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        $query->whereNotNull('outcomes_attempted');
63
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
64
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->where('code', $course->code)->where('number',$course->number)
65
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->whereIn('semester_id', Session::get('semesters_ids'))
66
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->get();*/
59
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->whereNotNull('outcomes_attempted')
60
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
61
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->with(array('activities'=>function($query) use(&$outcome){
62
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        $query->whereNotNull('outcomes_attempted');
63
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
64
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->where('code', $course->code)->where('number',$course->number)
65
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->whereIn('semester_id', Session::get('semesters_ids'))
66
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ->get();*/
67 67
                                 
68 68
                                 $sections_evaluating = Course::has('activities')
69 69
                                 
@@ -158,6 +158,31 @@
158 158
                                         <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_percentage }}
159 159
                                                 %</i>
160 160
                                         </p>
161
+
162
+                                        <br>
163
+                                        <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
164
+                                        <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
165
+                                        @if ($formative_actions)
166
+                                            <p style="display: inline;"> <strong>{{ $formative_actions[0]->at_text }}:
167
+                                                </strong>
168
+
169
+                                                <i>{{ $formative_actions[0]->description }}
170
+                                                </i>
171
+                                            </p>
172
+                                            <br>
173
+                                            <h5>Formative Action's Associated
174
+                                                Criteria: </h5>
175
+                                            <ul>
176
+                                                @foreach ($formative_actions as $criteria)
177
+                                                    <li> <i>{{ $criteria->name }} <i></li>
178
+
179
+                                                @endforeach
180
+                                            </ul>
181
+
182
+                                        @else
183
+                                            <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
184
+
185
+                                        @endif
161 186
                                         <br>
162 187
                                         <table class='table table-striped table-condensed datatable'>
163 188
                                             <thead>

+ 257
- 229
app/views/local/professors/new_assessment_report.blade.php Voir le fichier

@@ -1,14 +1,14 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-    @if(Auth::user()->role==1)
4
+    @if (Auth::user()->role == 1)
5 5
         @include('local.managers.admins._navigation')
6
-    @elseif(Auth::user()->role==2)
6
+    @elseif(Auth::user()->role == 2)
7 7
         @include('local.managers.sCoords._navigation')
8
-    @elseif(Auth::user()->role==3)
8
+    @elseif(Auth::user()->role == 3)
9 9
         @include('local.managers.pCoords._navigation')
10 10
     @else
11
-    @include('local.professors._navigation')
11
+        @include('local.professors._navigation')
12 12
 
13 13
     @endif
14 14
 @stop
@@ -16,240 +16,268 @@
16 16
 @section('main')
17 17
     <div class="row">
18 18
         <div class="col-md-12">
19
-            <p>This report contains performance information for all your Program's assessed courses during the following semester(s):</p>
19
+            <p>This report contains performance information for all your Program's assessed courses during the following
20
+                semester(s):</p>
20 21
             <ul>
21 22
                 @foreach (Session::get('semesters_info') as $semester_info)
22 23
                     <li>{{ $semester_info }}</li>
23 24
                 @endforeach
24 25
             </ul>
25
-         
26 26
 
27
-                                <!-- For each grouped course -->
28
-                                <ul id = "levelTabs" class="nav nav-tabs" role="tablist">
29
-                                        
30
-                                   
31
-                                @foreach($courses as $index2=>$course)
32
-                              
33
-                            
34
-                          
35
-                                   <li role= "presentation">
36
-                                        <a data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
37
-                                            role ="tab">{{ $course->code}}-{{ $course->number }}</a>
38
-                                        </li>
39
-                            @endforeach
40
-                                </ul>
41
-                                <div id="allLists" class="tab-content">
42
-                                   
43
-                                
44
-
45
-
46
-                           @foreach($courses as $index2=>$course)
47
-
48
-                           <?php
49
-
50
-                           /*$sections_evaluating = Course::has('activities')
51
-                           ->whereNotNull('outcomes_attempted')
52
-                           ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
53
-                           ->with(array('activities'=>function($query) use(&$outcome){
54
-                               $query->whereNotNull('outcomes_attempted');
55
-                               $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
56
-                           ->where('code', $course->code)->where('number',$course->number)
57
-                           ->whereIn('semester_id', Session::get('semesters_ids'))
58
-                           ->get();*/
59
-
60
-
61
-                           $sections_evaluating = Course::has('activities')
62
-               
63
-               //->whereNotNull('outcomes_attempted')
64
-               //->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
65
-               ->with(array('activities'=>function($query) use(&$course){
66
-                   $activities = DB::table('activities')
67
-                   ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
68
-                   ->join('assessments', 'assessments.activity_criterion_id', '=','activity_criterion.id')
69
-                   //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
70
-                   ->join('courses','courses.id','=','activities.course_id')
71
-                   ->where('courses.code',$course->code)
72
-                   ->where('courses.number',$course->number)
73
-                   ->where('activities.draft',0)
74
-                   ->where('activities.diagnostic',0)
75
-                   //->where('criterion_objective_outcome.outcome_id', $outcome->id)
76
-                   ->select('activity_id')
77
-                   ->lists('activity_id');
78
-
79
-                   //$query->whereNotNull('outcomes_attempted');
80
-                   //$query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
81
-               $query->whereIn('activities.id', $activities);
82
-           } ))
83
-                   
84
-
85
-               ->where('code', $course->code)->where('number',$course->number)
86
-               ->where('user_id',Auth::user()->id)
87
-               ->whereIn('semester_id', Session::get('semesters_ids'))
88
-               ->orderBy('semester_id')
89
-               ->get();
90
-               
91
-              
92
-                       ?>
93
-
94
-                            
95
-                            <div role = "tabpanel" class = 'tab-pane' id = "{{$course->code}}-{{$course->number}}">
96
-                                @foreach($sections_evaluating as $index3 => $section)
97
-                                <h3 style="text-align: center"> Course: {{$course->code}} {{$course->number}}-{{$section->section}}</h3> 
98
-                                <?php
99
-                                Log::info($section->publishedActivities);
100
-                                ?>
101
-                                @foreach($section->publishedActivities as $index4 => $activity)
102 27
 
103
-                                <h5 style="display: inline;">Activity {{$index4+1}}: </h5>
104
-                                <p style="display: inline;">{{$activity->name}} <strong>({{$activity->date}})</strong></p>
28
+            <!-- For each grouped course -->
29
+            <ul id="levelTabs" class="nav nav-tabs" role="tablist">
30
+
31
+
32
+                @foreach ($courses as $index2 => $course)
33
+
34
+
35
+
36
+                    <li role="presentation">
37
+                        <a data-toggle="tab" href="#{{ $course->code }}-{{ $course->number }}"
38
+                            role="tab">{{ $course->code }}-{{ $course->number }}</a>
39
+                    </li>
40
+                @endforeach
41
+            </ul>
42
+            <div id="allLists" class="tab-content">
43
+
44
+
45
+
46
+
47
+                @foreach ($courses as $index2 => $course)
48
+
49
+                    <?php
50
+                    
51
+                    /*$sections_evaluating = Course::has('activities')
52
+                                               ->whereNotNull('outcomes_attempted')
53
+                                               ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
54
+                                               ->with(array('activities'=>function($query) use(&$outcome){
55
+                                                   $query->whereNotNull('outcomes_attempted');
56
+                                                   $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
57
+                                               ->where('code', $course->code)->where('number',$course->number)
58
+                                               ->whereIn('semester_id', Session::get('semesters_ids'))
59
+                                               ->get();*/
60
+                    
61
+                    $sections_evaluating = Course::has('activities')
62
+                    
63
+                        //->whereNotNull('outcomes_attempted')
64
+                        //->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
65
+                        ->with([
66
+                            'activities' => function ($query) use (&$course) {
67
+                                $activities = DB::table('activities')
68
+                                    ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
69
+                                    ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
70
+                                    //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
71
+                                    ->join('courses', 'courses.id', '=', 'activities.course_id')
72
+                                    ->where('courses.code', $course->code)
73
+                                    ->where('courses.number', $course->number)
74
+                                    ->where('activities.draft', 0)
75
+                                    ->where('activities.diagnostic', 0)
76
+                                    //->where('criterion_objective_outcome.outcome_id', $outcome->id)
77
+                                    ->select('activity_id')
78
+                                    ->lists('activity_id');
79
+                    
80
+                                //$query->whereNotNull('outcomes_attempted');
81
+                                //$query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
82
+                                $query->whereIn('activities.id', $activities);
83
+                            },
84
+                        ])
85
+                    
86
+                        ->where('code', $course->code)
87
+                        ->where('number', $course->number)
88
+                        ->where('user_id', Auth::user()->id)
89
+                        ->whereIn('semester_id', Session::get('semesters_ids'))
90
+                        ->orderBy('semester_id')
91
+                        ->get();
92
+                    
93
+                    ?>
94
+
95
+
96
+                    <div role="tabpanel" class='tab-pane' id="{{ $course->code }}-{{ $course->number }}">
97
+                        @foreach ($sections_evaluating as $index3 => $section)
98
+                            <h3 style="text-align: center"> Course: {{ $course->code }}
99
+                                {{ $course->number }}-{{ $section->section }}</h3>
100
+                            <?php
101
+                            Log::info($section->publishedActivities);
102
+                            ?>
103
+                            @foreach ($section->publishedActivities as $index4 => $activity)
104
+
105
+                                <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
106
+                                <p style="display: inline;">{{ $activity->name }} <strong>({{ $activity->date }})</strong>
107
+                                </p>
105 108
                                 <br>
106 109
                                 <br>
107 110
                                 <h5 style="display: inline;">Performance Indicators: </h5>
108
-                                    <?php
109
-                                    Log::info($activity->rubric[0]);
110
-                                    ?>
111
-                                <p style="display: inline;"><i>{{$activity->rubric[0]->num_scales}} (
112 111
                                 <?php
113
-                                    $titles = $activity->rubric[0]->getTitles();
114
-                                    ?>
115
-                                @if(sizeof($titles) != 1)
116
-                                    @foreach ($titles as $index5=>$rubric_title)
117
-                                        @if($index5!= ($activity->rubric[0]->num_scales)-1 )
118
-                                            {{$rubric_title->text}},
112
+                                Log::info($activity->rubric[0]);
113
+                                ?>
114
+                                <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
115
+                                        <?php
116
+                                        $titles = $activity->rubric[0]->getTitles();
117
+                                        ?>
118
+                                        @if (sizeof($titles) != 1)
119
+                                            @foreach ($titles as $index5 => $rubric_title)
120
+                                                @if ($index5 != $activity->rubric[0]->num_scales - 1)
121
+                                                    {{ $rubric_title->text }},
122
+                                                @else
123
+                                                    and {{ $rubric_title->text }}
124
+                                                @endif
125
+
126
+                                            @endforeach
127
+                                            )
119 128
                                         @else
120
-                                            and {{$rubric_title->text}}
129
+                                            {{ $titles[0]->text }} )
121 130
                                         @endif
122
-                                            
123
-                                    @endforeach
124
-                                )
125
-                                @else
126
-                                    {{$titles[0]->text}} )
127
-                                @endif
128
-                                </i></p>
131
+                                    </i></p>
129 132
                                 <br>
130 133
                                 <h5 style="display: inline;">Scale: </h5>
131
-                                @if($activity->rubric[0]->max_score == 1)
134
+                                @if ($activity->rubric[0]->max_score == 1)
132 135
 
133
-                               <p style="display: inline;">1 point scale</p>
136
+                                    <p style="display: inline;">1 point scale</p>
134 137
                                 @else
135
-                                <p style="display: inline;">1-{{$activity->rubric[0]->max_score}} point scale</p>
138
+                                    <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point scale</p>
136 139
 
137 140
                                 @endif
138 141
                                 <br>
139 142
                                 <br>
140 143
                                 <h4>Perfomance by Learning Outcome Criteria</h4>
141
-                                <h5 style = "display: inline; margin:30px;">Target by criterion: </h5>
142
-                                <p  style = "display: inline;"> <i>{{$activity->rubric[0]->expected_points}} or more</i>
144
+                                <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
145
+                                <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }} or more</i>
143 146
                                 </p>
144 147
                                 <br>
145
-                                <h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by criterion: </h5>
146
-                                <p  style = "display: inline;"> <i>{{$activity->rubric[0]->expected_percentage}} %</i>
148
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the target
149
+                                    by criterion: </h5>
150
+                                <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_percentage }} %</i>
147 151
                                 </p>
152
+
148 153
                                 <br>
154
+                                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
155
+                                <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
156
+                                @if ($formative_actions)
157
+                                    <p style="display: inline;"> <strong>{{ $formative_actions[0]->at_text }}:
158
+                                        </strong>
159
+
160
+                                        <i>{{ $formative_actions[0]->description }}
161
+                                        </i>
162
+                                    </p>
163
+                                    <br>
164
+                                    <h5>Formative Action's Associated
165
+                                        Criteria: </h5>
166
+                                    <ul>
167
+                                        @foreach ($formative_actions as $criteria)
168
+                                            <li> <i>{{ $criteria->name }} <i></li>
149 169
 
150
-                                <table class='table table-striped table-condensed datatable'>
151
-                                <thead>
152
-                                    <tr>
153
-                                        <th>
154
-                                            Criterion
155
-                                        </th>
156
-                                        <th>
157
-                                            Number of Students Assessed
158
-                                        </th>
159
-                                        <th>
160
-                                            Number of students that achieved the target
161
-                                        </th>
162
-                                        <th>
163
-                                            %
164
-                                        </th>
165
-                                        <th>
166
-                                            Outcomes
167
-                                        </th>
168
-                                    </tr>
169
-                                </thead>
170
-                                <tbody>
171
-                                    @foreach($activity->allActivityCriterionInfo() as $index5=>$ac_criterion)
172
-                                    <tr>
173
-                                        <td> {{$ac_criterion->name}}</td>
174
-                                        <td>{{Criterion::students_attempted($ac_criterion->criterion_id, $activity->id)}}
175
-                                        </td>
176
-                                        <td>
177
-                                        {{Criterion::students_achieved($ac_criterion->criterion_id, $activity->id)}}
178
-
179
-                                        </td>
180
-                                        <?php
170
+                                        @endforeach
171
+                                    </ul>
181 172
 
182
-                                        $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
183
-                                        $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
184
-                                        
185
-                                        $percentage = "N/A";
186
-                                        $activity->getOutcomeReport();
187
-                                        
173
+                                @else
174
+                                    <p style="display: inline;"> <strong>Has no Formative Action yet </strong>
175
+
176
+                                @endif
177
+                                <br>
178
+
179
+                                <table class='table table-striped table-condensed datatable'>
180
+                                    <thead>
181
+                                        <tr>
182
+                                            <th>
183
+                                                Criterion
184
+                                            </th>
185
+                                            <th>
186
+                                                Number of Students Assessed
187
+                                            </th>
188
+                                            <th>
189
+                                                Number of students that achieved the target
190
+                                            </th>
191
+                                            <th>
192
+                                                %
193
+                                            </th>
194
+                                            <th>
195
+                                                Outcomes
196
+                                            </th>
197
+                                        </tr>
198
+                                    </thead>
199
+                                    <tbody>
200
+                                        @foreach ($activity->allActivityCriterionInfo() as $index5 => $ac_criterion)
201
+                                            <tr>
202
+                                                <td> {{ $ac_criterion->name }}</td>
203
+                                                <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity->id) }}
204
+                                                </td>
205
+                                                <td>
206
+                                                    {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity->id) }}
207
+
208
+                                                </td>
209
+                                                <?php
210
+                                                
211
+                                                $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
212
+                                                $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
213
+                                                
214
+                                                $percentage = 'N/A';
215
+                                                $activity->getOutcomeReport();
216
+                                                
217
+                                                ?>
218
+
219
+                                                @if ($out_att == 0)
220
+                                                    <td class="col-md-1 danger">{{ $percentage }}</td>
188 221
 
189
-                                        ?>
190
-                                        
191
-                                            @if($out_att==0)
192
-                                            <td class="col-md-1 danger">{{ $percentage }}</td>
193
-
194
-                                            @else
195
-                                            <?php
196
-                                            $percentage = round(($out_ach/$out_att)*100, 2)
197
-                                            ?>
198
-                                                @if ($percentage>=$activity->rubric[0]->expected_percentage)
199
-                                                <td class="col-md-1 success">{{ $percentage }}%</td>
200
-                                                                 
201 222
                                                 @else
202
-                                                <td class="col-md-1 danger">{{ $percentage }}%</td>
203
-                                                      
223
+                                                    <?php
224
+                                                    $percentage = round(($out_ach / $out_att) * 100, 2);
225
+                                                    ?>
226
+                                                    @if ($percentage >= $activity->rubric[0]->expected_percentage)
227
+                                                        <td class="col-md-1 success">{{ $percentage }}%</td>
228
+
229
+                                                    @else
230
+                                                        <td class="col-md-1 danger">{{ $percentage }}%</td>
231
+
232
+                                                    @endif
233
+
234
+
235
+
204 236
                                                 @endif
205 237
 
206 238
 
207 239
 
208
-                                           @endif
240
+                                                <td>
209 241
 
210 242
 
211
-                                        
212
-                                        <td>
213
-                                            
214
-                                            
215
-                                            @foreach(Criterion::outcomes($ac_criterion->criterion_id) as $index6=>$outcome)
216
-                                            
217
-                                             {{$index6 + 1}}.   <?php echo $outcome->name."\n\n\n <br>" ?>
218
-                                             
219
-                                            
243
+                                                    @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
244
+
245
+                                                        {{ $index6 + 1 }}. <?php echo $outcome->name . "\n\n\n <br>"; ?>
246
+
247
+
248
+
249
+                                                    @endforeach
250
+
251
+
252
+                                                </td>
253
+                                            </tr>
254
+                                        @endforeach
255
+                                    </tbody>
220 256
 
221
-                                            @endforeach
222
-                                            
223
-                                            
224
-                                        </td>
225
-                                    </tr>
226
-                                    @endforeach
227
-                                </tbody>
228
-                            
229 257
                                 </table>
230 258
                                 <hr>
231 259
                                 <br>
232 260
 
233 261
                                 <h4>Perfomance by Learning Outcome Student</h4>
234
-                                <h5 style = "display: inline; margin:30px;">Target by outcome: </h5>
235
-                                <p  style = "display: inline;"> <i>>= 66.67% of the attempts</i>
262
+                                <h5 style="display: inline; margin:30px;">Target by outcome: </h5>
263
+                                <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
236 264
                                 </p>
237 265
                                 <br>
238
-                                <h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by outcome: </h5>
239
-                                <p  style = "display: inline;"> <i> 
240
-                                    <?php
241
-                                     $expected = DB::table('target_outcomes_program')
242
-        ->where('program_id', $course->program_id)
243
-        ->where('semester_id', $course->semester_id)
244
-        ->first();//->expected_target;
245
-        if(!$expected){
246
-                                                        $expected = "It has not been defined in the annual plan";
247
-                                                    }
248
-
249
-        
250
-                                    ?>
251
-                                    {{$expected}}
252
-                                </i>
266
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the target
267
+                                    by outcome: </h5>
268
+                                <p style="display: inline;"> <i>
269
+                                        <?php
270
+                                        $expected = DB::table('target_outcomes_program')
271
+                                            ->where('program_id', $course->program_id)
272
+                                            ->where('semester_id', $course->semester_id)
273
+                                            ->first(); //->expected_target;
274
+                                        if (!$expected) {
275
+                                            $expected = 'It has not been defined in the annual plan';
276
+                                        }
277
+                                        
278
+                                        ?>
279
+                                        {{ $expected }}
280
+                                    </i>
253 281
                                 </p>
254 282
                                 <br>
255 283
                                 <table class='table table-striped table-condensed datatable'>
@@ -267,34 +295,34 @@
267 295
                                             <th>
268 296
                                                 %
269 297
                                             </th>
270
-                                            
298
+
271 299
                                         </tr>
272 300
                                     </thead>
273 301
                                     <tbody>
274
-                                        @foreach($activity->getOutcomeReport() as $outcome)
275
-                                        <tr>
276
-                                            <td>
277
-                                                {{$outcome->name}}
278
-                                            </td>
279
-                                            <td>
280
-                                                {{$outcome->attempted}}
281
-                                            </td>
282
-                                            <td>
283
-                                                {{$outcome->achieved}}
284
-                                            </td>
285
-                                            @if($outcome->percentage>= $expected)
286
-                                                <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
287
-                                                                 
302
+                                        @foreach ($activity->getOutcomeReport() as $outcome)
303
+                                            <tr>
304
+                                                <td>
305
+                                                    {{ $outcome->name }}
306
+                                                </td>
307
+                                                <td>
308
+                                                    {{ $outcome->attempted }}
309
+                                                </td>
310
+                                                <td>
311
+                                                    {{ $outcome->achieved }}
312
+                                                </td>
313
+                                                @if ($outcome->percentage >= $expected)
314
+                                                    <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
315
+
288 316
                                                 @else
289
-                                                <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
290
-                                                      
317
+                                                    <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
318
+
291 319
                                                 @endif
292 320
 
293 321
 
294 322
 
295
-                                           
296 323
 
297
-                                        </tr>
324
+
325
+                                            </tr>
298 326
 
299 327
                                         @endforeach
300 328
                                     </tbody>
@@ -307,29 +335,29 @@
307 335
 
308 336
 
309 337
 
310
-                                
311
-                                @endforeach
312
-                            
313
-                                @endforeach
314
-                            </div>
315 338
 
316
-                            
339
+                            @endforeach
317 340
 
318
-                                        @endforeach
319
-                            
341
+                        @endforeach
342
+                    </div>
320 343
 
321
-            
322 344
 
323 345
 
324
-                                        
346
+                @endforeach
347
+
348
+
349
+
350
+
351
+
352
+
353
+            </div>
325 354
         </div>
326
-    </div>
327 355
 
328
- 
329
-@section('included-js')
330
-    @include('global._datatables_js')
331
-@stop
332
-        
356
+
357
+    @section('included-js')
358
+        @include('global._datatables_js')
359
+    @stop
360
+
333 361
 @stop
334 362
 
335 363
 @section('javascript')