Browse Source

parear crit de rubricas a obj, y import annual a rubr

parent
commit
a5dd5ed254

+ 2
- 2
app/config/app.php View File

@@ -15,8 +15,8 @@ return array(
15 15
 
16 16
 	//'debug' => $_ENV['APP_DEBUG'] ?: false,
17 17
 
18
-	//'debug' => true,
19
-	'debug' => false,
18
+	'debug' => true,
19
+	//'debug' => false,
20 20
 	/*
21 21
 	|--------------------------------------------------------------------------
22 22
 	| Application URL

+ 58
- 0
app/controllers/AnnualPlansController.php View File

@@ -1506,4 +1506,62 @@ class AnnualPlansController extends \BaseController
1506 1506
     }
1507 1507
     return 200;
1508 1508
   }
1509
+
1510
+  function fetchOutcomesFromPlan()
1511
+  {
1512
+    $annual_plan = Input::get('annual_plan_id');
1513
+    $annual_plan = AnnualPlan::where('id', $annual_plan)->first();
1514
+
1515
+    return $annual_plan->outcomes;
1516
+  }
1517
+  function fetchObjectivesFromPlan()
1518
+  {
1519
+    $program_id = Input::get('program_id');
1520
+    $typ_semester_outcome_id = Input::get('typ_semester_outcome_id');
1521
+
1522
+    $outcome_id = Input::get('outcome_id');
1523
+    $semester_id = Input::get("semester_id");
1524
+    $outcome = Outcome::where('id', $outcome_id)
1525
+      ->select('outcomes.*', DB::raw("{$semester_id} as semester_id, {$typ_semester_outcome_id} as typ_semester_outcome_id, {$program_id} as program_id"))
1526
+      ->first();
1527
+    Log::info(array($outcome));
1528
+    return $outcome->annual_objectives;
1529
+  }
1530
+
1531
+  function fetchSemestersFromPlan()
1532
+  {
1533
+    $annual_plan = Input::get('annual_plan_id');
1534
+    $annual_plan = AnnualPlan::where('id', $annual_plan)->first();
1535
+    return $annual_plan->semesters;
1536
+  }
1537
+
1538
+  function fetchCoursesFromPlanForTemplate()
1539
+  {
1540
+    $annual_plan = Input::get('annual_plan_id');
1541
+    $semester = Input::get('semester_id');
1542
+    $annual_plan = AnnualPlan::select('annual_plans.*', DB::raw("{$semester} as for_template"))
1543
+      ->where('id', $annual_plan)->first();
1544
+    return $annual_plan->courses;
1545
+  }
1546
+  function fetchCriteriaFromPlan()
1547
+  {
1548
+    $course_id = Input::get('course_id');
1549
+    $annual_plan_id = Input::get('annual_plan');
1550
+    $max_score = Input::get('max_score');
1551
+    $number_of_scales = Input::get('number_of_scales');
1552
+
1553
+    $criteria = DB::table('criteria')
1554
+      ->join('annual_plan_objective', 'annual_plan_objective.criteria_id', '=', 'criteria.id')
1555
+      ->join('typ_semester_courses', 'typ_semester_course_id', '=', 'typ_semester_courses.id')
1556
+      ->where('typ_semester_courses.course_id', $course_id)
1557
+      ->where('annual_plan_objective.annual_plan_id', $annual_plan_id)
1558
+      ->where('criteria.max_score', $max_score)
1559
+      ->where('criteria.num_scales', $number_of_scales)
1560
+      ->groupBy('criteria.id')
1561
+      ->select('criteria.*')
1562
+      ->get();
1563
+
1564
+
1565
+    return $criteria;
1566
+  }
1509 1567
 }

+ 3
- 3
app/controllers/AuthController.php View File

@@ -28,9 +28,9 @@ class AuthController extends \BaseController
28 28
 
29 29
 		if (!$validator->fails()) {
30 30
 			//			TODO: Remove this for production environment
31
-			//if (App::environment('local', 'staging')) {
32
-			//	return $this->processLogin();
33
-			//}
31
+			if (App::environment('local', 'staging')) {
32
+				return $this->processLogin();
33
+			}
34 34
 			try {
35 35
 				// User input
36 36
 				$username = str_replace('@upr.edu', '', Input::get('email'));

+ 89
- 16
app/controllers/CriteriaController.php View File

@@ -206,33 +206,38 @@ class CriteriaController extends \BaseController
206 206
             $json['outcomes_assoc'][$outId] = DB::select("select name from outcomes where id = {$outId}");
207 207
             $json['objectives_assoc'][$outId] = DB::select("select objectives.id, objectives.text, outcomes.name from objectives, objective_outcome, outcomes where  objective_outcome.outcome_id ={$outId} and objective_outcome.objective_id = objectives.id and objectives.active=1 and outcomes.id = objective_outcome.outcome_id");
208 208
         }*/
209
+        $userRole = Auth::user()['role'];
210
+        switch ($userRole) {
211
+            case 1:
212
+                $program_ids = DB::table('programs')->lists('id');
213
+                break;
214
+            case 2:
215
+                $program_ids = DB::table('programs')
216
+                    ->where('school_id', Auth::user()->school_id)
217
+                    ->lists('id');
218
+                break;
219
+            case 3:
220
+            case 4:
221
+                $program_ids = DB::table('program_user')
222
+                    ->where('user_id', Auth::user()->id)
223
+                    ->lists('program_id');
224
+                break;
225
+        }
209 226
         $criteria_id = Input::get('id');
210 227
         $criterion =  DB::table('criteria')->where('id', Input::get('id'))->first();
211 228
         if (!$criterion) return $criterion;
212 229
         $criterion->outcomes = DB::table('criterion_objective_outcome')
213 230
             ->join('outcomes', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
231
+            ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
232
+            ->whereIn("program_id", $program_ids)
214 233
             ->where('criterion_id', $criterion->id)
215 234
             ->select('outcomes.*')
216 235
             ->distinct()
217 236
             ->get();
218
-        $userRole = Auth::user()['role'];
237
+
219 238
 
220 239
         foreach ($criterion->outcomes as $outcome) {
221
-            switch ($userRole) {
222
-                case 1:
223
-                    $program_ids = DB::table('programs')->lists('id');
224
-                    break;
225
-                case 2:
226
-                    $program_ids = DB::table('programs')
227
-                        ->where('school_id', Auth::user()->school_id)
228
-                        ->lists('id');
229
-                    break;
230
-                case 3:
231
-                    $program_ids = DB::table('program_user')
232
-                        ->where('user_id', Auth::user()->id)
233
-                        ->lists('program_id');
234
-                    break;
235
-            }
240
+
236 241
             $outcome->assoc_objectives = DB::table('objective_outcome')
237 242
                 ->join('objectives', 'objectives.id', '=', 'objective_outcome.objective_id')
238 243
                 ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
@@ -242,10 +247,15 @@ class CriteriaController extends \BaseController
242 247
                 ->distinct()
243 248
                 ->get();
244 249
             $outcome->objectives_criteria = DB::table('criterion_objective_outcome')
250
+                ->join("program_criterion_objective_outcome as poco", 'poco.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
245 251
                 ->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
246 252
                 ->where('criterion_id', $criterion->id)
253
+                ->whereIn("poco.program_id", $program_ids)
247 254
                 ->where('outcome_id', $outcome->id)
255
+                ->select('objectives.*', 'objectives.id as objective_id')
256
+                ->distinct()
248 257
                 ->get();
258
+
249 259
             foreach ($outcome->assoc_objectives as $objective) {
250 260
                 $objective->program_ids = json_encode(DB::table('objective_program')
251 261
                     ->where('objective_id', $objective->id)
@@ -540,6 +550,7 @@ class CriteriaController extends \BaseController
540 550
 
541 551
 
542 552
             /** If criterion is saved, send success message */
553
+            Log::info(Input::all());
543 554
             if ($criterion->save()) {
544 555
 
545 556
                 $criterionId = $criterion->id;
@@ -557,6 +568,7 @@ class CriteriaController extends \BaseController
557 568
                             "criterion_id" => $criterionId
558 569
                         ));
559 570
 
571
+
560 572
                     foreach ($clean_input['program_id'] as $program_id) {
561 573
                         DB::table('program_criterion_objective_outcome')
562 574
                             ->insert(array(
@@ -1185,4 +1197,65 @@ class CriteriaController extends \BaseController
1185 1197
                 break;
1186 1198
         }
1187 1199
     }
1200
+
1201
+    public function fetchFromTemplate()
1202
+    {
1203
+
1204
+        $role = Auth::user()->role;
1205
+
1206
+        $criterion_id = Input::get('criterion_id');
1207
+
1208
+        switch ($role) {
1209
+            case 1:
1210
+                $program_ids = Program::select('programs.*')->lists('id');
1211
+                break;
1212
+            case 2:
1213
+                $program_ids = Program::where("school_id", Auth::user()->school_id)->lists('id');
1214
+                break;
1215
+
1216
+            case 3:
1217
+            case 4:
1218
+                $program_ids = Program::whereIn('id', Auth::user()->programs->lists('id'));
1219
+                break;
1220
+        }
1221
+        $outcomes_paired_ids = DB::table('criterion_objective_outcome as cobo')
1222
+            ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1223
+            ->whereIn("program_id", $program_ids)
1224
+            ->where('criterion_id', $criterion_id)
1225
+            ->select('cobo.outcome_id')
1226
+            ->distinct()
1227
+            ->lists('cobo.outcome_id');
1228
+
1229
+
1230
+        $json = [];
1231
+        $json['outcomes'] = $outcomes_paired_ids;
1232
+        $json['objectives_available'] = DB::table('objectives')
1233
+            ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
1234
+            ->join('outcomes', 'outcomes.id', '=', 'outcome_id')
1235
+            ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
1236
+            ->whereIn("outcome_id", $outcomes_paired_ids)
1237
+            ->whereIn("program_id", $program_ids)
1238
+            ->where('objectives.id', '<>', 0)
1239
+            ->select('objectives.*')
1240
+            ->distinct()
1241
+
1242
+            ->get();
1243
+        $json['objectives_selected'] = DB::table('objectives')
1244
+            ->join('criterion_objective_outcome as cobo', 'cobo.objective_id', '=', 'objectives.id')
1245
+            ->join('outcomes', 'outcomes.id', '=', 'outcome_id')
1246
+
1247
+            ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1248
+            ->whereIn('outcome_id', $outcomes_paired_ids)
1249
+            ->whereIn("program_id", $program_ids)
1250
+            ->where('criterion_id', $criterion_id)
1251
+            ->where('objective_id', '<>', 0)
1252
+            ->select('objectives.*')
1253
+            //->groupBy('objectives.id', 'outcome_id')
1254
+            ->distinct()
1255
+            ->get();
1256
+
1257
+
1258
+
1259
+        return $json;
1260
+    }
1188 1261
 }

+ 177
- 1
app/controllers/Objective2Controller.php View File

@@ -64,6 +64,11 @@ class Objective2Controller extends \BaseController
64 64
 		$program_id = Input::get('program_id');
65 65
 		$old_cobo_id = Input::get('cobo_id');
66 66
 
67
+
68
+
69
+		//Log::info("Input de");
70
+		//Log::info(Input::all());
71
+
67 72
 		//criterio de holder. 
68 73
 
69 74
 
@@ -95,7 +100,7 @@ class Objective2Controller extends \BaseController
95 100
 			->where('cri_obj_out_id', $cri_obj_out_id)
96 101
 			->first();
97 102
 
98
-		if (isset($exists_pair)) {
103
+		if (isset($exists_pair) && $pcobo_id != $exists_pair->id) {
99 104
 			//se puede borrar la entrada
100 105
 			//porque el pareo de programa-criterio-dominio-holder ya existe, so borrar esta entrada borra duplicados. 
101 106
 
@@ -435,6 +440,7 @@ class Objective2Controller extends \BaseController
435 440
 
436 441
 	}
437 442
 
443
+
438 444
 	public function insertPCOBO()
439 445
 	{
440 446
 		//aqui entra si  le da a add criterio, y escoje uno nuevo
@@ -1090,4 +1096,174 @@ class Objective2Controller extends \BaseController
1090 1096
 	{
1091 1097
 		//
1092 1098
 	}
1099
+
1100
+	public function insertPCOBOFromTemplate()
1101
+	{
1102
+		$template_id = Input::get('template_id');
1103
+		$criterion_id = Input::get('criterion_id');
1104
+		$old_objective = Input::get("old_objective");
1105
+		$objective_id = Input::get('new_objective');
1106
+
1107
+		$template = Template::find($template_id);
1108
+		Log::info(Input::all());
1109
+		//admin
1110
+		if ($template->school_id == NULL) {
1111
+			$program_ids = DB::table('programs')->lists('id');
1112
+		}
1113
+		//school
1114
+		else if ($template->program_id == NULL) {
1115
+			$program_ids = DB::table('programs')
1116
+				->where('school_id', $template->school_id)
1117
+				->lists('id');
1118
+		}
1119
+		//program
1120
+		else {
1121
+			$program_ids = DB::table('programs')
1122
+				->where('id', $template->program_id)
1123
+				->lists('id');
1124
+		}
1125
+		$outcome_ids = DB::table('criterion_objective_outcome as cobo')
1126
+			->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1127
+			->whereIn('program_id', $program_ids)
1128
+			->where('criterion_id', $criterion_id)
1129
+			->select('cobo.outcome_id')
1130
+			->distinct()
1131
+			->lists('outcome_id');
1132
+
1133
+		foreach ($program_ids as $program_id) {
1134
+			foreach ($outcome_ids as $outcome_id) {
1135
+				Input::replace([
1136
+					'criterion_id' => $criterion_id,
1137
+					'objective_id' => $objective_id,
1138
+					'outcome_id' => $outcome_id,
1139
+					'program_id' => $program_id
1140
+				]);
1141
+				$this->insertPCOBO();
1142
+			}
1143
+		}
1144
+	}
1145
+
1146
+	public function updatePCOBOFromTemplate()
1147
+	{
1148
+		$template_id = Input::get('template_id');
1149
+		$criterion_id = Input::get('criterion_id');
1150
+		$old_objective = Input::get("old_objective");
1151
+		$new_objective_id = Input::get('new_objective');
1152
+		$template = Template::find($template_id);
1153
+
1154
+		if ($template->school_id == NULL) {
1155
+			$program_ids = DB::table('programs')->lists('id');
1156
+		} else if ($template->program_id == NULL) {
1157
+			$program_ids = DB::table('programs')
1158
+				->where('school_id', $template->school_id)
1159
+				->lists('id');
1160
+		} else {
1161
+			$program_ids = DB::table('programs')
1162
+				->where('id', $template->program_id)
1163
+				->lists('id');
1164
+		}
1165
+		$cobo_ids = DB::table('criterion_objective_outcome as cobo')
1166
+			->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1167
+			->whereIn('program_id', $program_ids)
1168
+			->where('criterion_id', $criterion_id)
1169
+			->where('objective_id', $old_objective)
1170
+			->select('cobo.*', 'poco.*', 'poco.id as poco_id')
1171
+			//->distinct()
1172
+			->get();
1173
+		Log::info($cobo_ids);
1174
+		foreach ($cobo_ids as $cobo_id) {
1175
+
1176
+
1177
+
1178
+
1179
+			Input::replace([
1180
+				'criterion_id' => $criterion_id,
1181
+				'objective_id' => $new_objective_id,
1182
+				'outcome_id' => $cobo_id->outcome_id,
1183
+				'program_id' => $cobo_id->program_id,
1184
+				'cobo_id' => $cobo_id->cri_obj_out_id,
1185
+				'pcobo_id' => $cobo_id->poco_id,
1186
+				'old_crit' => $criterion_id,
1187
+				'old_outcome' => $cobo_id->outcome_id,
1188
+				'old_cobo' => $cobo_id->cri_obj_out_id
1189
+
1190
+			]);
1191
+			$this->updatePCOBO();
1192
+		}
1193
+	}
1194
+
1195
+
1196
+	public function deletePCOBOFromTemplate()
1197
+	{
1198
+		$template_id = Input::get('template_id');
1199
+		$criterion_id = Input::get('criterion_id');
1200
+		$objective_id = Input::get('objective_id');
1201
+		$template = Template::find($template_id);
1202
+
1203
+		if ($template->school_id == NULL) {
1204
+			$program_ids = DB::table('programs')->lists('id');
1205
+		} else if ($template->program_id == NULL) {
1206
+			$program_ids = DB::table('programs')
1207
+				->where('school_id', $template->school_id)
1208
+				->lists('id');
1209
+		} else {
1210
+			$program_ids = DB::table('programs')
1211
+				->where('id', $template->program_id)
1212
+				->lists('id');
1213
+		}
1214
+		$cobo_ids = DB::table('criterion_objective_outcome as cobo')
1215
+			->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1216
+			->whereIn('program_id', $program_ids)
1217
+			->where('criterion_id', $criterion_id)
1218
+			->where('objective_id', $objective_id)
1219
+			->select('poco.*', 'cobo.*', 'poco.id as poco_id')
1220
+			->get();
1221
+
1222
+		Log::info($cobo_ids);
1223
+		/*$outcome_ids = DB::table('criterion_objective_outcome as cobo')
1224
+			->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1225
+			->whereIn('program_id', $program_ids)
1226
+			->where('criterion_id', $criterion_id)
1227
+			->select('cobo.outcome_id')
1228
+			->distinct()
1229
+			->lists('outcome_id');
1230
+		*/
1231
+		foreach ($cobo_ids as $cobo_id) {
1232
+			Input::replace([
1233
+				'criterion_id' => $criterion_id,
1234
+				'objective_id' => $objective_id,
1235
+				'outcome_id' => $cobo_id->outcome_id,
1236
+				'program_id' => $cobo_id->program_id,
1237
+				'cobo_id' => $cobo_id->cri_obj_out_id,
1238
+				'pcobo_id' => $cobo_id->poco_id
1239
+
1240
+			]);
1241
+			$this->deletePCOBO();
1242
+		}
1243
+		/*
1244
+		foreach ($program_ids as $program_id) {
1245
+			foreach ($outcome_ids as $outcome_id) {
1246
+				$old_cobo_id = DB::table('criterion_objective_outcome')
1247
+					->where('criterion_id', $criterion_id)
1248
+					->where('objective_id', $objective_id)
1249
+					->where('outcome_id', $outcome_id)
1250
+					->first();
1251
+				$pcobo_id = DB::table('program_criterion_objective_outcome')
1252
+					->where('program_id', $program_id)
1253
+					->where('cri_obj_out_id', $old_cobo_id->id)
1254
+					->first();
1255
+
1256
+				Input::replace([
1257
+					'criterion_id' => $criterion_id,
1258
+					'objective_id' => $objective_id,
1259
+					'outcome_id' => $outcome_id,
1260
+					'program_id' => $program_id,
1261
+					'cobo_id' => $old_cobo_id->id,
1262
+					'pcobo_id' => $pcobo_id
1263
+
1264
+				]);
1265
+				$this->deletePCOBO();
1266
+			}
1267
+		}*/
1268
+	}
1093 1269
 }

+ 125
- 9
app/controllers/TemplatesController.php View File

@@ -146,7 +146,33 @@ class TemplatesController extends \BaseController
146 146
 				->get();
147 147
 		}
148 148
 
149
-		return View::make('local.managers.admins.view_template', compact('template', 'title'));
149
+		$can_edit = false;
150
+		$user = Auth::user();
151
+
152
+		switch ($user->role) {
153
+			case 1:
154
+				$can_edit = true;
155
+
156
+				break;
157
+			case 2:
158
+				if ($template->school_id != NULL && $user->school_id == $template->school_id)
159
+					$can_edit = true;
160
+				break;
161
+
162
+			case 3:
163
+				if ($template->program_id != NULL && in_array($template->program_id, $user->programs->lists('id')))
164
+					$can_edit = true;
165
+				break;
166
+
167
+			default:
168
+
169
+				if ($template->user_id ==  $user->id)
170
+					$can_edit = true;
171
+				break;
172
+		}
173
+
174
+
175
+		return View::make('local.managers.admins.view_template', compact('template', 'title', 'can_edit'));
150 176
 	}
151 177
 
152 178
 	public function onLoadFetch()
@@ -185,14 +211,32 @@ class TemplatesController extends \BaseController
185 211
 		if ($role == 1) {
186 212
 			$templates = Template::orderBy('name', 'ASC')->get();
187 213
 			$programs = Program::orderBy('name', 'ASC')->get();
214
+			$program_ids =  Program::orderBy('name', 'ASC')->lists('id');
188 215
 		} elseif ($role == 2) {
189 216
 			$templates = Template::where('school_id', '=', Auth::user()->school->id)->orWhere('school_id', '=', NULL)->orderBy('name', 'ASC')->get();
190 217
 			$programs = Auth::user()->school->programs;
218
+			$program_ids = Auth::user()->school->programs->lists('id');
191 219
 		} elseif ($role == 3) {
192 220
 			$templates = Template::where('school_id', '=', Auth::user()->programs[0]->school->id)->orWhere('school_id', '=', NULL)->orderBy('name', 'ASC')->get();
193 221
 			$programs = Auth::user()->programs()->get();
222
+			$program_ids = Auth::user()->programs()->lists('id');
223
+		} else {
224
+			$templates = Template::where('user_id', Auth::user()->id);
225
+			$programs = Auth::user()->programs()->get();
226
+			$program_ids = Auth::user()->programs()->lists('id');
194 227
 		}
195 228
 
229
+		$annual_plans = DB::table('annual_plans')
230
+			->join('programs', 'programs.id', '=', 'program_id')
231
+			->join('annual_cycles', 'annual_cycle_id', '=', 'annual_cycles.id')
232
+			->select("programs.*", "annual_cycles.*", 'annual_plans.id as annual_plan_id')
233
+			->whereIn("program_id", $program_ids)
234
+			->orderBy('annual_cycle_id', 'DESC')
235
+			->orderBy('programs.name', 'ASC')
236
+			->get();
237
+		Log::info("NOus avons");
238
+		Log::info($annual_plans);
239
+
196 240
 		return View::make('local.managers.shared.rubrics', compact('title', 'templates', 'outcomes', 'criteria', 'schools', 'programs'));
197 241
 	}
198 242
 
@@ -211,22 +255,23 @@ class TemplatesController extends \BaseController
211 255
 
212 256
 		$templates = NULL;
213 257
 		$programs = NULL;
258
+
259
+
214 260
 		// Returns templates depending on the type of user
215 261
 		if ($role == 1) {
216 262
 			$templates = Template::orderBy('name', 'ASC')->get();
217 263
 			$programs = Program::orderBy('name', 'ASC')->get();
218 264
 			$criteria = Criterion::orderBy('name', 'ASC')->get();
219 265
 			$school_id_user = NULL;
266
+			$program_ids =  Program::orderBy('name', 'ASC')->lists('id');
220 267
 		} else {
221 268
 			if ($role == 2) {
222 269
 				$programs = Auth::user()->school->programs;
223 270
 				$school_id_user = Auth::user()->school_id;
224
-			}
225
-			if ($role == 3) {
271
+			} else if ($role == 3) {
226 272
 				$programs = Auth::user()->programs()->get();
227 273
 				$school_id_user = Auth::user()->programs[0]->school->id;
228
-			}
229
-			if ($role == 4) {
274
+			} else if ($role == 4) {
230 275
 				$programs = Auth::user()->programs()->get();
231 276
 				$school_id_user = Auth::user()->programs[0]->school->id;
232 277
 			}
@@ -235,6 +280,7 @@ class TemplatesController extends \BaseController
235 280
 			foreach ($programs as $program) {
236 281
 				$program_ids[] = $program->id;
237 282
 			}
283
+
238 284
 			$criteria = Criterion::whereHas(
239 285
 				'programs',
240 286
 				function ($q) use ($program_ids) {
@@ -276,6 +322,35 @@ class TemplatesController extends \BaseController
276 322
 		$templates_dentro = Template::whereNotIn('id', $templates_fuera_ids)
277 323
 			->orderBy('name', 'ASC')->get();
278 324
 
325
+
326
+		$annual_plans = DB::table('annual_cycle')
327
+			->join('annual_plans', 'annual_cycle_id', '=', 'annual_cycle.id')
328
+			->join('programs', 'programs.id', '=', 'annual_plans.program_id')
329
+			->join('typ_semester_outcome', function ($j) {
330
+				$j->on('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_start')
331
+					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
332
+			})
333
+			->join('typ_program', function ($j) {
334
+				$j->on('typ_program.program_id', '=', 'annual_plans.program_id')
335
+					->on('typ_program.id', '=', 'typ_semester_outcome.typ_program_id');
336
+			})
337
+			->whereIn('annual_plans.program_id', $program_ids)
338
+			->orderBy('annual_cycle_id', 'DESC')
339
+			->orderBy('programs.name', 'ASC')
340
+			->select("programs.*", 'programs.name as program_name', "annual_cycle.*", 'annual_plans.id as annual_plan_id')
341
+			->distinct()
342
+			->get();
343
+		/*$annual_plans = DB::table('annual_plans')
344
+			->join('programs', 'programs.id', '=', 'program_id')
345
+			->join('annual_cycle', 'annual_cycle_id', '=', 'annual_cycle.id')
346
+			->select("programs.*", 'programs.name as program_name', "annual_cycle.*", 'annual_plans.id as annual_plan_id')
347
+			->whereIn("program_id", $program_ids)
348
+			->orderBy('annual_cycle_id', 'DESC')
349
+			->orderBy('programs.name', 'ASC')
350
+			->get();
351
+		Log::info("NOus avons");
352
+		Log::info($annual_plans);*/
353
+
279 354
 		/*$templates_dentro = Template::join('template_criterion', 'template_criterion.template_id', '=', 'templates.id')
280 355
 			->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'template_criterion.criterion_id')
281 356
 			->where('objective_id', '<>', '0')
@@ -298,24 +373,65 @@ class TemplatesController extends \BaseController
298 373
 		// 		}
299 374
 
300 375
 		$templates_fuera = array();
301
-		return View::make('local.managers.shared.rubrics_new', compact('title', 'templates_dentro', 'templates_fuera', 'outcomes', 'criteria', 'schools', 'programs', 'criteria_ids'));
376
+		return View::make('local.managers.shared.rubrics_new', compact('annual_plans', 'title', 'templates_dentro', 'templates_fuera', 'outcomes', 'criteria', 'schools', 'programs', 'criteria_ids'));
302 377
 	}
303 378
 
304 379
 
305 380
 	public function fetchObjectivesForTemplate()
306 381
 	{
307 382
 		$criteria_ids = Input::get("allCriteria");
383
+		//program_id  only to solve for the rubric builder
384
+		$template_id = Input::get('template_id');
385
+
386
+		if (isset($template_id)) {
387
+			$template = Template::find($template_id);
388
+
389
+			if ($template->school_id == null) {
390
+				$program_ids = DB::table('programs')
391
+					->lists('programs.id');
392
+			} else if ($template->program_id == null) {
393
+				$program_ids = DB::table('programs')
394
+					->where('school_id', $template->school_id)->lists('programs.id');
395
+			} else {
396
+				$program_ids = DB::table('programs')
397
+					->where('program_id', $template->program_id)->lists('programs.id');
398
+			}
399
+		} else {
400
+			$role = Auth::user()->role;
401
+
402
+			switch ($role) {
403
+				case 1:
404
+					$program_ids = DB::table('programs')
405
+
406
+						->lists('programs.id');
407
+					break;
408
+				case 2:
409
+					$program_ids = DB::table('programs')
410
+						->where('school_id', Auth::user()->school_id)
411
+						->lists('programs.id');
412
+					break;
413
+				case 3:
414
+				case 4:
415
+					$program_ids = Auth::user()->programs->lists('id');
416
+					break;
417
+				default:
418
+					# code...
419
+					break;
420
+			}
421
+		}
422
+
308 423
 
309
-		$criteria = [];
310
-		//Acho im sorry pero no tengo idea porque sale un error que haría eso más eficiente.
311 424
 		foreach ($criteria_ids as $crit_id) {
312 425
 			$crit = Criterion::where('id', $crit_id)->first();
313 426
 			if (!isset($crit)) {
314 427
 				return "NO pa";
315 428
 			}
316 429
 
317
-			$crit->all_objectives = DB::table("objectives")->join("criterion_objective_outcome", 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
430
+			$crit->all_objectives = DB::table("objectives")
431
+				->join("criterion_objective_outcome", 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
432
+				->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
318 433
 				->where('criterion_id', $crit->id)
434
+				->whereIn("program_id", $program_ids)
319 435
 				->select('objectives.*')
320 436
 				->groupBy('objectives.id')
321 437
 				->get();

+ 27
- 4
app/models/AnnualPlan.php View File

@@ -21,6 +21,19 @@ class AnnualPlan extends \Eloquent
21 21
 
22 22
 	//
23 23
 
24
+	public function getSemestersAttribute()
25
+	{
26
+		$semester_ids = Semester::join('annual_cycle', function ($j) {
27
+			$j->on('semesters.id', '=', 'annual_cycle.semester_start')
28
+				->orOn('semesters.id', '=', 'annual_cycle.semester_end');
29
+		})
30
+			->where('annual_cycle.id', $this->annual_cycle_id)
31
+			->select('semesters.*')
32
+			->distinct()
33
+			->get();
34
+		return $semester_ids;
35
+	}
36
+
24 37
 	public function getCoursesAttribute()
25 38
 	{
26 39
 		/*
@@ -42,10 +55,12 @@ class AnnualPlan extends \Eloquent
42 55
 		Log::info("Aqui sql");
43 56
 
44 57
 		*/
45
-		return Course::join('typ_semester_courses', 'typ_semester_courses.course_id', '=', 'courses.id')
58
+		$courses = Course::join('typ_semester_courses', 'typ_semester_courses.course_id', '=', 'courses.id')
46 59
 			->join('typ_semester_objectives', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
47 60
 			->join("typ_semester_outcome", 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
61
+
48 62
 			->join("annual_cycle", function ($join) {
63
+
49 64
 				$join->on('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_start')
50 65
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
51 66
 			})
@@ -55,11 +70,18 @@ class AnnualPlan extends \Eloquent
55 70
 				$join->on('typ_program.program_id', '=', 'annual_plans.program_id')
56 71
 					->on('typ_program.id', '=', 'typ_semester_outcome.typ_program_id');
57 72
 			})
58
-
59 73
 			->where('annual_plans.program_id', $this->program_id)
60 74
 			->where('annual_plans.id', $this->id)
61
-			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
62
-			->get();
75
+			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id');
76
+
77
+		//En templateController, for_template lo defino como el semestre que estoy buscando
78
+		if (isset($this->for_template)) {
79
+			$courses = $courses->where('typ_semester_outcome.semester_id', $this->for_template)
80
+				->groupBy("courses.id")
81
+				->orderBy("courses.number");
82
+		}
83
+
84
+		return $courses->get();
63 85
 	}
64 86
 
65 87
 	//Aprendi luego que se puede hacer esto smh
@@ -113,6 +135,7 @@ class AnnualPlan extends \Eloquent
113 135
 			->where('annual_plans.id', $this->id)
114 136
 			->groupBy('outcomes.id', 'semester_id')
115 137
 			->orderBy('typ_semester_outcome.semester_id')
138
+			->orderBy("outcomes.name", 'ASC')
116 139
 			->select(
117 140
 				'outcomes.*',
118 141
 				'outcomes.id as outcome_id',

+ 6
- 5
app/models/Objective.php View File

@@ -25,11 +25,12 @@ class Objective extends Eloquent
25 25
 
26 26
     public function getPairedOutcomeAttribute()
27 27
     {
28
-        return Outcome::join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
29
-            ->join('typ_semester_objectives', 'typ_semester_objectives.typ_semester_outcome_id', '=', 'typ_semester_outcome.id')
30
-            ->where('typ_semester_objectives.id', $this->typ_semester_objective_id)
31
-            ->select('typ_semester_outcome.id as typ_semester_outcome_id', 'outcomes.*')
32
-            ->first();
28
+        if (isset($this->typ_semester_objective_id))
29
+            return Outcome::join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
30
+                ->join('typ_semester_objectives', 'typ_semester_objectives.typ_semester_outcome_id', '=', 'typ_semester_outcome.id')
31
+                ->where('typ_semester_objectives.id', $this->typ_semester_objective_id)
32
+                ->select('typ_semester_outcome.id as typ_semester_outcome_id', 'outcomes.*')
33
+                ->first();
33 34
     }
34 35
 
35 36
 

+ 2
- 3
app/models/Outcome.php View File

@@ -19,10 +19,9 @@ class Outcome extends Eloquent
19 19
 				->where('program_id', $this->program_id)
20 20
 				->where('semester_id', $this->semester_id)
21 21
 				->first();
22
-			//Log::info("PApi que hayy chabau");
23
-			//Log::info(array($expected_target));
22
+
24 23
 			if ($expected_target != null) {
25
-				//Log::info("PApi no chabau");
24
+
26 25
 				return $expected_target->expected_target;
27 26
 			} else return "Go to Annual Plan and define a target for learning outcome";
28 27
 		}

+ 34
- 3
app/routes.php View File

@@ -255,8 +255,13 @@ Route::group(array('before' => 'auth|has_access'), function () {
255 255
 
256 256
     Route::post('pairEveryObjective', "ThreeYearPlanController@pairEveryObjective");
257 257
     Route::post('pairEveryCourse', "ThreeYearPlanController@pairEveryCourse");
258
-    //View annual plans and report
259 258
 
259
+
260
+    //////////////////////////////////////
261
+    //
262
+    //View annual plans and report
263
+    //
264
+    ///////////////////////////////////
260 265
     Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");
261 266
     Route::get("findHTMLlinksAP/{type_of_annual}/{path_id}", "AnnualPlansController@findHTML");
262 267
 
@@ -326,9 +331,35 @@ Route::group(array('before' => 'auth|has_access'), function () {
326 331
         'uses' => 'CriteriaController@fetchAllCriterion'
327 332
     ));
328 333
 
334
+    ///////////////////////////
335
+    //
336
+    //  pair criteria from template
337
+    //
338
+    ///////////////////////////
339
+
340
+    Route::post('fetchFromTemplate', 'CriteriaController@fetchFromTemplate');
341
+    Route::post('insertPCOBOFromTemplate', 'Objective2Controller@insertPCOBOFromTemplate');
342
+    Route::post('deletePCOBOFromTemplate', 'Objective2Controller@deletePCOBOFromTemplate');
343
+    Route::post('updatePCOBOFromTemplate', 'Objective2Controller@updatePCOBOFromTemplate');
344
+
329 345
     Route::post('insertPCOBO', 'Objective2Controller@insertPCOBO');
330 346
 
331 347
 
348
+    /*//////////////////
349
+
350
+    Export criteria from annual plans, rubrics
351
+
352
+    */ ////////////////
353
+
354
+    Route::post('fetchOutcomesFromPlan', "AnnualPlansController@fetchOutcomesFromPlan");
355
+    Route::post('fetchObjectivesFromPlan', 'AnnualPlansController@fetchObjectivesFromPlan');
356
+    Route::post("fetchSemestersFromPlan", 'AnnualPlansController@fetchSemestersFromPlan');
357
+    Route::post('fetchCoursesFromPlanForTemplates', 'AnnualPlansController@fetchCoursesFromPlanForTemplate');
358
+    Route::post('fetchCriteriaFromPlan', 'AnnualPlansController@fetchCriteriaFromPlan');
359
+
360
+
361
+    ///////////////////////////////////////////////////////
362
+
332 363
     Route::get('viewFormative', array(
333 364
         'as' => 'viewFormative',
334 365
         'uses' => 'TransformativeActionsController@viewFormativeActions'
@@ -412,6 +443,8 @@ Route::group(array('before' => 'auth|has_access'), function () {
412 443
     Route::post('transformativeAction/updateTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@updateTA'));
413 444
     Route::post('transformativeAction/filterTA', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@filterTA'));
414 445
     Route::post('transformativeAction/objectivesFromOutcome', array('before' => 'csrf', 'uses' => 'TransformativeActionsController@objectivesFromOutcome'));
446
+    Route::post('criteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
447
+    Route::delete('critteria/delete', array('before' => 'csrf', 'uses' => 'CriteriaController@destroy'));
415 448
 
416 449
 
417 450
     //shared print_program and school
@@ -468,8 +501,6 @@ Route::group(array('before' => 'auth|has_access'), function () {
468 501
 
469 502
         Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@updateMore'));
470 503
         Route::post('learning-outcomes/delete', array('before' => 'csrf', 'uses' => 'OutcomesController@delete'));
471
-        Route::post('criteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
472
-        Route::delete('critteria/delete', array('before' => 'csrf', 'uses' => 'CriteriaController@destroy'));
473 504
 
474 505
         Route::get('administrator/users/{query?}', 'UsersController@index');
475 506
 

+ 12
- 1
app/views/global/view-objectives-criteria.blade.php View File

@@ -374,7 +374,12 @@
374 374
 
375 375
                 url= "{{URL::action('Objective2Controller@updatePCOBO')}}";
376 376
 
377
-
377
+                //
378
+                //
379
+                //  old-* son del select, guardan la informacion del criterio anterior
380
+                
381
+                //
382
+                //
378 383
                 old_crit = $(select).data('old-criterion')
379 384
                 old_outcome= $(select).data('old-outcome')
380 385
                 old_cobo = $(select).data('old-cobo')
@@ -490,6 +495,12 @@
490 495
             )
491 496
         }
492 497
 
498
+        //Leyenda, 
499
+        /*
500
+        
501
+
502
+        */
503
+
493 504
     
494 505
 
495 506
         function fetchCriteria(a){

+ 230
- 4
app/views/local/managers/admins/view_template.blade.php View File

@@ -40,6 +40,10 @@
40 40
             @endfor
41 41
             
42 42
             <th>Learning Outcome</th>
43
+            @if($can_edit)
44
+
45
+            <th>Show Objectives</th>
46
+            @endif
43 47
           </tr>
44 48
         </thead>
45 49
       <tbody id ="bodyRubric">
@@ -49,13 +53,13 @@
49 53
 
50 54
         @if($criterion->notes)
51 55
             
52
-          <td><span><em data-toggle="tooltip" data-placement="top" title="{{$criterion->notes}}">{{$criterion->name}}</em></span><sup></sup></td>
56
+          <td id='criterion-name'><span><em data-toggle="tooltip" data-placement="top" title="{{$criterion->notes}}">{{$criterion->name}}</em></span><sup></sup></td>
53 57
           
54 58
 
55 59
         
56 60
         @else
57 61
           
58
-          <td><span>{{$criterion->name}}</span><sup></sup></td>
62
+          <td id='criterion-name'><span>{{$criterion->name}}</span><sup></sup></td>
59 63
 
60 64
         
61 65
 @endif
@@ -69,8 +73,16 @@
69 73
     <p>{{$outcome->name}}</p>
70 74
 @endforeach
71 75
 </ol></td>
76
+@if($can_edit)
77
+  <td>
78
+          <a data-criterion-id = '{{$criterion->id}}' onclick = 'pairObjectivesModal(this)'>Show or pair objectives to Criteria</a>
79
+
80
+  </td>
81
+  @endif
82
+</tr>
72 83
         @endforeach
73 84
 
85
+
74 86
       </tbody>
75 87
     </table>
76 88
 
@@ -117,7 +129,220 @@
117 129
     </div><!-- /.modal-content -->
118 130
   </div><!-- /.modal-dialog -->
119 131
 </div>
120
-<script> 
132
+
133
+
134
+<div class="modal fade" id="pair-objectives">
135
+  <div class="modal-dialog modal-md">
136
+    <div class="modal-content">
137
+      <div class="modal-header">
138
+        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
139
+        <h4 class="modal-title text-center" id ="pair-objectives-title">Select objectives you want to pair</h4>
140
+      </div>
141
+        <div class="modal-body" id ="pair-objectives-body">
142
+          
143
+
144
+          
145
+          
146
+        </div>
147
+      <div class="modal-footer">
148
+            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
149
+
150
+      </div>
151
+    </div><!-- /.modal-content -->
152
+  </div><!-- /.modal-dialog -->
153
+</div>
154
+<script>
155
+function pairObjectivesModal(a){
156
+  criterion_id = $(a).data('criterion-id')
157
+  $.post(
158
+    "{{URL::action('CriteriaController@fetchFromTemplate')}}",
159
+    {
160
+      criterion_id: criterion_id
161
+    },
162
+    function(objectives){
163
+      $("#pair-objectives-body").html('<label>Objectives Paired to '+$('#criterion-name').html()+'</label>');
164
+      options = makeOptions(objectives.objectives_available);
165
+
166
+      if(objectives.objectives_selected.length == 0){
167
+        $("#pair-objectives-body").append(createObjectiveSelect('', options,criterion_id));
168
+      }
169
+      else{
170
+        $.each(objectives.objectives_selected, function (ind, obj){
171
+          $("#pair-objectives-body").append(createObjectiveSelect(obj, options,criterion_id));
172
+        })
173
+      }
174
+
175
+      $("#pair-objectives-body").append(addObjectiveButton(criterion_id));
176
+      $("#pair-objectives-body").attr('data-outcome-ids', JSON.stringify(objectives.outcomes));
177
+
178
+      $("#pair-objectives").modal('show');
179
+      $('.selectpicker').selectpicker('refresh');
180
+
181
+
182
+    }
183
+  )
184
+}
185
+options = '';
186
+
187
+function makeOptions(objectives){
188
+  options = "<option value = '0'>Nothing Selected</option>";
189
+  $.each(objectives, function(ind, obj){
190
+    //objective_outcome_array = [obj.objective_id,obj.outcome_id];
191
+    options += "<option value = '"+obj.id+"'><p>" +obj.text+"</p></option>";
192
+ 
193
+  });
194
+  return options;
195
+}
196
+
197
+function addObjectiveButton(criterion_id){
198
+  div_row = $("<div>",{
199
+    "class":'row',
200
+    'id':"objective_button"  
201
+  }
202
+    );
203
+  div_col = $("<div>", {
204
+    'id':'objective_button',
205
+    'class':'col-md-12'
206
+  });
207
+
208
+  button = $("<button>", {
209
+    'class':"btn btn-md btn-secondary pull-right",
210
+    'onclick':'addObjectives("#objective_button", '+criterion_id+')'
211
+  }).html('<span class ="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Objective');
212
+
213
+  div_col.append(button);
214
+  div_row.append(div_col);
215
+  return div_row;
216
+  
217
+  
218
+  }
219
+
220
+  function addObjectives(div, criterion_id){
221
+
222
+    $(div).before(createObjectiveSelect('',options, criterion_id));
223
+    $(".selectpicker").selectpicker('refresh');
224
+  }
225
+
226
+function createObjectiveSelect(objective = '', options, criterion_id){
227
+
228
+  
229
+            
230
+            div_master = $('<div>',{
231
+                'class':'removable_div'
232
+            })
233
+            div_select = $("<div>",{
234
+                'class':'form-group col-md-11',
235
+
236
+            })
237
+            select = $('<select>',{
238
+              'name':'objectives[]',
239
+              'class':'selectpicker form-control removable',
240
+              'data-live-search':'true',
241
+              "data-old-objective": ((objective == '') ? 'none': objective.id),
242
+              'data-criterion-id':criterion_id,
243
+              'onchange':'postObjective(this)'
244
+
245
+            }).html(options);
246
+
247
+            if(objective != ''){
248
+              select.val(objective.id);
249
+            }
250
+            div_rem_button = $('<div>',
251
+                {
252
+                    'class':'col-md-1 remove-btn'
253
+                    
254
+                })
255
+            rem_button = $('<button>',{
256
+                'type':'button',
257
+                'class':'btn btn-primary',
258
+                'onclick':'deleteCriterion(this);'
259
+            }).html("<span class='glyphicon glyphicon-remove'></span>")
260
+
261
+            div_select.append(select);
262
+            div_rem_button.append(rem_button);
263
+            div_master.append(div_select);
264
+            div_master.append(div_rem_button);
265
+
266
+            return div_master;
267
+
268
+
269
+
270
+}
271
+
272
+function postObjective(select){
273
+  old_objective = $(select).data('old-objective');
274
+  criterion_id = $(select).data('criterion-id');
275
+  new_objective = $(select).val();
276
+
277
+
278
+
279
+  if(old_objective == 'none'){
280
+    url = "{{URL::action('Objective2Controller@insertPCOBOFromTemplate')}}";
281
+  }
282
+  else{
283
+    url = "{{URL::action('Objective2Controller@updatePCOBOFromTemplate')}}";
284
+  }
285
+
286
+  $.post(
287
+    url,
288
+    {
289
+
290
+      old_objective: old_objective,
291
+      template_id: {{$template->id}},
292
+      criterion_id: criterion_id ,
293
+      new_objective:new_objective
294
+    },
295
+    function(){
296
+      $(select).data('old-objective', new_objective);
297
+
298
+    }
299
+
300
+  )
301
+}
302
+
303
+function deleteCriterion(button){
304
+  removable_div = $(button).parent().parent();
305
+
306
+  select = removable_div.find('select.removable');
307
+
308
+  if(select.data('old-objective')== 'none'){
309
+    modal_body = removable_div.parent();
310
+
311
+    removable_div.remove();
312
+    if(modal_body.children('.removable_div').length == 0){
313
+      addObjectives("#objective_button");
314
+     
315
+    }
316
+    return;
317
+
318
+  }
319
+  
320
+
321
+  $.post(
322
+    "{{URL::action('Objective2Controller@deletePCOBOFromTemplate')}}",
323
+    {
324
+      template_id: {{$template->id}},
325
+      objective_id:select.val(),
326
+      criterion_id:select.data('criterion-id'),
327
+
328
+
329
+
330
+    },
331
+    function (){
332
+      modal_body = removable_div.parent();
333
+
334
+      removable_div.remove();
335
+      if(modal_body.children('.removable_div').length == 0){
336
+        addObjectives("#objective_button");
337
+      
338
+      }
339
+      return;
340
+
341
+
342
+    }
343
+  )
344
+  
345
+}
121 346
 
122 347
 function fetchObjectivesForTemplate(tbody){
123 348
   
@@ -128,7 +353,8 @@ function fetchObjectivesForTemplate(tbody){
128 353
         $.post(
129 354
             "{{URL::action('TemplatesController@fetchObjectivesForTemplate')}}",
130 355
             {
131
-                allCriteria:allCriteria
356
+                allCriteria:allCriteria,
357
+                template_id:{{$template->id}}
132 358
             },
133 359
 
134 360
             function(crit){

+ 9
- 9
app/views/local/managers/shared/annual-plans.blade.php View File

@@ -200,7 +200,7 @@
200 200
                 <div class="modal-header">
201 201
                     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
202 202
                             aria-hidden="true">&times;</span></button>
203
-                    <h3 class="modal-title">Select Rubric/Template to export it's criteria</h3>
203
+                    <h3 class="modal-title">Select Rubric/Template to import it's criteria</h3>
204 204
                 </div>
205 205
                 <div class="modal-body" id = 'modal-template-criteria-body'>
206 206
 
@@ -208,7 +208,7 @@
208 208
 
209 209
                 </div>
210 210
                 <div class="modal-footer">
211
-                    <button type="button" id ='exportButton' class="btn btn-primary" onclick='exportCriteriaFromTemplate()'>Export Criteria</button>
211
+                    <button type="button" id ='importButton' class="btn btn-primary" onclick='importCriteriaFromTemplate()'>Import Criteria</button>
212 212
                     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
213 213
 
214 214
 
@@ -221,7 +221,7 @@
221 221
 
222 222
 
223 223
     <script>
224
-        //Export functionality begin///////////////////////////////////////////////////////////
224
+        //import functionality begin///////////////////////////////////////////////////////////
225 225
         
226 226
         function selectRubricForCriteria(objective_id,outcome_id,program_id, typ_objective_id){
227 227
             $.post(
@@ -237,7 +237,7 @@
237 237
                     select = $('<select>', {
238 238
                         'class':'selectpicker form-control',
239 239
                         'data-live-search':'true',
240
-                        'id':'templateToExport'
240
+                        'id':'templateToimport'
241 241
                     });
242 242
 
243 243
                     options = "<option value ='0'>Nothing selected</option>";
@@ -247,13 +247,13 @@
247 247
 
248 248
                     select.html(options);
249 249
                     label = $("<label>", {
250
-                        'for':'templateToExport'
250
+                        'for':'templateToimport'
251 251
                     }).html("Select a Rubric or Template");
252 252
 
253 253
                     $(modal+'-body').append(label);
254 254
                     $(modal+'-body').append(select);
255 255
                     $(".selectpicker").selectpicker('refresh');
256
-                    $('#exportButton').attr('onclick', 'exportCriteriaFromTemplate('+typ_objective_id+', '+objective_id+', '+outcome_id+', '+program_id+')')
256
+                    $('#importButton').attr('onclick', 'importCriteriaFromTemplate('+typ_objective_id+', '+objective_id+', '+outcome_id+', '+program_id+')')
257 257
                     $(modal).modal('show');
258 258
                     
259 259
 
@@ -262,9 +262,9 @@
262 262
             )
263 263
         } 
264 264
 
265
-        function exportCriteriaFromTemplate(typ_objective_id, objective_id, outcome_id, program_id){
265
+        function importCriteriaFromTemplate(typ_objective_id, objective_id, outcome_id, program_id){
266 266
 
267
-            template_id = $('#templateToExport').val();
267
+            template_id = $('#templateToimport').val();
268 268
             $.post(
269 269
                 "{{URL::action('AnnualPlansController@pairCriteriaFromTemplate')}}",
270 270
                 {
@@ -285,7 +285,7 @@
285 285
 
286 286
         }
287 287
 
288
-        //export function END
288
+        //import function END
289 289
         //
290 290
         /////////////////////////////////////////////////////////////////////////////////////////////
291 291
 

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

@@ -67,7 +67,7 @@
67 67
 
68 68
                     <!-- Associated Program -->
69 69
                     <div class="form-group form_validation program_form" id='program-checkboxes'>
70
-                        {{ Form::label('program_id', 'Associated Program2') }}<br>
70
+                        {{ Form::label('program_id', 'Associated Program') }}<br>
71 71
                         <br>
72 72
                         @if (count($programs) == 1)
73 73
                             <input type="checkbox" id="program-{{ $programs[0]->name }}" name="program_id[]"

+ 450
- 166
app/views/local/managers/shared/rubrics_new.blade.php View File

@@ -64,7 +64,7 @@
64 64
 <div class="row">
65 65
     <div class="col-md-12">
66 66
 
67
-        <div class="panel panel-default">
67
+        <div class="panel panel-default ">
68 68
             <div class="panel-heading">
69 69
                 <span class="glyphicon glyphicon-triangle-bottom"></span>
70 70
                 General Information
@@ -117,10 +117,10 @@
117 117
 
118 118
                             @endforeach
119 119
                         </select>
120
-<!-- 
121
-					<span style="color: red;">Rubrics with "##" at the beginning contain criteria that are not associated with your program or school. You will not be able to use them until your criteria is matched with your program or school.
122
-                    </span>
123
- -->
120
+            <!-- 
121
+                                <span style="color: red;">Rubrics with "##" at the beginning contain criteria that are not associated with your program or school. You will not be able to use them until your criteria is matched with your program or school.
122
+                                </span>
123
+            -->
124 124
 					</div>
125 125
 
126 126
                     <!-- If user is admin s/he can pick which schools can view the rubric -->
@@ -195,6 +195,43 @@
195 195
                     </div>
196 196
                 </form>
197 197
                 <br>
198
+                <form>
199
+                
200
+                <div class="form-group">
201
+                    <label>Select the Maximum Score</label>
202
+                <select id="max_score" class="form-control selectpicker" data-live-search='true'>
203
+                    @for($i = 1; $i <= 100; $i++)
204
+                        @if($i==8)
205
+                            <option selected="selected" value="{{ $i }}">{{ $i }}</option>
206
+                        @else
207
+                            <option value="{{ $i }}">{{ $i }}</option>
208
+                        @endif
209
+                    @endfor
210
+                    
211
+                </select>
212
+                
213
+            </div>
214
+            <div class="form-group">
215
+                <label>Select the Type of Rubric</label>
216
+            <select id="number_of_scales" class="form-control selectpicker" data-live-search='true' >
217
+                @for($i = 1; $i <= 20; $i++)
218
+                @if(8%$i == 0)
219
+                @if($i==1)
220
+                <option value="{{ $i }}">Cuantitative Rubric</option>
221
+                
222
+                    @elseif($i==4)
223
+                    <option selected="selected" value="{{ $i }}">{{ $i }}-Scale Rubric</option>
224
+                    @else
225
+                    <option value="{{ $i }}">{{ $i }}-Scale Rubric</option>
226
+                @endif
227
+                @endif
228
+                @endfor
229
+                
230
+            </select>
231
+
232
+        </div>
233
+            </form>
234
+                <br>
198 235
 
199 236
                 <form>
200 237
                     <div class="form-group">
@@ -219,6 +256,97 @@
219 256
             </div>
220 257
         </div>
221 258
 
259
+        <div class="panel panel-default">
260
+            <div class="panel-heading panel-annual-plans">
261
+                <span class="glyphicon glyphicon-triangle-bottom"></span>
262
+                Import Criteria From Annual Plans
263
+            </div>
264
+            <div class="panel-body">
265
+                <form>
266
+                    <div class="form-group">
267
+                        <label>Select Annual Plan to Import From</label>
268
+                        <select id="select-annual-plans" class="form-control selectpicker" onchange="fetchSemesters(this)" data-live-search='true' data-live-search='true'>
269
+                            <option value = '0'>Nothing Selected</option>
270
+                        @foreach($annual_plans as $annual_plan)
271
+                            <option value = "{{$annual_plan->annual_plan_id}}">Annual Plan for {{$annual_plan->program_name}} on {{$annual_plan->academic_year}}</option>
272
+
273
+
274
+                        @endforeach
275
+                        </select>
276
+          
277
+					</div>
278
+
279
+                    <!-- If user is admin s/he can pick which schools can view the rubric -->
280
+                    
281
+
282
+
283
+                </form>
284
+          
285
+               
286
+
287
+                <label for="">Select a Semester</label>
288
+                <form >
289
+                    <div class="form-group">
290
+                        <!-- Select percentage. If there is a rubric, select the saved value -->
291
+
292
+                        <select id="select-semester-plans" class="form-control selectpicker" onchange = "fetchCourses('#select-annual-plans', '#select-semester-plans')" data-live-search='true'>
293
+                          
294
+                        </select>
295
+                      
296
+
297
+
298
+
299
+                        
300
+                    </div>
301
+                </form>
302
+                <br>
303
+
304
+                <form>
305
+                    <div class="form-group">
306
+                        <label>Select Course</label>
307
+                        <select id="select-courses-plans" class="form-control selectpicker" onchange = "  fetchCriteriaFromPlan('#select-courses-plans','#select-annual-plans', '#max_score', '#number_of_scales');" data-live-search='true'>
308
+                          
309
+                        </select>
310
+                      
311
+
312
+
313
+
314
+                        
315
+                    </div>
316
+                    
317
+                </form>
318
+                <form>
319
+                    <div class="form-group">
320
+                        <label>Select Criteria</label>
321
+                        <select id="select-criteria-plans" class="form-control selectpicker" onchange = "" data-live-search='true'>
322
+                          
323
+                        </select>
324
+                      
325
+
326
+
327
+
328
+                        
329
+                    </div>
330
+                    
331
+                </form>
332
+                <div class="text-center">
333
+                    <div class="btn-group" role="group" aria-label="...">
334
+                        <button id="button-add-criterion-plan" onclick = 'putToTemplateSingle("#select-criteria-plans")'class="btn btn-md btn-primary add-criterion-plan">
335
+                            <span class="glyphicon glyphicon-plus"></span>
336
+                            Add Criterion
337
+                        </button>
338
+                        <button id="button-add-all-criterion-plan" onclick = 'putToTemplateMultiple("#select-criteria-plans")'class="btn btn-md btn-primary add-criterion-plan">
339
+                            <span class="glyphicon glyphicon-plus"></span>
340
+                            Add All Criterion From Course
341
+                        </button>
342
+                        
343
+                    </div>
344
+                </div>
345
+                
346
+              
347
+            </div>
348
+        </div>
349
+
222 350
 
223 351
 
224 352
         <div class="well">
@@ -238,39 +366,6 @@
238 366
                     </select>
239 367
                 </div>
240 368
 
241
-                    <div class="form-group">
242
-                        <label>Select the Maximum Score</label>
243
-                    <select id="max_score" class="form-control selectpicker" data-live-search='true'>
244
-                        @for($i = 1; $i <= 100; $i++)
245
-                            @if($i==8)
246
-                                <option selected="selected" value="{{ $i }}">{{ $i }}</option>
247
-                            @else
248
-                                <option value="{{ $i }}">{{ $i }}</option>
249
-                            @endif
250
-                        @endfor
251
-                        
252
-                    </select>
253
-                    
254
-                </div>
255
-                <div class="form-group">
256
-                    <label>Select the Type of Rubric</label>
257
-                <select id="number_of_scales" class="form-control selectpicker" data-live-search='true' >
258
-                    @for($i = 1; $i <= 20; $i++)
259
-                    @if(8%$i == 0)
260
-                    @if($i==1)
261
-                    <option value="{{ $i }}">Cuantitative Rubric</option>
262
-                    
263
-                        @elseif($i==4)
264
-                        <option selected="selected" value="{{ $i }}">{{ $i }}-Scale Rubric</option>
265
-                        @else
266
-                        <option value="{{ $i }}">{{ $i }}-Scale Rubric</option>
267
-                    @endif
268
-                    @endif
269
-                    @endfor
270
-                    
271
-                </select>
272
-
273
-                <div>
274 369
                 @if(Auth::user()->role != '1')
275 370
 
276 371
                     <label>Filter Criteria</label>
@@ -404,19 +499,133 @@
404 499
 @section('included-js')
405 500
 
406 501
 <!-- jQuery Sortable Tables -->
407
-<script src="{{ asset('vendor/jQuerySortable/jquery-sortable-min.js') }}"></script>
502
+
408 503
 <script>
409 504
 
505
+    function putToTemplateSingle(select){
506
+        addCriterion(select);
507
+        
508
+
509
+    }
510
+    function putToTemplateMultiple(select){
511
+
512
+        options = $(select).children('option');
513
+        $.each(options, function(ind, opt){
514
+            $(select).val($(opt).data('criterion-id'))
515
+            $('.selectpicker').selectpicker('refresh');
516
+            putToTemplateSingle(select);
517
+        })
518
+    }
519
+
520
+    function fetchSemesters(select){
521
+
522
+        $.post("{{URL::action('AnnualPlansController@fetchSemestersFromPlan')}}",
523
+        {
524
+            annual_plan_id:$(select).val()
525
+        },
526
+        function(semesters){
527
+            console.log(semesters);
528
+
529
+            options_for_semesters = makeOptionsForSemesters(semesters);
530
+            $("#select-semester-plans").html(options_for_semesters);
531
+            $('.selectpicker').selectpicker('refresh');
532
+            fetchCourses('#select-annual-plans', '#select-semester-plans')
533
+        }
534
+        )
535
+    }
536
+
537
+    function makeOptionsForSemesters(semesters){
538
+        options = '';
539
+        $.each(semesters, function(ind, semesters){
540
+            options += "<option value = '"+semesters.id+"'>"+semesters.name+" ("+semesters.code+")</option>";
541
+        })
542
+        return options;
543
+    }
544
+
545
+    function fetchCourses(annual_plan, semesters){
546
+        annual_plan_id= $(annual_plan).val(),
547
+                semester_id= $(semesters).val()
548
+        $.post(
549
+            "{{URL::action('AnnualPlansController@fetchCoursesFromPlanForTemplate')}}",
550
+            {
551
+                annual_plan_id:$(annual_plan).val(),
552
+                semester_id:$(semesters).val()
553
+            },
554
+            function(courses){
555
+                console.log(courses);
556
+                options = makeOptionsForCourses(courses);
557
+                $("#select-courses-plans").html(options);
558
+                $('.selectpicker').selectpicker('refresh');
559
+                fetchCriteriaFromPlan("#select-courses-plans","#select-annual-plans", '#max_score', '#number_of_scales');
560
+
561
+
562
+            }
563
+        )
564
+    }
565
+
566
+    function makeOptionsForCourses(courses){
567
+        options = '';
568
+        $.each(courses, function(ind, courses){
569
+            options += "<option value= '"+courses.id+"'>"+courses.code+"["+courses.number+"] "+courses.name+"</option>";
570
+        })
571
+        return options;
572
+    }
573
+
574
+    function fetchCriteriaFromPlan(courses, annual_plan, max_score, number_of_scales){
575
+
576
+        $.post(
577
+            "{{URL::action('AnnualPlansController@fetchCriteriaFromPlan')}}",
578
+            {
579
+                course_id: $(courses).val(),
580
+                annual_plan:$(annual_plan).val(),
581
+                max_score:$(max_score).val(),
582
+                number_of_scales:$(number_of_scales).val()
583
+            },
584
+            function(criteria){
585
+                console.log(criteria);
586
+                options_criteria = makeOptionsForCriteria(criteria)
587
+                
588
+                $('#select-criteria-plans').html(options);
589
+                $('.selectpicker').selectpicker('refresh');
590
+                //if options is empty, disable add button
591
+                if(options == ''){
592
+                    $('.add-criterion-plan').prop('disabled',true)
593
+
594
+                }
595
+                //if options is empty, disable add button
596
+                else{
597
+                    $('.add-criterion-plan').prop('disabled',false)
598
+
599
+                }
600
+
601
+            }
602
+        )
603
+
604
+    }
605
+
606
+    function makeOptionsForCriteria(criteria){
607
+        options = '';
608
+
609
+        $.each(criteria, function (ind, cri){
610
+            options +='<option value = "'+cri.id+'" data-criterion-id ="'+cri.id+'">'+cri.name+'</option>';
611
+        })
612
+        return options;
613
+    }
614
+
615
+
616
+
410 617
     function fetchObjectivesForTemplate(tbody){
411 618
 
412 619
         allCriteria = [];
413 620
         $(tbody).children('tr').each(function (index){
414 621
             allCriteria.push($(this).data('criterion-id'));
415 622
         })
623
+        program_id = $("#select-program").val();
416 624
         $.post(
417 625
             "{{URL::action('TemplatesController@fetchObjectivesForTemplate')}}",
418 626
             {
419
-                allCriteria:allCriteria
627
+                allCriteria:allCriteria,
628
+                program_id:program_id
420 629
             },
421 630
 
422 631
             function(crit){
@@ -446,8 +655,71 @@
446 655
             }
447 656
         )
448 657
     }
449
-function saveTemplate()
450
-{
658
+    options_for_select = '';
659
+
660
+    function fetchOutcomes(annual_plan_id){
661
+    
662
+
663
+    $.post(
664
+        "{{URL::action('AnnualPlansController@fetchOutcomesFromPlan')}}",
665
+        {
666
+            annual_plan_id:annual_plan_id
667
+        },
668
+        function(outcomes){
669
+            console.log(outcomes);
670
+
671
+            options_for_select = makeOptionsForOutcomes(outcomes);
672
+            $("#select-outcomes-plans").html(options_for_select);
673
+            $('.selectpicker').selectpicker('refresh');
674
+            $("#select-outcomes-plans").trigger('change');
675
+
676
+        }
677
+    );
678
+}
679
+
680
+
681
+function fetchObjectives(select_outcome){
682
+    console.log($(select_outcome).find('option:selected').html())
683
+    option_selected = $(select_outcome).find('option:selected');
684
+    console.log($(select_outcome).find('option:selected').data('objectives'))
685
+    console.log($(select_outcome).val())
686
+    console.log(option_selected.val())
687
+    $.post(
688
+        "{{URL::action('AnnualPlansController@fetchObjectivesFromPlan')}}",
689
+        {
690
+            program_id: option_selected.data('program-id'),
691
+            typ_semester_outcome_id: option_selected.data('typ-semester-outcome-id'),
692
+            semester_id:option_selected.data('semester-id'),
693
+            outcome_id: $(select_outcome).val()
694
+        },
695
+        function(objectives){
696
+            options_for_objective = makeOptionsForObjectives(objectives)
697
+
698
+        }
699
+    )
700
+    }
701
+
702
+    function makeOptionsForObjectives(objectives){
703
+        console.log(objectives);
704
+
705
+        option_selected = '';
706
+        
707
+    }
708
+
709
+function makeOptionsForOutcomes(outcomes){
710
+    
711
+    options_for_select = '<optgroup label ="First Semester">';
712
+    semester_id = outcomes[0].semester_id
713
+    $.each(outcomes, function(ind, out){
714
+        if(semester_id != out.semester_id){
715
+            semester_id = out.semester_id
716
+            options_for_select += '<optgroup label ="Second Semester">';
717
+        }
718
+        options_for_select +="<option value= '"+out.id+"' data-typ-semester-outcome-id ='"+out.typ_semester_outcome_id+"' data-program-id= '"+out.program_id+"' data-semester-id = '"+out.semester_id+"'>"+out.name+"</option>";
719
+    });
720
+    return options_for_select;
721
+}
722
+function saveTemplate(){
451 723
     //Prevent page refresh
452 724
     
453 725
 
@@ -546,96 +818,8 @@ function saveTemplate()
546 818
     }
547 819
 
548 820
 }
549
-    </script>
550
-<!-- X-Editable js -->
551
-<script src="{{ asset('vendor/xeditable/bootstrap-editable.min.js') }}"></script>
552
-
553
-@stop
554
-
555
-@section('javascript')
556
-$('#select-outcome').on('change',function(){
557
-    fetchObjective(this);
558
-})
559
-// --------------------------------------------------------------------------
560
-// Functions
561
-// --------------------------------------------------------------------------
562
-
563
-function fetchObjective(outcome){
564
-    $.post(
565
-        "{{URL::route('fetchObjectivesForSelect')}}",
566
-        {
567
-            outcomeID:$(outcome).find(':selected').data('outcome-id'),
568
-        },
569
-        function(data){
570
-            options = '';
571
-            for(objective_index in data){
572
-                options += '<option value = "'+data[objective_index].objective_id+'">'+data[objective_index].text+'</option>';
573
-
574
-            }
575
-            $('#select-objective').html(options);
576
-            $('#select-objective').selectpicker('refresh');
577
-            fetchCriteria($('#select-outcome'), $('#select-objective'));
578
-
579
-        }, 'json',
580
-    );
581
-
582
-}
583
-// Fetch criteria associated to a specific learning outcome 
584
-
585
-function fetchCriteria(outcome, objective)
586
-{
587
-    amount_of_scales = parseInt($('#number_of_scales').find(':selected').val());
588
-            
589
-    maximum = parseInt($('#max_score').find(":selected").val());
590
-    $.post
591
-    (
592
-        "{{ URL::route('fetchCriteria') }}",
593
-        {
594
-            outcome_id: outcome.find(':selected').data('outcome-id'),
595
-            objective_id: objective.find(':selected').val(),
596
-            num_scales: amount_of_scales,
597
-            maximum: maximum,
598
-            filter: $('input[name=criteria-filter]:checked').val()
599
-        },
600
-        function(data)
601
-        {
602
-            $('#select-criterion').empty();
603
-		console.log(data);
604
-            // Append criteria
605
-            data.forEach( function (arrayItem)
606
-            {
607
-                objectives = JSON.stringify(arrayItem.objectives);
608
-                $('#select-criterion')
609
-                    .append('<option data-criterion-id="'+arrayItem.id+'" data-program-ids = '+"'"+arrayItem.program_ids+"'"+' data-assoc-objectives= '+"'"+objectives+"'"+'>'+arrayItem.name+'</option>');
610
-            });
611
-
612
-            // If there are no criteria assigned to the selected outcome, disable the
613
-            // input and the button used to add criteria.
614
-            if(!$('#select-criterion').children().length)
615
-            {
616
-
617
-                $('#select-criterion').prop('disabled', true);
618
-                $('#button-add-criterion').prop('disabled', true);
619
-            }
620
-
621
-            // Otherwise, enable both the input and the button
622
-            else
623
-            {
624
-                $('#select-criterion').prop('disabled', false);
625
-                $('#button-add-criterion').prop('disabled', false);
626
-            }
627
-
628
-            $('#updated-text').fadeIn('slow').fadeOut('slow');
629
-
630
-            refreshSelects();
631
-
632
-
633
-        }
634
-    );
635
-}
636
-
637 821
 // Add a new criterion to the rubric
638
-function addCriterion()
822
+function addCriterion(select)
639 823
 {
640 824
 
641 825
     // Show the rubric container
@@ -645,9 +829,9 @@ function addCriterion()
645 829
     }
646 830
 
647 831
     // Get the selected criterion's id
648
-    var id= parseInt($('#select-criterion').find(':selected').data('criterion-id'));
649
-    var program_ids = $('#select-criterion').find(':selected').data('program-ids');
650
-    var objectives = $('#select-criterion').find(':selected').data('assoc-objectives');
832
+    var id= parseInt($(select).find(':selected').data('criterion-id'));
833
+    var program_ids = $(select).find(':selected').data('program-ids');
834
+    //var objectives = $(select).find(':selected').data('assoc-objectives');
651 835
     // Check for duplicates
652 836
     var duplicates=false;
653 837
     numberOfScale = $('#number_of_scales').find(':selected').val();
@@ -691,9 +875,9 @@ function addCriterion()
691 875
             if(data.criterion.notes){
692 876
                 notes = data.criterion.notes;
693 877
             }
694
-            objectives = JSON.stringify(objectives);
695
-            var str ='<tr data-criterion-name ="'+data.criterion.name+'" data-program-ids = "['+program_ids+']" data-assoc-objectives = '+"'"+objectives+"'"+' data-criterion-id="'+data.criterion.id+'" data-criterion-copyright="'+copyright+'" data-criterion-notes="'+notes+'" data-outcomes = "'+data.outcomes+'"><th><span class="glyphicon glyphicon-move"></span></th><td>';
696
-//	console.log(str);
878
+            //objectives = JSON.stringify(objectives);
879
+            var str ='<tr data-criterion-name ="'+data.criterion.name+'" data-program-ids = "['+program_ids+']"  data-criterion-id="'+data.criterion.id+'" data-criterion-copyright="'+copyright+'" data-criterion-notes="'+notes+'" data-outcomes = "'+data.outcomes+'"><th><span class="glyphicon glyphicon-move"></span></th><td>';
880
+    //	console.log(str);
697 881
             var subcriteria = '';
698 882
             if(data.criterion.subcriteria){
699 883
 
@@ -755,32 +939,6 @@ function addCriterion()
755 939
         'json',
756 940
     );
757 941
 }
758
-
759
-// Fetch single criterion
760
-function fetchCriterion(criterion)
761
-{
762
-    $.post
763
-    (
764
-        "{{ URL::route('fetchCriterion') }}",
765
-        { id: outcome.find(':selected').data('outcome-id')},
766
-        function(data)
767
-        {
768
-            $('#select-criterion').empty();
769
-
770
-            data.forEach( function (arrayItem)
771
-            {
772
-                $('#select-criterion')
773
-                    .append('<option data-criterion-id="'+arrayItem.id+'" >'+arrayItem.name+'</option>');
774
-            });
775
-
776
-            $('#select-criterion').append('<option data-criterion-id="0">Custom</option>');
777
-
778
-            refreshSelects();
779
-
780
-        }
781
-    );
782
-}
783
-
784 942
 // Build list from copyright info in rubric
785 943
 function buildCopyrightList()
786 944
 {
@@ -842,7 +1000,126 @@ function buildCopyrightList()
842 1000
     else
843 1001
     {
844 1002
        $('#copyright-info').hide();
845
-}}
1003
+    }
1004
+}
1005
+    </script>
1006
+<!-- X-Editable js -->
1007
+<script src="{{ asset('vendor/xeditable/bootstrap-editable.min.js') }}"></script>
1008
+
1009
+<script src="{{app_path().'/scripts/rubric_scripts/scripts_for_annual_plan_export.js'}}"></script>
1010
+
1011
+@stop
1012
+
1013
+@section('javascript')
1014
+$('#select-outcome').on('change',function(){
1015
+    fetchObjective(this);
1016
+})
1017
+// --------------------------------------------------------------------------
1018
+// Functions
1019
+// --------------------------------------------------------------------------
1020
+
1021
+function fetchObjective(outcome){
1022
+    $.post(
1023
+        "{{URL::route('fetchObjectivesForSelect')}}",
1024
+        {
1025
+            outcomeID:$(outcome).find(':selected').data('outcome-id'),
1026
+        },
1027
+        function(data){
1028
+            options = '';
1029
+            for(objective_index in data){
1030
+                options += '<option value = "'+data[objective_index].objective_id+'">'+data[objective_index].text+'</option>';
1031
+
1032
+            }
1033
+            $('#select-objective').html(options);
1034
+            $('#select-objective').selectpicker('refresh');
1035
+            fetchCriteria($('#select-outcome'), $('#select-objective'));
1036
+
1037
+        }, 'json',
1038
+    );
1039
+
1040
+}
1041
+// Fetch criteria associated to a specific learning outcome 
1042
+
1043
+function fetchCriteria(outcome, objective)
1044
+{
1045
+    amount_of_scales = parseInt($('#number_of_scales').find(':selected').val());
1046
+            
1047
+    maximum = parseInt($('#max_score').find(":selected").val());
1048
+    $.post
1049
+    (
1050
+        "{{ URL::route('fetchCriteria') }}",
1051
+        {
1052
+            outcome_id: outcome.find(':selected').data('outcome-id'),
1053
+            objective_id: objective.find(':selected').val(),
1054
+            num_scales: amount_of_scales,
1055
+            maximum: maximum,
1056
+            filter: $('input[name=criteria-filter]:checked').val()
1057
+        },
1058
+        function(data)
1059
+        {
1060
+            $('#select-criterion').empty();
1061
+		console.log(data);
1062
+            // Append criteria
1063
+            data.forEach( function (arrayItem)
1064
+            {
1065
+                objectives = JSON.stringify(arrayItem.objectives);
1066
+                $('#select-criterion')
1067
+                    .append('<option data-criterion-id="'+arrayItem.id+'" data-program-ids = '+"'"+arrayItem.program_ids+"'"+' data-assoc-objectives= '+"'"+objectives+"'"+'>'+arrayItem.name+'</option>');
1068
+            });
1069
+
1070
+            // If there are no criteria assigned to the selected outcome, disable the
1071
+            // input and the button used to add criteria.
1072
+            if(!$('#select-criterion').children().length)
1073
+            {
1074
+
1075
+                $('#select-criterion').prop('disabled', true);
1076
+                $('#button-add-criterion').prop('disabled', true);
1077
+            }
1078
+
1079
+            // Otherwise, enable both the input and the button
1080
+            else
1081
+            {
1082
+                $('#select-criterion').prop('disabled', false);
1083
+                $('#button-add-criterion').prop('disabled', false);
1084
+            }
1085
+
1086
+            $('#updated-text').fadeIn('slow').fadeOut('slow');
1087
+
1088
+            refreshSelects();
1089
+
1090
+
1091
+        }
1092
+    );
1093
+}
1094
+
1095
+
1096
+
1097
+// Fetch single criterion
1098
+function fetchCriterion(criterion)
1099
+{
1100
+    $.post
1101
+    (
1102
+        "{{ URL::route('fetchCriterion') }}",
1103
+        { id: outcome.find(':selected').data('outcome-id')},
1104
+        function(data)
1105
+        {
1106
+            $('#select-criterion').empty();
1107
+
1108
+            data.forEach( function (arrayItem)
1109
+            {
1110
+                $('#select-criterion')
1111
+                    .append('<option data-criterion-id="'+arrayItem.id+'" >'+arrayItem.name+'</option>');
1112
+            });
1113
+
1114
+            $('#select-criterion').append('<option data-criterion-id="0">Custom</option>');
1115
+
1116
+            refreshSelects();
1117
+
1118
+        }
1119
+    );
1120
+}
1121
+
1122
+
846 1123
     /*        if(criterion.data('criterion-copyright')!=null)
847 1124
         {
848 1125
             var copyright = criterion.data('criterion-copyright');
@@ -1014,7 +1291,7 @@ console.log($('#select-school'));
1014 1291
                console.log(current_criterion.program_ids);
1015 1292
                 objectives = JSON.stringify(current_criterion.objectives);
1016 1293
                 //var str = '<tr data-assoc-objectives= '+"'"+objectives+"'"+' data-program_ids = "'+current_criterion.program_ids+'" data-criterion-name = "'+current_criterion.name+'" data-criterion-id="'+temp_criterion[temp_c].criterion_id+'" data-criterion-copyright="'+temp_criterion[temp_c].copyright+'" data-criterion-notes="'+temp_criterion[temp_c].notes+'" data-outcomes = "'+temp_criterion[temp_c].outcomes+'"><th><span class="glyphicon glyphicon-move"></span></th><td>';
1017
-                var str = "<tr data-assoc-objectives= "+"'"+objectives+"'"+" data-program_ids = '"+current_criterion.program_ids+"' data-criterion-name = '"+current_criterion.name+"' data-criterion-id='"+temp_criterion[temp_c].criterion_id+"' data-criterion-copyright='"+temp_criterion[temp_c].copyright+"' data-criterion-notes='"+temp_criterion[temp_c].notes+"' data-outcomes = '"+temp_criterion[temp_c].outcomes+"'><th><span class='glyphicon glyphicon-move'></span></th><td>";
1294
+                var str = "<tr  data-program_ids = '"+current_criterion.program_ids+"' data-criterion-name = '"+current_criterion.name+"' data-criterion-id='"+temp_criterion[temp_c].criterion_id+"' data-criterion-copyright='"+temp_criterion[temp_c].copyright+"' data-criterion-notes='"+temp_criterion[temp_c].notes+"' data-outcomes = '"+temp_criterion[temp_c].outcomes+"'><th><span class='glyphicon glyphicon-move'></span></th><td>";
1018 1295
                 console.log(str);
1019 1296
 
1020 1297
                 var subcriteria ='';
@@ -1237,6 +1514,9 @@ $('.panel-heading').on('click', function()
1237 1514
     $(this).siblings('.panel-body').stop().slideToggle();
1238 1515
 });
1239 1516
 
1517
+$('.panel-annual-plans').trigger('click');
1518
+$('.add-criterion-plan').prop('disabled',true)
1519
+
1240 1520
 // Fetch criteria everytime something changes 
1241 1521
 $('#select-objective').on('change', function(){
1242 1522
     fetchCriteria($('#select-outcome'), $('#select-objective'));
@@ -1396,9 +1676,13 @@ $('#max_score').on('change', function(){
1396 1676
     refreshSelects();
1397 1677
     changeTable();
1398 1678
     fetchCriteria($('#select-outcome'), $('#select-objective'))
1679
+    fetchCriteriaFromPlan('#select-courses-plans','#select-annual-plans', '#max_score', '#number_of_scales');
1399 1680
 })
1400 1681
 $('#number_of_scales').on('change', function(){
1401 1682
     changeTable();
1683
+    fetchCriteria($('#select-outcome'), $('#select-objective'))
1684
+    fetchCriteriaFromPlan('#select-courses-plans','#select-annual-plans', '#max_score', '#number_of_scales');
1685
+
1402 1686
     $('#rubric-container').hide();
1403 1687
     $('#rubric-name').val('');
1404 1688
     $('tbody').empty();
@@ -1417,7 +1701,7 @@ $('#button-add-criterion').on('click', function(e)
1417 1701
     e.preventDefault();
1418 1702
 
1419 1703
     //Add new criterion
1420
-    addCriterion();
1704
+    addCriterion("#select-criterion");
1421 1705
 });
1422 1706
 
1423 1707
 // When the create or update buttons are clicked (.save)

+ 729
- 0
app/views/three_year_plan_htmls/08-12-2022-for-1044-by-5478.blade.php View File

@@ -0,0 +1,729 @@
1
+<html><head></head><body id="theDocument"><style type="text/css">
2
+    body
3
+    {
4
+        font-family: "Arial", sans-serif;
5
+        width:90%;
6
+        margin: 0 auto;
7
+    }
8
+    .header-text
9
+    {
10
+        text-align:center;
11
+        font-weight: bold;
12
+        margin:0;
13
+    }
14
+
15
+    h1.header-text
16
+    {
17
+      margin: 15px auto;
18
+      width:75%;
19
+      font-size: 25px;
20
+    }
21
+
22
+    table
23
+    {
24
+        border-collapse: collapse;
25
+        border: 1px solid black;
26
+        width: 100%;
27
+        margin: 30px auto;
28
+        font-size:1.5vw;
29
+    }
30
+    td, th
31
+    {
32
+        border: 1px solid black;
33
+        padding: 5px;
34
+    }
35
+
36
+    .activity-name-row
37
+    {
38
+      background:black;
39
+      color:white;
40
+    }
41
+
42
+    .activity-headers-row
43
+    {
44
+      background:lightgrey;
45
+      font-weight:bold;
46
+    }
47
+
48
+    .report-info
49
+    {
50
+      margin:5px 0;
51
+      font-size: 16px;
52
+    }
53
+
54
+    .criterion-field
55
+    {
56
+      text-align:left;
57
+    }
58
+
59
+    .score-field, .total, .percentage
60
+    {
61
+      text-align:center;
62
+    }
63
+
64
+    .header
65
+    {
66
+      margin: 30px 0;
67
+    }
68
+
69
+    .content
70
+    {
71
+      font-size: 12px;
72
+    }
73
+
74
+    .logo
75
+    {
76
+      position:absolute;
77
+      right:0;
78
+      top: 30px;
79
+      width: 100px;
80
+    }
81
+
82
+    ol{
83
+      list-style-type:none;
84
+    }
85
+
86
+    @media print{@page {size: landscape}}
87
+</style><style type="text/css" media="print">
88
+	  @page { size: landscape; }
89
+	</style><img class="logo" src="http://localhost:8000/images/logo_uprrp_bw.png" alt="UPRRP Logo">
90
+
91
+<div class="header">
92
+    <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
93
+    <p class="header-text">Online Learning Assessment System</p>
94
+
95
+    <h1 class="header-text">Three Year Plan for Avaluo del Componente General from 2022 to
96
+        2025</h1>
97
+</div>
98
+
99
+
100
+
101
+    <br>
102
+    <br>
103
+    <h2 class='header-text'>First Semester 2022-2023</h2>
104
+    <br>
105
+                  <span>
106
+            <h3>Content Knowledge, Skills or Dispositions in the academic program learning outcomes</h3>
107
+        </span>
108
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
109
+            <thead>
110
+                <tr>
111
+
112
+                    <th>Objectives</th>
113
+                    <th>Courses</th>
114
+
115
+                </tr>
116
+            </thead>
117
+            <tbody>
118
+
119
+                                    <tr>
120
+
121
+                        <td>
122
+                            1. mera
123
+                        </td>
124
+                        <td>
125
+                            <ol>
126
+                                                                    <li>[CIBI3002] FUND BIOL: II</li>
127
+                                                            </ol>
128
+                        </td>
129
+
130
+                    </tr>
131
+                                    <tr>
132
+
133
+                        <td>
134
+                            2. QUien esta interesado?
135
+                        </td>
136
+                        <td>
137
+                            <ol>
138
+                                                                    <li>[CIBI3006] CIBI ENFASIS CONS AMB I   </li>
139
+                                                            </ol>
140
+                        </td>
141
+
142
+                    </tr>
143
+                
144
+            </tbody>
145
+        </table>
146
+        <br>
147
+        <br>
148
+                              <span>
149
+            <h3>Critical Thinking</h3>
150
+        </span>
151
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
152
+            <thead>
153
+                <tr>
154
+
155
+                    <th>Objectives</th>
156
+                    <th>Courses</th>
157
+
158
+                </tr>
159
+            </thead>
160
+            <tbody>
161
+
162
+                                    <tr>
163
+
164
+                        <td>
165
+                            1. QUien esta interesado?
166
+                        </td>
167
+                        <td>
168
+                            <ol>
169
+                                                                    <li>[CIBI3006] LABORATORIO               </li>
170
+                                                            </ol>
171
+                        </td>
172
+
173
+                    </tr>
174
+                                    <tr>
175
+
176
+                        <td>
177
+                            2. Esto 'es' la "prueba" de Julio's
178
+                        </td>
179
+                        <td>
180
+                            <ol>
181
+                                                                    <li>[CIBI3006] LABORATORIO               </li>
182
+                                                            </ol>
183
+                        </td>
184
+
185
+                    </tr>
186
+                
187
+            </tbody>
188
+        </table>
189
+        <br>
190
+        <br>
191
+                              <span>
192
+            <h3>Effective Communication Skills</h3>
193
+        </span>
194
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
195
+            <thead>
196
+                <tr>
197
+
198
+                    <th>Objectives</th>
199
+                    <th>Courses</th>
200
+
201
+                </tr>
202
+            </thead>
203
+            <tbody>
204
+
205
+                                    <tr>
206
+
207
+                        <td>
208
+                            1. QUien esta interesado?
209
+                        </td>
210
+                        <td>
211
+                            <ol>
212
+                                                                    <li>[CIBI4105] CULTIVOS TRANSGENICOS     </li>
213
+                                                            </ol>
214
+                        </td>
215
+
216
+                    </tr>
217
+                
218
+            </tbody>
219
+        </table>
220
+        <br>
221
+        <br>
222
+                              <span>
223
+            <h3>Information Literacy</h3>
224
+        </span>
225
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
226
+            <thead>
227
+                <tr>
228
+
229
+                    <th>Objectives</th>
230
+                    <th>Courses</th>
231
+
232
+                </tr>
233
+            </thead>
234
+            <tbody>
235
+
236
+                                    <tr>
237
+
238
+                        <td>
239
+                            1. QUien esta interesado?
240
+                        </td>
241
+                        <td>
242
+                            <ol>
243
+                                                                    <li>[CIBI3027] CAMB CLIM Y SIST ECO CARIB</li>
244
+                                                            </ol>
245
+                        </td>
246
+
247
+                    </tr>
248
+                
249
+            </tbody>
250
+        </table>
251
+        <br>
252
+        <br>
253
+                              <span>
254
+            <h3>Research and Creation</h3>
255
+        </span>
256
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
257
+            <thead>
258
+                <tr>
259
+
260
+                    <th>Objectives</th>
261
+                    <th>Courses</th>
262
+
263
+                </tr>
264
+            </thead>
265
+            <tbody>
266
+
267
+                                    <tr>
268
+
269
+                        <td>
270
+                            1. Tambien esto, a dos programas
271
+                        </td>
272
+                        <td>
273
+                            <ol>
274
+                                                                    <li>[CIBI3026] FUND BIOL ORGAN Y HOMEOTAS</li>
275
+                                                            </ol>
276
+                        </td>
277
+
278
+                    </tr>
279
+                
280
+            </tbody>
281
+        </table>
282
+        <br>
283
+        <br>
284
+                              <span>
285
+            <h3>Social Responsibility</h3>
286
+        </span>
287
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
288
+            <thead>
289
+                <tr>
290
+
291
+                    <th>Objectives</th>
292
+                    <th>Courses</th>
293
+
294
+                </tr>
295
+            </thead>
296
+            <tbody>
297
+
298
+                                    <tr>
299
+
300
+                        <td>
301
+                            1. QUien esta interesado?
302
+                        </td>
303
+                        <td>
304
+                            <ol>
305
+                                                                    <li>[CIBI3025] INV BIOL CULT CIENT       </li>
306
+                                                            </ol>
307
+                        </td>
308
+
309
+                    </tr>
310
+                
311
+            </tbody>
312
+        </table>
313
+        <br>
314
+        <br>
315
+                              <span>
316
+            <h3>Technology</h3>
317
+        </span>
318
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
319
+            <thead>
320
+                <tr>
321
+
322
+                    <th>Objectives</th>
323
+                    <th>Courses</th>
324
+
325
+                </tr>
326
+            </thead>
327
+            <tbody>
328
+
329
+                                    <tr>
330
+
331
+                        <td>
332
+                            1. QUien esta interesado?
333
+                        </td>
334
+                        <td>
335
+                            <ol>
336
+                                                                    <li>[CIBI3015] INV BIOL CUL CIENT        </li>
337
+                                                            </ol>
338
+                        </td>
339
+
340
+                    </tr>
341
+                
342
+            </tbody>
343
+        </table>
344
+        <br>
345
+        <br>
346
+                    <br>
347
+    <br>
348
+    <h2 class='header-text'>Second Semester 2022-2023</h2>
349
+    <br>
350
+                  <span>
351
+            <h3>Critical Thinking</h3>
352
+        </span>
353
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
354
+            <thead>
355
+                <tr>
356
+
357
+                    <th>Objectives</th>
358
+                    <th>Courses</th>
359
+
360
+                </tr>
361
+            </thead>
362
+            <tbody>
363
+
364
+                                    <tr>
365
+
366
+                        <td>
367
+                            1. QUien esta interesado?
368
+                        </td>
369
+                        <td>
370
+                            <ol>
371
+                                                                    <li>[CIBI4006] ANALISIS FORENSE DE ADN   </li>
372
+                                                            </ol>
373
+                        </td>
374
+
375
+                    </tr>
376
+                
377
+            </tbody>
378
+        </table>
379
+        <br>
380
+        <br>
381
+                              <span>
382
+            <h3>Content Knowledge, Skills or Dispositions in the academic program learning outcomes</h3>
383
+        </span>
384
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
385
+            <thead>
386
+                <tr>
387
+
388
+                    <th>Objectives</th>
389
+                    <th>Courses</th>
390
+
391
+                </tr>
392
+            </thead>
393
+            <tbody>
394
+
395
+                                    <tr>
396
+
397
+                        <td>
398
+                            1. QUien esta interesado?
399
+                        </td>
400
+                        <td>
401
+                            <ol>
402
+                                                                    <li>[CIBI3007] CIBI ENFASIS CONS AMB II  </li>
403
+                                                                    <li>[CIBI3026] FUND BIOL ORGAN Y HOMEOTAS</li>
404
+                                                            </ol>
405
+                        </td>
406
+
407
+                    </tr>
408
+                                    <tr>
409
+
410
+                        <td>
411
+                            2. mera
412
+                        </td>
413
+                        <td>
414
+                            <ol>
415
+                                                                    <li>[CIBI4105] CULTIVOS TRANSGENICOS     </li>
416
+                                                                    <li>[CIBI4105] SEM:MIRAD INTERD REPR ASIS</li>
417
+                                                            </ol>
418
+                        </td>
419
+
420
+                    </tr>
421
+                
422
+            </tbody>
423
+        </table>
424
+        <br>
425
+        <br>
426
+                              <span>
427
+            <h3>Effective Communication Skills</h3>
428
+        </span>
429
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
430
+            <thead>
431
+                <tr>
432
+
433
+                    <th>Objectives</th>
434
+                    <th>Courses</th>
435
+
436
+                </tr>
437
+            </thead>
438
+            <tbody>
439
+
440
+                                    <tr>
441
+
442
+                        <td>
443
+                            1. QUien esta interesado?
444
+                        </td>
445
+                        <td>
446
+                            <ol>
447
+                                                                    <li>[CIBI3007] CIBI ENFASIS CONS AMB II  </li>
448
+                                                            </ol>
449
+                        </td>
450
+
451
+                    </tr>
452
+                                    <tr>
453
+
454
+                        <td>
455
+                            2. mera
456
+                        </td>
457
+                        <td>
458
+                            <ol>
459
+                                                                    <li>[CIBI3018] ORIGEN Y EVOLUCION VIDA   </li>
460
+                                                            </ol>
461
+                        </td>
462
+
463
+                    </tr>
464
+                
465
+            </tbody>
466
+        </table>
467
+        <br>
468
+        <br>
469
+                              <span>
470
+            <h3>Information Literacy</h3>
471
+        </span>
472
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
473
+            <thead>
474
+                <tr>
475
+
476
+                    <th>Objectives</th>
477
+                    <th>Courses</th>
478
+
479
+                </tr>
480
+            </thead>
481
+            <tbody>
482
+
483
+                                    <tr>
484
+
485
+                        <td>
486
+                            1. Tambien esto, a dos programas
487
+                        </td>
488
+                        <td>
489
+                            <ol>
490
+                                                                    <li>[CIBI3028] CIENCIA BIOTECN Y SOCIEDAD</li>
491
+                                                            </ol>
492
+                        </td>
493
+
494
+                    </tr>
495
+                                    <tr>
496
+
497
+                        <td>
498
+                            2. mera
499
+                        </td>
500
+                        <td>
501
+                            <ol>
502
+                                                                    <li>[CIBI3028] CIENCIA BIOTECN Y SOCIEDAD</li>
503
+                                                            </ol>
504
+                        </td>
505
+
506
+                    </tr>
507
+                
508
+            </tbody>
509
+        </table>
510
+        <br>
511
+        <br>
512
+                              <span>
513
+            <h3>Logical-mathematical reasoning </h3>
514
+        </span>
515
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
516
+            <thead>
517
+                <tr>
518
+
519
+                    <th>Objectives</th>
520
+                    <th>Courses</th>
521
+
522
+                </tr>
523
+            </thead>
524
+            <tbody>
525
+
526
+                                    <tr>
527
+
528
+                        <td>
529
+                            1. QUien esta interesado?
530
+                        </td>
531
+                        <td>
532
+                            <ol>
533
+                                                                    <li>[CIBI4006] ANALISIS FORENSE DE ADN   </li>
534
+                                                            </ol>
535
+                        </td>
536
+
537
+                    </tr>
538
+                
539
+            </tbody>
540
+        </table>
541
+        <br>
542
+        <br>
543
+                              <span>
544
+            <h3>Research and Creation</h3>
545
+        </span>
546
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
547
+            <thead>
548
+                <tr>
549
+
550
+                    <th>Objectives</th>
551
+                    <th>Courses</th>
552
+
553
+                </tr>
554
+            </thead>
555
+            <tbody>
556
+
557
+                                    <tr>
558
+
559
+                        <td>
560
+                            1. Tambien esto, a dos programas
561
+                        </td>
562
+                        <td>
563
+                            <ol>
564
+                                                                    <li>[CIBI3018] ORIGEN Y EVOLUCION VIDA   </li>
565
+                                                            </ol>
566
+                        </td>
567
+
568
+                    </tr>
569
+                
570
+            </tbody>
571
+        </table>
572
+        <br>
573
+        <br>
574
+                              <span>
575
+            <h3>Social Responsibility</h3>
576
+        </span>
577
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
578
+            <thead>
579
+                <tr>
580
+
581
+                    <th>Objectives</th>
582
+                    <th>Courses</th>
583
+
584
+                </tr>
585
+            </thead>
586
+            <tbody>
587
+
588
+                                    <tr>
589
+
590
+                        <td>
591
+                            1. Tambien esto, a dos programas
592
+                        </td>
593
+                        <td>
594
+                            <ol>
595
+                                                                    <li>[CIBI3018] ORIGEN Y EVOLUCION VIDA   </li>
596
+                                                            </ol>
597
+                        </td>
598
+
599
+                    </tr>
600
+                
601
+            </tbody>
602
+        </table>
603
+        <br>
604
+        <br>
605
+                              <span>
606
+            <h3>Technology</h3>
607
+        </span>
608
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
609
+            <thead>
610
+                <tr>
611
+
612
+                    <th>Objectives</th>
613
+                    <th>Courses</th>
614
+
615
+                </tr>
616
+            </thead>
617
+            <tbody>
618
+
619
+                                    <tr>
620
+
621
+                        <td>
622
+                            1. QUien esta interesado?
623
+                        </td>
624
+                        <td>
625
+                            <ol>
626
+                                                                    <li>[CISO5995] ESTDS AFRODESC PR Y CARIBE</li>
627
+                                                            </ol>
628
+                        </td>
629
+
630
+                    </tr>
631
+                
632
+            </tbody>
633
+        </table>
634
+        <br>
635
+        <br>
636
+                    <br>
637
+    <br>
638
+    <h2 class='header-text'>First Semester 2023-2024</h2>
639
+    <br>
640
+                  <span>
641
+            <h3>Logical-mathematical reasoning </h3>
642
+        </span>
643
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
644
+            <thead>
645
+                <tr>
646
+
647
+                    <th>Objectives</th>
648
+                    <th>Courses</th>
649
+
650
+                </tr>
651
+            </thead>
652
+            <tbody>
653
+
654
+                                    <tr>
655
+
656
+                        <td>
657
+                            1. QUien esta interesado?
658
+                        </td>
659
+                        <td>
660
+                            <ol>
661
+                                                                    <li>[CIBI3035] ECOSISTEMA Y BIODIVERSIDAD</li>
662
+                                                            </ol>
663
+                        </td>
664
+
665
+                    </tr>
666
+                
667
+            </tbody>
668
+        </table>
669
+        <br>
670
+        <br>
671
+                              <span>
672
+            <h3>Research and Creation</h3>
673
+        </span>
674
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
675
+            <thead>
676
+                <tr>
677
+
678
+                    <th>Objectives</th>
679
+                    <th>Courses</th>
680
+
681
+                </tr>
682
+            </thead>
683
+            <tbody>
684
+
685
+                                    <tr>
686
+
687
+                        <td>
688
+                            1. Tambien esto, a dos programas
689
+                        </td>
690
+                        <td>
691
+                            <ol>
692
+                                                                    <li>[CIBI3028] CIENCIA BIOTECN Y SOCIEDAD</li>
693
+                                                            </ol>
694
+                        </td>
695
+
696
+                    </tr>
697
+                
698
+            </tbody>
699
+        </table>
700
+        <br>
701
+        <br>
702
+                    <br>
703
+    <br>
704
+    <h2 class='header-text'>Second Semester 2023-2024</h2>
705
+    <br>
706
+        <br>
707
+    <br>
708
+    <h2 class='header-text'>First Semester 2024-2025</h2>
709
+    <br>
710
+        <br>
711
+    <br>
712
+    <h2 class='header-text'>Second Semester 2024-2025</h2>
713
+    <br>
714
+     
715
+
716
+
717
+</body></html>
718
+
719
+
720
+<script>
721
+
722
+  
723
+    
724
+  
725
+
726
+
727
+  </script>
728
+
729
+