Parcourir la source

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

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

+ 2
- 2
app/controllers/Objective2Controller.php Voir le fichier

@@ -141,10 +141,10 @@ class Objective2Controller extends \BaseController
141 141
 				return Redirect::to('objectives')->withInput();
142 142
 
143 143
 			case 2:
144
-				return Redirect::to('school-objectives')->withInput();
144
+				return Redirect::to('school-objective')->withInput();
145 145
 
146 146
 			case 3:
147
-				return Redirect::to('program-objectives')->withInput();
147
+				return Redirect::to('program-objective')->withInput();
148 148
 		}
149 149
 	}
150 150
 	/**

+ 16
- 10
app/controllers/ProfessorsController.php Voir le fichier

@@ -13,17 +13,17 @@ class ProfessorsController extends \BaseController
13 13
     public function overview()
14 14
     {
15 15
         $title = 'My Courses';
16
-        $grouped_courses = Course::where('user_id', Auth::user()->id)->whereIn('semester_id', Session::get('semesters_ids'))->groupBy(array('code', 'number', 'semester_id'))->get();
16
+        $grouped_courses = Course::with('program')->where('user_id', Auth::user()->id)->whereIn('semester_id', Session::get('semesters_ids'))->groupBy(array('code', 'number', 'semester_id'))->get();
17 17
         $semesters = Session::get('semesters_ids');
18 18
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
19 19
         Log::info($semesters->start);
20
-        $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
20
+        $outcomes = Outcome::select(array('id', 'name', 'expected_outcome', 'level'))
21 21
             ->whereNull('deleted_at')
22 22
             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
23 23
             ->orderBy('name', 'ASC')->get();
24 24
         $outcomeCount = count($outcomes);
25 25
 
26
-
26
+Log::info($grouped_courses);
27 27
         $grouped_outcomes_achieved_results = array();
28 28
         $grouped_outcomes_attempted_results = array();
29 29
         $grouped_sections = array();
@@ -38,13 +38,16 @@ class ProfessorsController extends \BaseController
38 38
             $outcomes_attempted = [];
39 39
 
40 40
             // Find sections belonging to user with identifier of one course
41
-            $sections = Course::where('user_id', Auth::user()->id)
41
+            $sections = Course::with('program')
42
+            	->where('user_id', Auth::user()->id)
42 43
                 ->where('code', $grouped_course->code)
43 44
                 ->whereIn('semester_id', Session::get('semesters_ids'))
44 45
                 ->where('number', $grouped_course->number)
45 46
                 ->where('semester_id', $grouped_course->semester_id)
46 47
                 ->get();
47 48
 
49
+// 			        Log::info($sections);
50
+			        
48 51
             // For each of the professor's course sections, add the attempted and achieved criteria per outcome
49 52
             foreach ($sections as $section) {
50 53
 
@@ -94,12 +97,15 @@ class ProfessorsController extends \BaseController
94 97
         $program_courses = Course::where('program_id', '=', $program->id)->whereIn('semester_id', Session::get('semesters_ids'))->get();
95 98
         $semesters = Session::get('semesters_ids');
96 99
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
97
-
98
-        $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
99
-            ->whereNull('deleted_at')
100
-            ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
101
-            ->orderBy('name', 'ASC')->get();
102
-        $outcomeCount = count($outcomes);
100
+        $semesters2 = Semester::whereIn('id',Session::get('semesters_ids'))->get();
101
+
102
+//         $outcomes = Outcome::select(array('id', 'name', 'expected_outcome'))
103
+//         	->where('level','=',)
104
+//             ->whereNull('deleted_at')
105
+//             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
106
+//             ->orderBy('name', 'ASC')->get();
107
+        $outcomes = Outcome::active_by_semesters($semesters2, $program->is_graduate);
108
+	    $outcomeCount = count($outcomes);
103 109
         $outcomes_achieved = [];
104 110
         $outcomes_attempted = [];
105 111
 

+ 6
- 3
app/controllers/RubricsController.php Voir le fichier

@@ -33,7 +33,8 @@ class RubricsController extends \BaseController
33 33
         $outcomes = Outcome::orderBy('name', 'ASC')->get();
34 34
         $criteria = Criterion::orderBy('name', 'ASC')->get();
35 35
         $rubric = $activity->rubric;
36
-        Log::info($rubric);
36
+//         $draft=$activity->draft;
37
+//         Log::info("*****".$activity);
37 38
 
38 39
 
39 40
 
@@ -318,13 +319,15 @@ class RubricsController extends \BaseController
318 319
     {
319 320
         $activity = Activity::find($activity_id);
320 321
         // Get activity's course
322
+//         Log::info("actv".$activity);
321 323
         $course = Course::where('id', '=', $activity->course_id)->firstOrFail();
324
+//         Log::info("user".$course->user_id);
322 325
 
323 326
         // If activity does not belong to the requesting user, display 403
324 327
         if ($course->user_id != Auth::id())
325 328
             App::abort('403', 'Access Forbidden');
326
-        Log::info($activity->rubric[0]->id);
327
-
329
+//         Log::info("rubric".$activity->rubric);
330
+// exit();
328 331
         $rubric = Rubric::where('id', '=', $activity->rubric[0]->id)->firstOrFail();
329 332
         $rubric_criterion = DB::table('criteria')
330 333
             ->join('rubric_criterion', 'rubric_criterion.criterion_id', '=', 'criteria.id')

+ 9
- 3
app/views/local/managers/admins/view_template.blade.php Voir le fichier

@@ -1,7 +1,13 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-  @include('local.managers.admins._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
 
7 13
 @section('main')
@@ -17,7 +23,7 @@
17 23
       <span id="expected_points">{{{$template->expected_points}}}</span> points
18 24
     </p>
19 25
 
20
-    <table class="table table-striped table-condensed datatable" id= "RubricTable">
26
+    <table class="table datatable" id= "RubricTable">
21 27
       <thead>
22 28
           <tr>
23 29
             <th></th>
@@ -56,7 +62,7 @@
56 62
 @endforeach
57 63
 <td><ol>
58 64
 @foreach ($criterion->outcomes as $outcome)
59
-    <li>{{$outcome->name}}</li>
65
+    <p>{{$outcome->name}}</p>
60 66
 @endforeach
61 67
 </ol></td>
62 68
         @endforeach

+ 8
- 3
app/views/local/professors/activity.blade.php Voir le fichier

@@ -199,9 +199,11 @@
199 199
                 {{ HTML::linkAction('RubricsController@newRubric', 'Assign Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
200 200
                 <!--{{ HTML::linkAction('RubricsController@newOtherMethod', 'Assign Other Assessment Method', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}-->
201 201
             @else
202
-
202
+				@if(count($activity->rubric) != 0)
203 203
                 {{ HTML::linkAction('RubricsController@show', 'View Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
204
-
204
+                @else
205
+                <h5>No rubric associated to this activity</h5>
206
+				@endif
205 207
                 <!-- If semester is active, allow users to change rubrics -->
206 208
                 @if (in_array($course->semester->id, $active_semesters))
207 209
                 {{ HTML::linkAction('RubricsController@newRubric', 'Change Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
@@ -211,8 +213,11 @@
211 213
                 @if(!$activity->is_assessed() && in_array($course->semester->id, $active_semesters))
212 214
                     {{ HTML::linkAction('ActivitiesController@assess', 'Assess', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
213 215
                 @else
216
+                	 @if($activity->is_assessed())
214 217
                     {{ HTML::linkAction('ActivitiesController@viewAssessment', 'View Assessment Sheet', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
215
-
218
+                @else
219
+                <h5>No assessment associated to this activity</h5>
220
+				@endif
216 221
 
217 222
                     <!-- If semester is active, allow users to edit assessments -->
218 223
                     @if (in_array($course->semester->id, $active_semesters))

+ 2
- 1
app/views/local/professors/assessment.blade.php Voir le fichier

@@ -139,7 +139,8 @@
139 139
                         <!-- For each criterion in the rubric, there's a score field -->
140 140
                         @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
141 141
                             <td class="score-field">
142
-                                <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}">
142
+                                <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}} 
143
+{{{ $rubric_criterion[$i]->name }}}">
143 144
                                 <!-- Option from 0-8 -->
144 145
                                 
145 146
                                 @for ($j=0; $j<=$rubric->max_score; $j++)

+ 14
- 3
app/views/local/professors/overview.blade.php Voir le fichier

@@ -117,7 +117,9 @@ function loadGraphs() {
117 117
             xAxis: {
118 118
                 categories: [
119 119
                     @foreach($outcomes as $outcome)
120
+                    	@if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
120 121
                         "{{{ $outcome->name }}}",
122
+                        @endif
121 123
                     @endforeach
122 124
                 ],
123 125
                 labels: {
@@ -177,9 +179,15 @@ function loadGraphs() {
177 179
 // Log::info($grouped_outcomes_attempted_results[$index]);
178 180
 // Log::info(array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index]));
179 181
 // 
180
-// Log::info($grouped_outcomes_attempted_results[$index][$outcome->id]);
181
-                         
182
+
183
+// Log::info($grouped_course);
184
+// Log::info($outcome->level);
185
+// Log::info($grouped_course->is_graduate);
186
+// Log::info($grouped_course->is_graduate==0);
187
+// Log::info($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1));
188
+//                          
182 189
                     ?>
190
+					@if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
183 191
                         @if(
184 192
                             is_array($grouped_outcomes_attempted_results[$index])
185 193
                             && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
@@ -188,6 +196,7 @@ function loadGraphs() {
188 196
                         @else
189 197
                             0,
190 198
                         @endif
199
+                        @endif
191 200
                     @endforeach
192 201
                 ],
193 202
                 pointPadding: 0,
@@ -207,7 +216,8 @@ function loadGraphs() {
207 216
                 },
208 217
                 data: [
209 218
                     @foreach($outcomes as $outcome)
210
-                        @if(
219
+   					@if($outcome->level==3 || ($grouped_course->program->is_graduate==0 && $outcome->level==1))
220
+                     @if(
211 221
                             is_array($grouped_outcomes_attempted_results[$index])
212 222
                             && array_key_exists($outcome->id, $grouped_outcomes_attempted_results[$index])
213 223
                             && $grouped_outcomes_attempted_results[$index][$outcome->id]!=0)
@@ -215,6 +225,7 @@ function loadGraphs() {
215 225
                         @else
216 226
                             0,
217 227
                         @endif
228
+                        @endif
218 229
                     @endforeach
219 230
                 ],
220 231
                 pointPadding: 0,

+ 7
- 1
app/views/local/professors/rubrics.blade.php Voir le fichier

@@ -48,8 +48,13 @@
48 48
       <input id="activity_id" type="hidden" value="{{{ $activity->id}}}">
49 49
 
50 50
       <div class="form-group">
51
+        @if($activity->draft)
51 52
         <label>Select a Rubric:</label>
52 53
         <select id="select-template" class="form-control selectpicker">
54
+        @else
55
+        <label>Rubric (Assessment was published):</label>
56
+        <select id="select-template" class="form-control selectpicker" disabled>
57
+        @endif
53 58
           @foreach ($templates as $template)
54 59
             @if(count($activity->rubric)!=0 && $template->name == Rubric::find($activity->rubric[0]->id)->name)
55 60
               <option data-template-id="{{ $template->id }}" class="template" selected="selected">{{ $template->name }}</option>
@@ -84,7 +89,8 @@
84 89
 <div id="rubric-container" class="row">
85 90
   <div class="col-md-12">
86 91
 
87
-    <table class="table" style="table-layout: fixed">
92
+<!--     <table class="table" style="table-layout: fixed"> -->
93
+    <table class="table  table-striped table-condensed">
88 94
       <thead><tr><th colspan="6 "><h3 id="rubric-name"></h3></th></tr></thead>
89 95
       <thead><tr id ="criterion-header"><th>Criterion</th><th>Beginning (1-2)</th><th>In Progress (3-4)</th><th>Good (5-6)</th><th>Excellent (7-8)</th></tr></thead>
90 96
       <tbody>

+ 2
- 1
app/views/local/professors/viewrubric.blade.php Voir le fichier

@@ -75,7 +75,8 @@
75 75
             <td>
76 76
             
77 77
             @foreach (json_decode($criterion->outcomes) as $index => $outcome)
78
-            {{$index+1}}. {{$outcome}}<br>                 
78
+<!--             {{$index+1}}. {{$outcome}}<br>                  -->
79
+            {{$outcome}}<br>                 
79 80
             @endforeach  
80 81
             </td>
81 82
           </tr>