Browse Source

Unos bugs

parent
commit
8352391314
3 changed files with 17 additions and 5 deletions
  1. 1
    1
      app/controllers/ProgramCoordinatorsController.php
  2. 4
    4
      app/filters.php
  3. 12
    0
      app/models/Program.php

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

14
         return Redirect::to('administrator');
14
         return Redirect::to('administrator');
15
         break;
15
         break;
16
       case 2:
16
       case 2:
17
-        return Redirect::to('school-coordinator');
17
+        return Redirect::to('school/' . Auth::user()->school->id);
18
         break;
18
         break;
19
     }
19
     }
20
     //Log::info(Auth::user()->programs);
20
     //Log::info(Auth::user()->programs);

+ 4
- 4
app/filters.php View File

77
 				break;
77
 				break;
78
 
78
 
79
 			case 2:
79
 			case 2:
80
-				return Redirect::to('school-coordinator');
80
+				return Redirect::to('school/' . Auth::user()->school->id);
81
 				break;
81
 				break;
82
 
82
 
83
 			case 3:
83
 			case 3:
105
 	if (Auth::user()->role != 1) {
105
 	if (Auth::user()->role != 1) {
106
 		switch (Auth::user()->role) {
106
 		switch (Auth::user()->role) {
107
 			case 2:
107
 			case 2:
108
-				return Redirect::to('school-coordinator');
108
+				return Redirect::to('school/' . Auth::user()->school->id);
109
 				break;
109
 				break;
110
 
110
 
111
 			case 3:
111
 			case 3:
181
 				break;
181
 				break;
182
 
182
 
183
 			case 2:
183
 			case 2:
184
-				return Redirect::to('school-coordinator');
184
+				return Redirect::to('school/' . Auth::user()->school->id);
185
 				break;
185
 				break;
186
 
186
 
187
 			case 3:
187
 			case 3:
207
 	if (Session::token() !== $token) {
207
 	if (Session::token() !== $token) {
208
 		throw new Illuminate\Session\TokenMismatchException;
208
 		throw new Illuminate\Session\TokenMismatchException;
209
 	}
209
 	}
210
-});
210
+});

+ 12
- 0
app/models/Program.php View File

145
 					$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
145
 					$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
146
 				}
146
 				}
147
 			}
147
 			}
148
+			//Log::info("ESTOY LOCO POR TI");
149
+			//Log::info($the_processed_table);
148
 
150
 
151
+			$out_att = [];
152
+			$out_ach = [];
153
+
154
+			foreach ($outcomes as $outcome) {
155
+				$out_att[$outcome->id] = 0;
156
+				$out_ach[$outcome->id] = 0;
157
+			}
149
 
158
 
150
 			foreach ($the_processed_table as $student_id => $outcome_ids) {
159
 			foreach ($the_processed_table as $student_id => $outcome_ids) {
160
+				//Log::info("AQUI");
161
+				//Log::info($outcome_ids);
151
 				foreach ($outcome_ids as $outcome_id => $crit_information) {
162
 				foreach ($outcome_ids as $outcome_id => $crit_information) {
163
+					Log::info($crit_information);
152
 					$crit_att = $crit_information['criteria_attempted'];
164
 					$crit_att = $crit_information['criteria_attempted'];
153
 					$crit_ach = $crit_information['criteria_achieved'];
165
 					$crit_ach = $crit_information['criteria_achieved'];
154
 
166