Browse Source

Merge branch 'Merge_gabriel_mayo' of https://git.ccom.uprrp.edu/CDCC/OLAS into Merge_gabriel_mayo

parent
commit
738c91af95

+ 4
- 3
app/controllers/AnnualPlansController.php View File

@@ -135,9 +135,10 @@ class AnnualPlansController extends \BaseController
135 135
     $title = "Annual Plans";
136 136
     //$typ_parts = DB::select("select * from typ_parts");
137 137
 
138
-    $current_typ = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'))[0];
139
-
140
-
138
+//     $current_typ = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'))[0];
139
+    $current_typ_arr = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'));
140
+// 	var_dump($current_typ);exit();
141
+	if(!empty($current_typ_arr))$current_typ=$current_typ_arr[0];else {$current_typ= new stdClass();$current_typ->id=0;}
141 142
 
142 143
 
143 144
     $program = Program::where('id', '=', $program_id)->first();

+ 2
- 2
app/controllers/OutcomesController.php View File

@@ -709,7 +709,7 @@ class OutcomesController extends \BaseController
709 709
                     ->with(array('courses' => function ($query2) use ($outcome_id) {
710 710
                         $query2
711 711
                             ->has('activities')
712
-                            ->whereNotNull('outcomes_attempted')
712
+//                             ->whereNotNull('outcomes_attempted')
713 713
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
714 714
                             ->whereIn('semester_id', Session::get('semesters_ids'))
715 715
                             ->groupBy(array('code', 'number'));
@@ -736,7 +736,7 @@ class OutcomesController extends \BaseController
736 736
                     ->with(array('courses' => function ($query2) use ($outcome_id) {
737 737
                         $query2
738 738
                             ->has('activities')
739
-                            ->whereNotNull('outcomes_attempted')
739
+//                             ->whereNotNull('outcomes_attempted')
740 740
                             // ->where('outcomes_attempted', 'NOT LIKE', '%"'.$outcome_id.'":0%')
741 741
                             ->whereIn('semester_id', Session::get('semesters_ids'))
742 742
                             ->groupBy(array('code', 'number'));

+ 2
- 3
app/controllers/ProgramCoordinatorsController.php View File

@@ -75,8 +75,8 @@ class ProgramCoordinatorsController extends \BaseController
75 75
 
76 76
       $program_array['assessed_courses_count'] = 0;
77 77
       foreach ($program_array['program_courses'] as $course) {
78
-        if (!empty($course->outcomes_ach())) {
79
-          $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
78
+        if (!($program_array['course_outcomes_achieved'] = $course->outcomes_ach())) {
79
+//           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
80 80
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
81 81
           Log::info($program_array['course_outcomes_achieved']);
82 82
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {
@@ -146,7 +146,6 @@ class ProgramCoordinatorsController extends \BaseController
146 146
       $programs_contact[] = $users;
147 147
     }
148 148
 
149
-
150 149
     return View::make('local.managers.pCoords.overview', compact('title', 'programs', 'outcomes', 'programs_array', 'programs_contact'));
151 150
   }
152 151
 }

+ 4
- 3
app/controllers/ProgramsController.php View File

@@ -73,7 +73,8 @@ class ProgramsController extends \BaseController
73 73
      * List of grouped courses (grouped sections)
74 74
      */
75 75
 
76
-    $grouped_courses = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
76
+//     $grouped_courses = Course::select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
77
+    $grouped_courses = Course::select(DB::raw('name, code, number, semester_id, program_id'))
77 78
       ->with('semester')
78 79
       ->with('program')
79 80
       ->where('program_id', $program->id)
@@ -363,8 +364,8 @@ class ProgramsController extends \BaseController
363 364
 
364 365
       $program_array['assessed_courses_count'] = 0;
365 366
       foreach ($program_array['program_courses'] as $course) {
366
-        if (!empty($course->outcomes_ach())) {
367
-          $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
367
+        if (!$program_array['course_outcomes_achieved'] = $course->outcomes_ach()) {
368
+//           $program_array['course_outcomes_achieved'] = $course->outcomes_ach();
368 369
           $program_array['course_outcomes_attempted'] = $course->outcomes_att();
369 370
           Log::info($program_array['course_outcomes_achieved']);
370 371
           foreach ($program_array['course_outcomes_achieved'] as $i => $score) {

+ 2
- 2
app/controllers/SchoolCoordinatorsController.php View File

@@ -238,7 +238,7 @@ class SchoolCoordinatorsController extends \BaseController
238 238
                     $course_outcomes_attempted2 = $course->outcomes_att(); //json_decode($course->outcomes_attempted, true);
239 239
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
240 240
                     if (
241
-                        array_key_exists($outcome->id, $course_outcomes_attempted2)
241
+                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
242 242
                         && $course_outcomes_attempted2[$outcome->id] > 0
243 243
                     ) {
244 244
                         $achieved_outcomes_per_undergrad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];
@@ -312,7 +312,7 @@ class SchoolCoordinatorsController extends \BaseController
312 312
                     $course_outcomes_attempted2 = $course->outcomes_att();  // json_decode($course->outcomes_attempted, true);
313 313
                     $course_outcomes_achieved2 = $course->outcomes_ach(); //json_decode($course->outcomes_achieved, true);
314 314
                     if (
315
-                        array_key_exists($outcome->id, $course_outcomes_attempted2)
315
+                        array_key_exists($outcome->id, $course_outcomes_attempted2) && array_key_exists($outcome->id, $course_outcomes_achieved2)
316 316
                         && $course_outcomes_attempted2[$outcome->id] > 0
317 317
                     ) {
318 318
                         $achieved_outcomes_per_grad_program[$outcome->id] += $course_outcomes_achieved2[$outcome->id];

+ 19
- 12
app/controllers/SchoolsController.php View File

@@ -45,7 +45,8 @@ class SchoolsController extends \BaseController
45 45
    
46 46
 
47 47
         $grad_grouped_courses = Course::
48
-            select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
48
+//             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
49
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
49 50
             ->with('semester')
50 51
             ->with('program')
51 52
             ->whereIn('courses.program_id', $program_ids)
@@ -59,7 +60,8 @@ class SchoolsController extends \BaseController
59 60
             ->get();
60 61
 
61 62
         $undergrad_grouped_courses = Course::
62
-            select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
63
+//             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
64
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
63 65
             ->with('semester')
64 66
             ->with('program')
65 67
             ->whereIn('courses.program_id', $program_ids)
@@ -153,7 +155,7 @@ class SchoolsController extends \BaseController
153 155
         {
154 156
             // For each program with courses that do assessment
155 157
             $programs_with_courses = Program::with(array('courses' => function($query){
156
-                $query->whereNotNull('outcomes_attempted');
158
+//                 $query->whereNotNull('outcomes_attempted');
157 159
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
158 160
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
159 161
 
@@ -170,9 +172,11 @@ class SchoolsController extends \BaseController
170 172
                 foreach ($program->courses as $course)
171 173
                 {
172 174
                     // If the outcome in question is being evaluated
173
-                    $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
174
-                    $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
175
-                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
175
+                    $course_outcomes_attempted2 = $course->outcomes_att();
176
+//                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
177
+//                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
178
+                    $course_outcomes_achieved2 = $course->outcomes_ach();
179
+                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
176 180
                         && $course_outcomes_attempted2[$outcome->id]>0)
177 181
                     {
178 182
                         $achieved_outcomes_per_undergrad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
@@ -225,7 +229,7 @@ class SchoolsController extends \BaseController
225 229
         {
226 230
             // For each program with courses that do assessment
227 231
             $programs_with_courses = Program::with(array('courses' => function($query){
228
-                $query->whereNotNull('outcomes_attempted');
232
+//                 $query->whereNotNull('outcomes_attempted');
229 233
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
230 234
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
231 235
 
@@ -242,9 +246,11 @@ class SchoolsController extends \BaseController
242 246
                 foreach ($program->courses as $course)
243 247
                 {
244 248
                     // If the outcome in question is being evaluated
245
-                    $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
246
-                    $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
247
-                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 )
249
+//                     $course_outcomes_attempted2 = json_decode($course->outcomes_attempted, true);
250
+                    $course_outcomes_attempted2 = ($course->outcomes_att());
251
+                    $course_outcomes_achieved2 = ($course->outcomes_ach());
252
+//                     $course_outcomes_achieved2 = json_decode($course->outcomes_achieved, true);
253
+                    if(array_key_exists($outcome->id, $course_outcomes_attempted2 ) && array_key_exists($outcome->id, $course_outcomes_achieved2 )
248 254
                         && $course_outcomes_attempted2[$outcome->id]>0)
249 255
                     {
250 256
                         $achieved_outcomes_per_grad_program[$outcome->id]+=$course_outcomes_achieved2[$outcome->id];
@@ -298,7 +304,8 @@ class SchoolsController extends \BaseController
298 304
         $program_ids= $school->programs->lists('id');
299 305
 
300 306
         $grouped_courses = Course::
301
-            select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
307
+//             select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
308
+            select(DB::raw('name, code, number, semester_id, program_id'))
302 309
             ->with('semester')
303 310
             ->with('program')
304 311
             ->whereIn('program_id', $program_ids)
@@ -359,7 +366,7 @@ class SchoolsController extends \BaseController
359 366
         {
360 367
             // For each program with courses that do assessment
361 368
             foreach (Program::with(array('courses' => function($query){
362
-                $query->whereNotNull('outcomes_attempted');
369
+//                 $query->whereNotNull('outcomes_attempted');
363 370
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
364 371
             }))->where('school_id', $school->id)->orderBy('name', 'asc')->get() as $program)
365 372
             {

+ 1
- 1
app/controllers/ThreeYearPlanController.php View File

@@ -585,7 +585,7 @@ class ThreeYearPlanController extends \BaseController
585 585
     }
586 586
   }
587 587
 
588
-  public function print($program_id, $typ)
588
+  public function printPlan($program_id, $typ)
589 589
   {
590 590
 
591 591
     $program = DB::table('programs')->where('id', $program_id)->first();

+ 7
- 5
app/views/local/managers/admins/assessment_report.blade.php View File

@@ -59,11 +59,13 @@
59 59
                                         <?php
60 60
 
61 61
                                             $sections_evaluating_outcome = Course::has('activities')
62
-                                            ->whereNotNull('outcomes_attempted')
63
-                                            ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
62
+//                                             ->whereNotNull('outcomes_attempted')
63
+//                                             ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
64 64
                                             ->with(array('activities'=>function($query) use(&$outcome){
65
-                                                $query->whereNotNull('outcomes_attempted');
66
-                                                $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
65
+//                                                 $query->whereNotNull('outcomes_attempted');
66
+//                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
67
+//                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
68
+                                                } ))
67 69
                                             ->where('code', $course->code)->where('number',$course->number)
68 70
                                             ->whereIn('semester_id', Session::get('semesters_ids'))
69 71
                                             ->get();
@@ -181,7 +183,7 @@
181 183
                                     <td>{{ $program->name }}</td>
182 184
                                     <td>No</td>
183 185
                                     <td>
184
-                                        This program does not assess {{ $outcome->name }}.
186
+                                        This program did not assess {{ $outcome->name }}.
185 187
                                     </td>
186 188
                                 </tr>
187 189
                             @endif

+ 7
- 1
app/views/local/managers/admins/criteria.blade.php View File

@@ -1,7 +1,13 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-@include('local.managers.sCoords._navigation')
4
+    @if(Auth::user()->role==1)
5
+        @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role==2)
7
+        @include('local.managers.sCoords._navigation')
8
+    @elseif(Auth::user()->role==3)
9
+        @include('local.managers.pCoords._navigation')
10
+    @endif
5 11
 @stop
6 12
 @section('main')
7 13
 

+ 127
- 0
app/views/local/managers/admins/total_assessment.blade.php View File

@@ -0,0 +1,127 @@
1
+ @extends('layouts.master')
2
+
3
+@section('navigation')
4
+        @include('local.managers.admins._navigation')
5
+@stop
6
+
7
+@section('main')
8
+    <div class="row">
9
+        <div class="col-md-12">
10
+
11
+            <p>This report contains the Assessment for all Students for all Schools and Programs during the following semester(s):</p>
12
+            <ul>
13
+                @foreach (Session::get('semesters_info') as $semester_info)
14
+                    <li>{{ $semester_info }}</li>
15
+                @endforeach
16
+            </ul>
17
+
18
+
19
+            <!-- <h3>Table of Contents</h3> -->
20
+            <!-- <ol id="table-of-contents" class="upper-roman">
21
+
22
+            </ol> -->
23
+
24
+
25
+            <table class="table table-condensed table-bordered datatable">
26
+                <thead>
27
+                    <tr class="center-text">
28
+                        <th>Semester</th>
29
+                        <th>School or College</th>
30
+                        <th>Program ID</th>
31
+                        <th>Program Code</th>
32
+                        <th>Outcome</th>
33
+                        <th>Student Number</th>
34
+                        <th>Student Program</th>
35
+                        <th>Criteria</th>
36
+                        <th>Courses</th>
37
+                        <th>Expected Result For Achievement</th>
38
+                        <th>Student Result</th>
39
+                    </tr>
40
+                </thead>
41
+                <tfoot>
42
+                    <tr class="column-search">
43
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
44
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
45
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
46
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
47
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
48
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
49
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
50
+                        <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
51
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
52
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
53
+                        <th><select class="column-search-select form-control"><option value=""></option></select></th>
54
+                    </tr>
55
+                </tfoot>
56
+                <tbody>
57
+                    @foreach ($total_assessments as $total_assessment)
58
+                                <tr>
59
+                                    <td>{{ $total_assessment->semester }}</td>
60
+                                    <td>{{ $total_assessment->school }}</td>
61
+                                    <td>{{ $total_assessment->program }}</td>
62
+                                    <td>{{ $total_assessment->program_code }}</td>
63
+                                    <td>{{ $total_assessment->outcome }}</td>
64
+                                    <td>{{ $total_assessment->student_number }}</td>
65
+                                    <td>{{ $total_assessment->student_conc_code }}</td>
66
+                                    <td>{{ $total_assessment->criterion }}</td>
67
+                                    <td>{{ $total_assessment->course }}</td>
68
+                                    <td>{{ $total_assessment->expected_result }}</td>
69
+                                    <td>{{ $total_assessment->result }}</td>
70
+                                </tr>
71
+                    @endforeach
72
+                </tbody>
73
+            </table>
74
+        </div>
75
+    </div>
76
+    <span class="js-vars"
77
+        data-pdf-url="{{ URL::action('OutcomesController@totalAssessmentReport') }}"
78
+    ></span>
79
+@stop
80
+
81
+@section('included-js')
82
+    @include('global._datatables_js')
83
+@stop
84
+
85
+
86
+@section('javascript')
87
+
88
+// Build table of contents
89
+var outcome = $('.outcome');
90
+var str ='';
91
+str+='<li><a href="#'+outcome.attr('id')+'">'+outcome.text()+'</a><ol class="schools upper-alpha">';
92
+
93
+/*$('[id^='+outcome.attr('id')+'-].school:visible').each(function(e){
94
+    var school = $(this);
95
+    str+='<li><a href="#'+school.attr('id')+'">'+school.text()+'</a><ol class="programs">';
96
+
97
+    $('[id^='+school.attr('id')+'-].program:visible').each(function(e){
98
+
99
+        var program = $(this);
100
+        if(!program.hasClass('no-courses'))
101
+            str+='<li><a href="#'+program.attr('id')+'">'+program.text()+'</a></li>';
102
+        else
103
+            str+='<li>'+program.text()+'</li>';
104
+
105
+    });
106
+
107
+    str+='</ol></li>';
108
+});*/
109
+
110
+str+='</ol></li>';
111
+
112
+//$('#table-of-contents').append(str);
113
+
114
+
115
+// ----------------------------------------------------------------------------
116
+// Events
117
+//
118
+
119
+$('.to-top').on('click', function(e) {
120
+    e.preventDefault();
121
+
122
+     $(this).scrollTop(0);
123
+    $('html').animate({scrollTop:0}, 1);
124
+    $('body').animate({scrollTop:0}, 1);
125
+})
126
+
127
+@stop

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

@@ -364,6 +364,7 @@
364 364
                         @if(
365 365
                             is_array($program_item['outcomes_attempted'])
366 366
                             && array_key_exists($outcome->id, $program_item['outcomes_attempted'])
367
+                            && array_key_exists($outcome->id, $program_item['outcomes_achieved'])
367 368
                             && $program_item['outcomes_attempted'][$outcome->id]!=0)
368 369
                             {{{ ($program_item['outcomes_achieved'][$outcome->id]/$program_item['outcomes_attempted'][$outcome->id])*100 }}},
369 370
                         @else

+ 4
- 4
app/views/local/professors/overview.blade.php View File

@@ -174,10 +174,10 @@ function loadGraphs() {
174 174
                 data:[
175 175
                     @foreach($outcomes as $outcome)
176 176
                     <?php
177
-Log::info($grouped_outcomes_attempted_results[$index]);
178
-Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
179
-
180
-Log::info($grouped_outcomes_attempted_results[$index][$outcome->id]);
177
+// Log::info($grouped_outcomes_attempted_results[$index]);
178
+// Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
179
+// 
180
+// Log::info($grouped_outcomes_attempted_results[$index][$outcome->id]);
181 181
                          
182 182
                     ?>
183 183
                         @if(