Browse Source

resolviendo bugs

parent
commit
4da673f90d

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

141
 				return Redirect::to('objectives')->withInput();
141
 				return Redirect::to('objectives')->withInput();
142
 
142
 
143
 			case 2:
143
 			case 2:
144
-				return Redirect::to('school-objectives')->withInput();
144
+				return Redirect::to('school-objective')->withInput();
145
 
145
 
146
 			case 3:
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 View File

13
     public function overview()
13
     public function overview()
14
     {
14
     {
15
         $title = 'My Courses';
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
         $semesters = Session::get('semesters_ids');
17
         $semesters = Session::get('semesters_ids');
18
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
18
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
19
         Log::info($semesters->start);
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
             ->whereNull('deleted_at')
21
             ->whereNull('deleted_at')
22
             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
22
             ->whereRaw("(deactivation_date IS NULL or deactivation_date >= '{$semesters->start}')")
23
             ->orderBy('name', 'ASC')->get();
23
             ->orderBy('name', 'ASC')->get();
24
         $outcomeCount = count($outcomes);
24
         $outcomeCount = count($outcomes);
25
 
25
 
26
-
26
+Log::info($grouped_courses);
27
         $grouped_outcomes_achieved_results = array();
27
         $grouped_outcomes_achieved_results = array();
28
         $grouped_outcomes_attempted_results = array();
28
         $grouped_outcomes_attempted_results = array();
29
         $grouped_sections = array();
29
         $grouped_sections = array();
38
             $outcomes_attempted = [];
38
             $outcomes_attempted = [];
39
 
39
 
40
             // Find sections belonging to user with identifier of one course
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
                 ->where('code', $grouped_course->code)
43
                 ->where('code', $grouped_course->code)
43
                 ->whereIn('semester_id', Session::get('semesters_ids'))
44
                 ->whereIn('semester_id', Session::get('semesters_ids'))
44
                 ->where('number', $grouped_course->number)
45
                 ->where('number', $grouped_course->number)
45
                 ->where('semester_id', $grouped_course->semester_id)
46
                 ->where('semester_id', $grouped_course->semester_id)
46
                 ->get();
47
                 ->get();
47
 
48
 
49
+// 			        Log::info($sections);
50
+			        
48
             // For each of the professor's course sections, add the attempted and achieved criteria per outcome
51
             // For each of the professor's course sections, add the attempted and achieved criteria per outcome
49
             foreach ($sections as $section) {
52
             foreach ($sections as $section) {
50
 
53
 
94
         $program_courses = Course::where('program_id', '=', $program->id)->whereIn('semester_id', Session::get('semesters_ids'))->get();
97
         $program_courses = Course::where('program_id', '=', $program->id)->whereIn('semester_id', Session::get('semesters_ids'))->get();
95
         $semesters = Session::get('semesters_ids');
98
         $semesters = Session::get('semesters_ids');
96
         $semesters = DB::table('semesters')->whereIn('id', $semesters)->orderBy('start', 'ASC')->first();
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
         $outcomes_achieved = [];
109
         $outcomes_achieved = [];
104
         $outcomes_attempted = [];
110
         $outcomes_attempted = [];
105
 
111
 

+ 6
- 3
app/controllers/RubricsController.php View File

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

+ 9
- 3
app/views/local/managers/admins/view_template.blade.php View File

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

+ 8
- 3
app/views/local/professors/activity.blade.php View File

199
                 {{ HTML::linkAction('RubricsController@newRubric', 'Assign Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
199
                 {{ HTML::linkAction('RubricsController@newRubric', 'Assign Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
200
                 <!--{{ HTML::linkAction('RubricsController@newOtherMethod', 'Assign Other Assessment Method', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}-->
200
                 <!--{{ HTML::linkAction('RubricsController@newOtherMethod', 'Assign Other Assessment Method', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}-->
201
             @else
201
             @else
202
-
202
+				@if(count($activity->rubric) != 0)
203
                 {{ HTML::linkAction('RubricsController@show', 'View Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
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
                 <!-- If semester is active, allow users to change rubrics -->
207
                 <!-- If semester is active, allow users to change rubrics -->
206
                 @if (in_array($course->semester->id, $active_semesters))
208
                 @if (in_array($course->semester->id, $active_semesters))
207
                 {{ HTML::linkAction('RubricsController@newRubric', 'Change Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
209
                 {{ HTML::linkAction('RubricsController@newRubric', 'Change Rubric', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
211
                 @if(!$activity->is_assessed() && in_array($course->semester->id, $active_semesters))
213
                 @if(!$activity->is_assessed() && in_array($course->semester->id, $active_semesters))
212
                     {{ HTML::linkAction('ActivitiesController@assess', 'Assess', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
214
                     {{ HTML::linkAction('ActivitiesController@assess', 'Assess', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
213
                 @else
215
                 @else
216
+                	 @if($activity->is_assessed())
214
                     {{ HTML::linkAction('ActivitiesController@viewAssessment', 'View Assessment Sheet', array($activity->id), array('class'=>'btn btn-primary btn-sm btn-block')) }}
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
                     <!-- If semester is active, allow users to edit assessments -->
222
                     <!-- If semester is active, allow users to edit assessments -->
218
                     @if (in_array($course->semester->id, $active_semesters))
223
                     @if (in_array($course->semester->id, $active_semesters))

+ 2
- 1
app/views/local/professors/assessment.blade.php View File

139
                         <!-- For each criterion in the rubric, there's a score field -->
139
                         <!-- For each criterion in the rubric, there's a score field -->
140
                         @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
140
                         @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
141
                             <td class="score-field">
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
                                 <!-- Option from 0-8 -->
144
                                 <!-- Option from 0-8 -->
144
                                 
145
                                 
145
                                 @for ($j=0; $j<=$rubric->max_score; $j++)
146
                                 @for ($j=0; $j<=$rubric->max_score; $j++)

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

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

+ 7
- 1
app/views/local/professors/rubrics.blade.php View File

48
       <input id="activity_id" type="hidden" value="{{{ $activity->id}}}">
48
       <input id="activity_id" type="hidden" value="{{{ $activity->id}}}">
49
 
49
 
50
       <div class="form-group">
50
       <div class="form-group">
51
+        @if($activity->draft)
51
         <label>Select a Rubric:</label>
52
         <label>Select a Rubric:</label>
52
         <select id="select-template" class="form-control selectpicker">
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
           @foreach ($templates as $template)
58
           @foreach ($templates as $template)
54
             @if(count($activity->rubric)!=0 && $template->name == Rubric::find($activity->rubric[0]->id)->name)
59
             @if(count($activity->rubric)!=0 && $template->name == Rubric::find($activity->rubric[0]->id)->name)
55
               <option data-template-id="{{ $template->id }}" class="template" selected="selected">{{ $template->name }}</option>
60
               <option data-template-id="{{ $template->id }}" class="template" selected="selected">{{ $template->name }}</option>
84
 <div id="rubric-container" class="row">
89
 <div id="rubric-container" class="row">
85
   <div class="col-md-12">
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
       <thead><tr><th colspan="6 "><h3 id="rubric-name"></h3></th></tr></thead>
94
       <thead><tr><th colspan="6 "><h3 id="rubric-name"></h3></th></tr></thead>
89
       <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>
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
       <tbody>
96
       <tbody>

+ 2
- 1
app/views/local/professors/viewrubric.blade.php View File

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