Browse Source

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

parent
commit
0aa38844d4

+ 3
- 0
app/controllers/OutcomesController.php View File

@@ -921,6 +921,9 @@ class OutcomesController extends \BaseController
921 921
     /**
922 922
      * School Assessment Reports
923 923
      */
924
+private function cmp($a, $b) {
925
+    return strcmp($a->name, $b->name);
926
+}
924 927
     public function schoolAssessmentReport()
925 928
     {
926 929
 

+ 296
- 0
app/controllers/ProgramsController.php View File

@@ -245,6 +245,302 @@ class ProgramsController extends \BaseController
245 245
     return View::make('local.managers.shared.program_report', compact('title', 'programs_info', 'selected_divulgaciones', 'selected_semesters', 'tables_names'));
246 246
   }
247 247
 
248
+	private function cmp($a, $b) 
249
+	{
250
+		return strcmp($a->name, $b->name);
251
+	}
252
+
253
+    public function studentProgramAssessmentReport($program_id)
254
+    {
255
+		$id=$program_id;
256
+		ini_set('memory_limit', -1);
257
+		ini_set('max_execution_time', 300);
258
+
259
+
260
+		$program = Program::find($program_id);
261
+		$title= $program->school->name.': '.$program->name;
262
+		$outcomes = Outcome::orderBy('name', 'asc')->get();
263
+		$schools = School::all();
264
+		$outcomeCount = Outcome::all()->count();
265
+		
266
+		$role=Auth::user()->role;
267
+
268
+		$programs_ids=array($program->id);
269
+
270
+	   $users = User::
271
+        select('users.*')
272
+        ->leftJoin('program_user', 'users.id', '=', 'program_user.user_id')
273
+        ->where(function($query) use($program)
274
+        {
275
+            $query
276
+                ->where('school_id', $program->school_id)
277
+                ->where('role', 2);
278
+        })
279
+        ->orWhere(function($query) use($program)
280
+        {
281
+            $query
282
+                ->where('role', 3)
283
+                ->where('program_id', $program->id);
284
+        })
285
+        ->orWhere(function($query) use($program)
286
+        {
287
+            $query
288
+                ->where('role', 4)
289
+                ->where('program_id', $program->id);
290
+        })
291
+        ->get();
292
+	
293
+// 		$outcomes = Outcome::orderBy('name', 'asc')->get();
294
+// 		$school = School::find($school_id);
295
+// 		$title= $school->name;
296
+// 		$outcomeCount = Outcome::all()->count();
297
+// 		$programs=Program::where('school_id','=',$school_id)->get();
298
+// 		$programs_ids=array();
299
+// // 				var_dump($programs);exit();
300
+// 		$programs_name=array();
301
+// 		foreach($programs as $program)
302
+// 		{
303
+// // 			var_dump($program);
304
+// 			$programs_ids[]=$program->id;
305
+// 			$programs_name[$program->id]=$program->name;
306
+// 		}
307
+
308
+        $grouped_courses = Course::
309
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
310
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
311
+            ->with('semester')
312
+            ->with('program')
313
+            ->whereIn('courses.program_id', $programs_ids)
314
+            ->whereIn('courses.semester_id', Session::get('semesters_ids'))
315
+            ->leftJoin('programs', 'courses.program_id', '=', 'programs.id')
316
+            ->groupBy(array('courses.code', 'courses.number', 'courses.semester_id'))
317
+            ->orderBy('courses.code')
318
+            ->orderBy('courses.number')
319
+            ->orderBy('courses.semester_id')
320
+            ->get();
321
+
322
+
323
+		$role=Auth::user()->role;
324
+
325
+		$users =array();
326
+
327
+
328
+		$resultados_todos_obj = DB::table('assessments')
329
+         						->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
330
+         						->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
331
+         						->join('courses', 'courses.id', '=', 'activities.course_id')
332
+         						->join('students', 'students.id', '=', 'assessments.student_id')
333
+         						->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
334
+         						->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
335
+         						->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
336
+         						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
337
+          						->whereIn('students.program_id',$programs_ids)
338
+                   			   	->whereIn('semester_id', Session::get('semesters_ids'))
339
+                   			   	->where('semesters.is_visible','=',1)
340
+                    			->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id','score','expected_points')
341
+								->distinct()
342
+                    			->get();
343
+
344
+		foreach($resultados_todos_obj as $resultado)
345
+		{
346
+			if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']))
347
+			{
348
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']=array();
349
+			}
350
+			$resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'][]=$resultado->code;
351
+			$resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']=array_unique($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']);
352
+			if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']))
353
+			{
354
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']=0;
355
+			}
356
+			$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']++;
357
+
358
+			if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']))
359
+			{
360
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']=0;
361
+			}
362
+			if($resultado->score>=$resultado->expected_points)
363
+			{
364
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']++;
365
+			}
366
+		}
367
+
368
+		$outcomes_colap=array();
369
+		$programs=array();
370
+// 			$outcomes_colap=array();
371
+		$i=0;
372
+		$outcomes_attempted=array();
373
+		$outcomes_attempted_colap=array();
374
+		$outcomes_achieved_colap=array();
375
+		$outcomes_attempted_semesters=array();
376
+		foreach($resultados_todos as $program_id => $resultados_prog)
377
+		{
378
+	     	$outcomes_attempted_semesters[$program_id]=array();
379
+			foreach($resultados_prog as $out=>$datos_out)
380
+			{
381
+				$outcomes_achieved[$program_id][$out] = 0;
382
+				$outcomes_attempted[$program_id][$out] = 0;
383
+// 				var_dump($datos_out);outcomes_attempted_semesters
384
+				$outcomes_attempted_semesters[$program_id][$out]=$datos_out['semesters'];
385
+				unset($datos_out['semesters']);
386
+// 				var_dump($outcomes_attempted_semesters[$program_id][$out]);
387
+// 				var_dump($datos_out);
388
+// 				exit();
389
+				foreach($datos_out as $res)
390
+				{
391
+					$outcomes_attempted[$program_id][$out]++;
392
+					if(3*$res['achieved']>=2*$res['attempted'])
393
+						$outcomes_achieved[$program_id][$out]++;
394
+				}		
395
+			}
396
+			$programs[]=Program::find($program_id);
397
+			if(Program::find($program_id)->is_graduate)
398
+			{
399
+				$colapso=array(1=>array(),3=>array(),2=>array(11),12=>array(7,14),10=>array(),4=>array(6,15));
400
+			}
401
+			else
402
+			{
403
+				$colapso=array(10=>array(),1=>array(),12=>array(7),3=>array(9,8,14),2=>array(11),5=>array(),4=>array(6,13),16=>array());
404
+			}	
405
+		
406
+			$resultados_todos_colap[$program_id]=array();
407
+			foreach($colapso as $out=>$pares)
408
+			{
409
+				$resultados_todos_colap[$program_id][$out]["semesters"]=array();
410
+				if(isset($resultados_todos[$program_id][$out]))
411
+					$resultados_todos_colap[$program_id][$out]=$resultados_todos[$program_id][$out];
412
+					else $resultados_todos_colap[$program_id][$out]=array();
413
+				foreach($pares as $par)
414
+				{
415
+					if(isset($resultados_todos[$program_id][$par]))
416
+					{	
417
+// 						unset($resultados_todos[$program_id][$par]['semesters']);
418
+						
419
+						foreach($resultados_todos[$program_id][$par] as $estu => $resus)
420
+						{
421
+							if($estu!="semesters")
422
+							{
423
+								if(!isset($resultados_todos_colap[$program_id][$out][$estu]))
424
+								{
425
+									$resultados_todos_colap[$program_id][$out][$estu]['attempted']=0;
426
+									$resultados_todos_colap[$program_id][$out][$estu]['achieved']=0;
427
+
428
+								}
429
+	// 							print $program_id." ".$par." ".$estu."<br>";
430
+	// 							var_dump($resultados_todos[$program_id][$par][$estu]); 
431
+								$resultados_todos_colap[$program_id][$out][$estu]['attempted']+=$resultados_todos[$program_id][$par][$estu]['attempted'];
432
+								$resultados_todos_colap[$program_id][$out][$estu]['achieved']+=$resultados_todos[$program_id][$par][$estu]['achieved'];
433
+							}
434
+							else if(isset($resultados_todos[$program_id][$par]["semesters"]))
435
+							{
436
+								if(isset($resultados_todos_colap[$program_id][$out]["semesters"]))
437
+								{
438
+									$tmp=array_merge($resultados_todos_colap[$program_id][$out]["semesters"],$resultados_todos[$program_id][$par]["semesters"]);
439
+// 									var_dump(($tmp));
440
+// 									var_dump(array_unique($tmp));
441
+// 									exit();
442
+
443
+									$resultados_todos_colap[$program_id][$out]["semesters"]=array_unique($tmp);
444
+								}
445
+								else 
446
+									$resultados_todos_colap[$program_id][$out]["semesters"]=array_unique($resultados_todos[$program_id][$par]["semesters"]);
447
+							}
448
+						}
449
+					}
450
+				}
451
+		
452
+			}
453
+// 			var_dump($resultados_todos_colap);
454
+			
455
+			$outcomes_attempted_colap[$program_id]=array();
456
+			$outcomes_achieved_colap[$program_id]=array();
457
+			$outcomes_attempted_colap_semesters[$program_id]=array();
458
+// 			print $program_id."<br>";
459
+// 				var_dump($resultados_todos_colap[$program_id]);
460
+// 			print "<br>";
461
+			foreach($resultados_todos_colap[$program_id] as $out=>$datos_out)
462
+			{
463
+				if(!$i)$outcomes_colap[]=Outcome::find($out);
464
+// 				$outcomes_attempted_colap_semesters[$program_id][$out]=array();
465
+				if(isset($datos_out['semesters']))
466
+				{
467
+					$outcomes_attempted_colap_semesters[$program_id][$out]=$datos_out['semesters'];
468
+					unset($datos_out['semesters']);
469
+				}
470
+				foreach($datos_out as $res)
471
+				{
472
+					if(!isset($outcomes_attempted_colap[$program_id][$out]))
473
+					{
474
+						$outcomes_attempted_colap[$program_id][$out]=0;
475
+						$outcomes_achieved_colap[$program_id][$out]=0;
476
+					
477
+					}
478
+					$outcomes_attempted_colap[$program_id][$out]++;
479
+					if(3*$res['achieved']>=2*$res['attempted'])
480
+						$outcomes_achieved_colap[$program_id][$out]++;
481
+				}
482
+				if(empty($datos_out))
483
+				{
484
+					$outcomes_attempted_colap[$program_id][$out]=0;
485
+					$outcomes_achieved_colap[$program_id][$out]=0;
486
+				}
487
+
488
+			}
489
+			$i++;
490
+		}		
491
+		usort($outcomes_colap, array($this, "cmp"));
492
+	// 		var_dump($outcomes_attempted_colap); print "<br>";
493
+	// 		var_dump($outcomes_achieved_colap); print "<br>";
494
+	// 	exit();
495
+		$outcomes_attempted_colap_todo=array();
496
+		$outcomes_achieved_colap_todo=array();
497
+		foreach($outcomes_attempted_colap as $program_id => $out_res)
498
+		{
499
+			foreach($out_res as $out=>$res)
500
+			{
501
+				if(!isset($outcomes_attempted_colap_todo[$out]))
502
+				{
503
+					$outcomes_attempted_colap_todo[$out]=0;
504
+					$outcomes_achieved_colap_todo[$out]=0;
505
+			
506
+				}
507
+				$outcomes_attempted_colap_todo[$out]+=$outcomes_attempted_colap[$program_id][$out];
508
+				$outcomes_achieved_colap_todo[$out]+=$outcomes_achieved_colap[$program_id][$out];
509
+		
510
+		
511
+			}
512
+	
513
+		}
514
+		$outcomes_attempted_todo=array();
515
+		$outcomes_achieved_todo=array();
516
+		foreach($outcomes_attempted as $program_id => $out_res)
517
+		{
518
+			foreach($out_res as $out=>$res)
519
+			{
520
+				if(!isset($outcomes_attempted_todo[$out]))
521
+				{
522
+					$outcomes_attempted_todo[$out]=0;
523
+					$outcomes_achieved_todo[$out]=0;
524
+			
525
+				}
526
+				$outcomes_attempted_todo[$out]+=$outcomes_attempted[$program_id][$out];
527
+				$outcomes_achieved_todo[$out]+=$outcomes_achieved[$program_id][$out];
528
+		
529
+		
530
+			}
531
+	
532
+		}
533
+	$outcomes_attempted_colap=$outcomes_attempted_colap_todo;
534
+	$outcomes_achieved_colap=$outcomes_achieved_colap_todo;
535
+	$outcomes_attempted=$outcomes_attempted_todo;
536
+	$outcomes_achieved=$outcomes_achieved_todo;
537
+// 	var_dump($outcomes_attempted_colap);
538
+// 	var_dump($outcomes_attempted_colap);
539
+// 	    return View::make('local.managers.shared.school_student_result', compact('title','outcomes_attempted_colap_semesters','outcomes_attempted_semesters','outcomes_attempted_colap_todo','outcomes_achieved_colap_todo','outcomes_attempted_todo','outcomes_achieved_todo','school','programs_name','role','outcomes','outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users','program_courses','grouped_courses'));
540
+
541
+    return View::make('local.managers.shared.program_student_result', compact('title','role','outcomes','outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'program', 'users','program_courses','grouped_courses'));
542
+    }
543
+
248 544
   //   public function show($id)
249 545
   //   {
250 546
   //

+ 256
- 0
app/controllers/SchoolsController.php View File

@@ -213,6 +213,262 @@ class SchoolsController extends \BaseController
213 213
         }
214 214
     }
215 215
 
216
+	private function cmp($a, $b) 
217
+	{
218
+		return strcmp($a->name, $b->name);
219
+	}
220
+
221
+    public function studentSchoolAssessmentReport($school_id)
222
+    {
223
+		$id=$school_id;
224
+		ini_set('memory_limit', -1);
225
+		ini_set('max_execution_time', 300);
226
+	
227
+		$outcomes = Outcome::orderBy('name', 'asc')->get();
228
+		$school = School::find($school_id);
229
+		$title= $school->name;
230
+		$outcomeCount = Outcome::all()->count();
231
+		$programs=Program::where('school_id','=',$school_id)->get();
232
+		$programs_ids=array();
233
+// 				var_dump($programs);exit();
234
+		$programs_name=array();
235
+		foreach($programs as $program)
236
+		{
237
+// 			var_dump($program);
238
+			$programs_ids[]=$program->id;
239
+			$programs_name[$program->id]=$program->name;
240
+		}
241
+
242
+        $grouped_courses = Course::
243
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
244
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
245
+            ->with('semester')
246
+            ->with('program')
247
+            ->whereIn('courses.program_id', $programs_ids)
248
+            ->whereIn('courses.semester_id', Session::get('semesters_ids'))
249
+            ->leftJoin('programs', 'courses.program_id', '=', 'programs.id')
250
+            ->groupBy(array('courses.code', 'courses.number', 'courses.semester_id'))
251
+            ->orderBy('courses.code')
252
+            ->orderBy('courses.number')
253
+            ->orderBy('courses.semester_id')
254
+            ->get();
255
+
256
+
257
+		$role=Auth::user()->role;
258
+
259
+		$users =array();
260
+
261
+
262
+		$resultados_todos_obj = DB::table('assessments')
263
+         						->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
264
+         						->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
265
+         						->join('courses', 'courses.id', '=', 'activities.course_id')
266
+         						->join('students', 'students.id', '=', 'assessments.student_id')
267
+         						->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
268
+         						->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
269
+         						->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
270
+         						->join('semesters', 'semesters.id', '=', 'courses.semester_id')
271
+          						->whereIn('students.program_id',$programs_ids)
272
+                   			   	->whereIn('semester_id', Session::get('semesters_ids'))
273
+                   			   	->where('semesters.is_visible','=',1)
274
+                    			->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id','score','expected_points')
275
+								->distinct()
276
+                    			->get();
277
+
278
+		foreach($resultados_todos_obj as $resultado)
279
+		{
280
+			if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']))
281
+			{
282
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']=array();
283
+			}
284
+			$resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters'][]=$resultado->code;
285
+			$resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']=array_unique($resultados_todos[$resultado->program_id][$resultado->outcome_id]['semesters']);
286
+			if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']))
287
+			{
288
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']=0;
289
+			}
290
+			$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['attempted']++;
291
+
292
+			if(!isset($resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']))
293
+			{
294
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']=0;
295
+			}
296
+			if($resultado->score>=$resultado->expected_points)
297
+			{
298
+				$resultados_todos[$resultado->program_id][$resultado->outcome_id][$resultado->student_id]['achieved']++;
299
+			}
300
+		}
301
+
302
+		$outcomes_colap=array();
303
+		$programs=array();
304
+// 			$outcomes_colap=array();
305
+		$i=0;
306
+		$outcomes_attempted=array();
307
+		$outcomes_attempted_colap=array();
308
+		$outcomes_achieved_colap=array();
309
+		$outcomes_attempted_semesters=array();
310
+		foreach($resultados_todos as $program_id => $resultados_prog)
311
+		{
312
+	     	$outcomes_attempted_semesters[$program_id]=array();
313
+			foreach($resultados_prog as $out=>$datos_out)
314
+			{
315
+				$outcomes_achieved[$program_id][$out] = 0;
316
+				$outcomes_attempted[$program_id][$out] = 0;
317
+// 				var_dump($datos_out);outcomes_attempted_semesters
318
+				$outcomes_attempted_semesters[$program_id][$out]=$datos_out['semesters'];
319
+				unset($datos_out['semesters']);
320
+// 				var_dump($outcomes_attempted_semesters[$program_id][$out]);
321
+// 				var_dump($datos_out);
322
+// 				exit();
323
+				foreach($datos_out as $res)
324
+				{
325
+					$outcomes_attempted[$program_id][$out]++;
326
+					if(3*$res['achieved']>=2*$res['attempted'])
327
+						$outcomes_achieved[$program_id][$out]++;
328
+				}		
329
+			}
330
+			$programs[]=Program::find($program_id);
331
+			if(Program::find($program_id)->is_graduate)
332
+			{
333
+				$colapso=array(1=>array(),3=>array(),2=>array(11),12=>array(7,14),10=>array(),4=>array(6,15));
334
+			}
335
+			else
336
+			{
337
+				$colapso=array(10=>array(),1=>array(),12=>array(7),3=>array(9,8,14),2=>array(11),5=>array(),4=>array(6,13),16=>array());
338
+			}	
339
+		
340
+			$resultados_todos_colap[$program_id]=array();
341
+			foreach($colapso as $out=>$pares)
342
+			{
343
+				$resultados_todos_colap[$program_id][$out]["semesters"]=array();
344
+				if(isset($resultados_todos[$program_id][$out]))
345
+					$resultados_todos_colap[$program_id][$out]=$resultados_todos[$program_id][$out];
346
+					else $resultados_todos_colap[$program_id][$out]=array();
347
+				foreach($pares as $par)
348
+				{
349
+					if(isset($resultados_todos[$program_id][$par]))
350
+					{	
351
+// 						unset($resultados_todos[$program_id][$par]['semesters']);
352
+						
353
+						foreach($resultados_todos[$program_id][$par] as $estu => $resus)
354
+						{
355
+							if($estu!="semesters")
356
+							{
357
+								if(!isset($resultados_todos_colap[$program_id][$out][$estu]))
358
+								{
359
+									$resultados_todos_colap[$program_id][$out][$estu]['attempted']=0;
360
+									$resultados_todos_colap[$program_id][$out][$estu]['achieved']=0;
361
+
362
+								}
363
+	// 							print $program_id." ".$par." ".$estu."<br>";
364
+	// 							var_dump($resultados_todos[$program_id][$par][$estu]); 
365
+								$resultados_todos_colap[$program_id][$out][$estu]['attempted']+=$resultados_todos[$program_id][$par][$estu]['attempted'];
366
+								$resultados_todos_colap[$program_id][$out][$estu]['achieved']+=$resultados_todos[$program_id][$par][$estu]['achieved'];
367
+							}
368
+							else if(isset($resultados_todos[$program_id][$par]["semesters"]))
369
+							{
370
+								if(isset($resultados_todos_colap[$program_id][$out]["semesters"]))
371
+								{
372
+									$tmp=array_merge($resultados_todos_colap[$program_id][$out]["semesters"],$resultados_todos[$program_id][$par]["semesters"]);
373
+// 									var_dump(($tmp));
374
+// 									var_dump(array_unique($tmp));
375
+// 									exit();
376
+
377
+									$resultados_todos_colap[$program_id][$out]["semesters"]=array_unique($tmp);
378
+								}
379
+								else 
380
+									$resultados_todos_colap[$program_id][$out]["semesters"]=array_unique($resultados_todos[$program_id][$par]["semesters"]);
381
+							}
382
+						}
383
+					}
384
+				}
385
+		
386
+			}
387
+// 			var_dump($resultados_todos_colap);
388
+			
389
+			$outcomes_attempted_colap[$program_id]=array();
390
+			$outcomes_achieved_colap[$program_id]=array();
391
+			$outcomes_attempted_colap_semesters[$program_id]=array();
392
+// 			print $program_id."<br>";
393
+// 				var_dump($resultados_todos_colap[$program_id]);
394
+// 			print "<br>";
395
+			foreach($resultados_todos_colap[$program_id] as $out=>$datos_out)
396
+			{
397
+				if(!$i)$outcomes_colap[]=Outcome::find($out);
398
+// 				$outcomes_attempted_colap_semesters[$program_id][$out]=array();
399
+				if(isset($datos_out['semesters']))
400
+				{
401
+					$outcomes_attempted_colap_semesters[$program_id][$out]=$datos_out['semesters'];
402
+					unset($datos_out['semesters']);
403
+				}
404
+				foreach($datos_out as $res)
405
+				{
406
+					if(!isset($outcomes_attempted_colap[$program_id][$out]))
407
+					{
408
+						$outcomes_attempted_colap[$program_id][$out]=0;
409
+						$outcomes_achieved_colap[$program_id][$out]=0;
410
+					
411
+					}
412
+					$outcomes_attempted_colap[$program_id][$out]++;
413
+					if(3*$res['achieved']>=2*$res['attempted'])
414
+						$outcomes_achieved_colap[$program_id][$out]++;
415
+				}
416
+				if(empty($datos_out))
417
+				{
418
+					$outcomes_attempted_colap[$program_id][$out]=0;
419
+					$outcomes_achieved_colap[$program_id][$out]=0;
420
+				}
421
+
422
+			}
423
+			$i++;
424
+		}		
425
+		usort($outcomes_colap, array($this, "cmp"));
426
+	// 		var_dump($outcomes_attempted_colap); print "<br>";
427
+	// 		var_dump($outcomes_achieved_colap); print "<br>";
428
+	// 	exit();
429
+		$outcomes_attempted_colap_todo=array();
430
+		$outcomes_achieved_colap_todo=array();
431
+		foreach($outcomes_attempted_colap as $program_id => $out_res)
432
+		{
433
+			foreach($out_res as $out=>$res)
434
+			{
435
+				if(!isset($outcomes_attempted_colap_todo[$out]))
436
+				{
437
+					$outcomes_attempted_colap_todo[$out]=0;
438
+					$outcomes_achieved_colap_todo[$out]=0;
439
+			
440
+				}
441
+				$outcomes_attempted_colap_todo[$out]+=$outcomes_attempted_colap[$program_id][$out];
442
+				$outcomes_achieved_colap_todo[$out]+=$outcomes_achieved_colap[$program_id][$out];
443
+		
444
+		
445
+			}
446
+	
447
+		}
448
+		$outcomes_attempted_todo=array();
449
+		$outcomes_achieved_todo=array();
450
+		foreach($outcomes_attempted as $program_id => $out_res)
451
+		{
452
+			foreach($out_res as $out=>$res)
453
+			{
454
+				if(!isset($outcomes_attempted_todo[$out]))
455
+				{
456
+					$outcomes_attempted_todo[$out]=0;
457
+					$outcomes_achieved_todo[$out]=0;
458
+			
459
+				}
460
+				$outcomes_attempted_todo[$out]+=$outcomes_attempted[$program_id][$out];
461
+				$outcomes_achieved_todo[$out]+=$outcomes_achieved[$program_id][$out];
462
+		
463
+		
464
+			}
465
+	
466
+		}
467
+	
468
+
469
+	    return View::make('local.managers.shared.school_student_result', compact('title','outcomes_attempted_colap_semesters','outcomes_attempted_semesters','outcomes_attempted_colap_todo','outcomes_achieved_colap_todo','outcomes_attempted_todo','outcomes_achieved_todo','school','programs_name','role','outcomes','outcomes_colap', 'outcomes_attempted', 'outcomes_achieved', 'outcomes_attempted_colap', 'outcomes_achieved_colap', 'programs', 'users','program_courses','grouped_courses'));
470
+    }
471
+
216 472
     public function showQuasiOri($id)
217 473
     {
218 474
         ini_set('memory_limit', '256M');

+ 63
- 0
app/controllers/TemplatesController.php View File

@@ -184,6 +184,69 @@ class TemplatesController extends \BaseController
184 184
 		return View::make('local.managers.shared.rubrics', compact('title', 'templates', 'outcomes', 'criteria', 'schools', 'programs'));
185 185
 	}
186 186
 
187
+	public function newTemplate_new()
188
+	{
189
+		$title = "Rubric Builder";
190
+
191
+		$templates = Template::orderBy('name', 'ASC')->get();
192
+		$outcomes = Outcome::where("deactivation_date", '=', null)->orderBy('name', 'ASC')->get();
193
+		$schools = School::orderBy('name', 'ASC')->get();
194
+		$role = Auth::user()->role;
195
+
196
+		$templates = NULL;
197
+		$programs = NULL;
198
+		// Returns templates depending on the type of user
199
+		if ($role == 1) {
200
+			$templates = Template::orderBy('name', 'ASC')->get();
201
+			$programs = Program::orderBy('name', 'ASC')->get();
202
+			$criteria = Criterion::orderBy('name', 'ASC')->get();
203
+		} 
204
+		else
205
+		{
206
+			if ($role == 2) {
207
+				$programs = Auth::user()->school->programs;
208
+			} 
209
+			if ($role == 3) {
210
+				$programs = Auth::user()->programs()->get();
211
+			}
212
+			$program_ids=array();		
213
+			foreach($programs as $program)
214
+			{
215
+				$program_ids[]=$program->id;
216
+			}
217
+			$criteria = Criterion::whereHas('programs', function ($q) use ($program_ids)
218
+			{
219
+				$q->whereIn('program_id', $program_ids );
220
+			}
221
+			)->orderBy('name', 'ASC')->get();
222
+			$templates = Template::where('school_id', '=', Auth::user()->programs[0]->school->id)->orWhere('school_id', '=', NULL)
223
+			->orderBy('name', 'ASC')->get();
224
+			$criteria_ids=array();		
225
+			foreach($criteria as $criterion)
226
+			{
227
+				$criteria_ids[]=$criterion->id;
228
+			}
229
+			$templates_fuera = Template::whereHas('criteria', function ($q) use ($criteria_ids)
230
+			{
231
+				$q->whereNotIn('criterion_id', $criteria_ids );
232
+			})
233
+			->orderBy('name', 'ASC')->get();
234
+			$templates_fuera_ids=array();		
235
+			foreach($templates_fuera as $tf)
236
+			{
237
+				$templates_fuera_ids[]=$tf->id;
238
+			}
239
+			$templates_dentro = Template::whereNotIn('id', $templates_fuera_ids)
240
+			->orderBy('name', 'ASC')->get();
241
+			
242
+	// 			var_dump(json_encode($templates_dentro));
243
+		}		
244
+	
245
+	
246
+
247
+		return View::make('local.managers.shared.rubrics_new', compact('title', 'templates_dentro', 'templates_fuera', 'outcomes', 'criteria', 'schools', 'programs', 'criteria_ids'));
248
+	}
249
+
187 250
 	/**
188 251
 	 * Save a new rubric
189 252
 	 *

+ 6
- 0
app/models/Criterion.php View File

@@ -41,6 +41,12 @@ class Criterion extends Eloquent
41 41
 	 *
42 42
 	 * @return Illuminate\Database\Eloquent\Model
43 43
 	 */
44
+	public function programs()
45
+	{
46
+		return $this->belongsToMany('Program','program_criterion');
47
+	}
48
+
49
+
44 50
 	public function program()
45 51
 	{
46 52
 		return $this->belongsTo('Program');

+ 6
- 0
app/models/Template.php View File

@@ -12,4 +12,10 @@ class Template extends Eloquent
12 12
         return $this->belongsTo('School');
13 13
     }
14 14
 
15
+	public function criteria()
16
+	{
17
+		return $this->belongsToMany('Criterion','template_criterion');
18
+	}
19
+
20
+
15 21
 }

+ 6
- 1
app/routes.php View File

@@ -411,6 +411,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
411 411
         // Assessment reports
412 412
 
413 413
         Route::get('school-assessment-report', 'OutcomesController@schoolAssessmentReport');
414
+        Route::get('student_school_assessment-report/{school_id}', 'SchoolsController@studentSchoolAssessmentReport');
414 415
 
415 416
         // Gabriel added this, so the school coordinator can add criterias and objectives
416 417
         Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
@@ -452,7 +453,8 @@ Route::group(array('before' => 'auth|has_access'), function () {
452 453
     Route::group(array('before' => 'pcoord'), function () {
453 454
         Route::get('program-coordinator', 'ProgramCoordinatorsController@overview');
454 455
         Route::post('deleteObjective', 'Objective2Controller@delete');
455
-        Route::get('rubrics', 'TemplatesController@newTemplate');
456
+        Route::get('rubrics_old', 'TemplatesController@newTemplate');
457
+        Route::get('rubrics', 'TemplatesController@newTemplate_new');
456 458
         Route::get('template/{template}', 'TemplatesController@show');
457 459
 
458 460
         Route::post('saveTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@create'));
@@ -467,6 +469,9 @@ Route::group(array('before' => 'auth|has_access'), function () {
467 469
         Route::get('grouped_course/{code}/{number}/{semester_code}', 'CoursesController@showGrouped');
468 470
         Route::get('template-list', 'TemplatesController@index');
469 471
 
472
+        Route::get('student_program_assessment-report/{program_id}', 'ProgramsController@studentProgramAssessmentReport');
473
+
474
+
470 475
         //Criteria and objectives
471 476
         Route::get('program-criteria', 'CriteriaController@editProgram');
472 477
         Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));

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

@@ -11,6 +11,7 @@
11 11
 @stop
12 12
 
13 13
 @section('main')
14
+<a href="{{ action('ProgramsController@studentProgramAssessmentReport', array($program->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by Program Students</a>
14 15
 <a href="{{ action('ProgramsController@print_program', array($program->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
15 16
 <br>
16 17
 <br>

+ 538
- 0
app/views/local/managers/shared/program_student_result.blade.php View File

@@ -0,0 +1,538 @@
1
+@extends('layouts.master')
2
+
3
+
4
+@section('navigation')
5
+    @if($role==1)
6
+        @include('local.managers.admins._navigation')
7
+    @elseif($role==2)
8
+        @include('local.managers.sCoords._navigation')
9
+     @endif
10
+@stop
11
+
12
+@section('main')
13
+<a href="{{ action('ProgramsController@show', array($program->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by Program Courses</a>
14
+
15
+<a href="{{ action('ProgramsController@print_program', array($program->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
16
+<br>
17
+<br>
18
+<div class="row">
19
+    <ul id="resultsTabs" class="nav nav-tabs" role="tablist">
20
+        <li role="presentation" class="active"><a href="#combined" aria-controls="combined" role="tab">Combined</a></li>
21
+        <li role="presentation"><a href="#uncombined" aria-controls="uncombined" role="tab">Uncombined</a></li>
22
+    </ul>
23
+	<div>
24
+<!-- 	<div class="tab-content"> -->
25
+
26
+	<div role="tabpanel" class="tab-pane active" id="combined">
27
+	<div class="row">
28
+		<div class="col-md-12" id="graph2"></div>
29
+	</div>
30
+
31
+            <div class="row">
32
+                <div class="col-md-12">
33
+                    <h3>Performance of {{ $program->name }} Students by Combined Learning Outcome</h3>
34
+                    @if($outcomes->count()>0)
35
+                        <table class="table table-striped table-condensed datatable">
36
+                            <thead>
37
+                                <tr>
38
+                                    <th>Program Id</th>
39
+                                    <th>Program Is Graduate</th>
40
+                                    <th>Learning Outcome</th>
41
+                                    <th>Number Students</th>
42
+                                    <th>Number Students that Achieved the Target</th>
43
+                                    <th>Percentage of Students that Achieved the Target</th>
44
+                                </tr>
45
+                            </thead>
46
+                            <tfoot>
47
+                                <tr class="column-search">
48
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
49
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
50
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
51
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
52
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
53
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
54
+                                </tr>
55
+                            </tfoot>
56
+                            <tbody>
57
+                                @foreach($outcomes_colap as $outcome)
58
+                                    @if(isset($outcomes_attempted_colap[$program->id][$outcome->id]))
59
+              					<tr>
60
+										<td>{{{ $program->id }}}</td>
61
+										<td>{{{ $program->is_graduate }}}</td>
62
+										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
63
+										<td>{{{ $outcomes_attempted_colap[$outcome->id] }}}</td>
64
+										<td>{{{ $outcomes_achieved_colap[$outcome->id] }}}</td>
65
+										<td>
66
+											@if($outcomes_attempted[$outcome->id]!=0)
67
+												{{{ round($outcomes_achieved_colap[$outcome->id] / $outcomes_attempted_colap[$outcome->id]*100, 2) }}}%
68
+											@else
69
+												N/M
70
+											@endif
71
+										</td>
72
+                                    </tr>
73
+                                    @endif
74
+                                @endforeach
75
+                            </tbody>
76
+                        </table>
77
+                    @else
78
+                        <p class="lead"> No courses assigned.</p>
79
+                    @endif
80
+                </div>
81
+            </div>
82
+            </div>
83
+		<div role="tabpanel" class="tab-pane" id="uncombined">
84
+	<div class="row">
85
+		<div class="col-md-12" id="graph"></div>
86
+	</div>
87
+
88
+            <div class="row">
89
+                <div class="col-md-12">
90
+                    <h3>Performance of {{ $program->name }} Students by Uncombined Learning Outcome</h3>
91
+                    @if($outcomes->count()>0)
92
+                        <table class="table table-striped table-condensed datatable">
93
+                            <thead>
94
+                                <tr>
95
+                                    <th>Program Id</th>
96
+                                    <th>Program Is Graduate</th>
97
+                                    <th>Learning Outcome</th>
98
+                                    <th>Number Students</th>
99
+                                    <th>Number Students that Achieved the Target</th>
100
+                                    <th>Percentage of Students that Achieved the Target</th>
101
+                                </tr>
102
+                            </thead>
103
+                            <tfoot>
104
+                                <tr class="column-search">
105
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
106
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
107
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
108
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
109
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
110
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
111
+                                </tr>
112
+                            </tfoot>
113
+                            <tbody>
114
+                                @foreach($outcomes as $outcome)
115
+                                     @if(isset($outcomes_attempted[$program->id][$outcome->id]))
116
+                                   <tr>
117
+										<td>{{{ $program->id }}}</td>
118
+										<td>{{{ $program->is_graduate }}}</td>
119
+										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
120
+										<td>{{{ $outcomes_attempted[$outcome->id] }}}</td>
121
+										<td>{{{ $outcomes_achieved[$outcome->id] }}}</td>
122
+										<td>
123
+											@if($outcomes_attempted[$outcome->id]!=0)
124
+												{{{ round($outcomes_achieved[$outcome->id] / $outcomes_attempted[$outcome->id]*100, 2) }}}%
125
+											@else
126
+												N/M
127
+											@endif
128
+										</td>
129
+                                    </tr>
130
+                                    @endif
131
+                                @endforeach
132
+                            </tbody>
133
+                        </table>
134
+                    @else
135
+                        <p class="lead"> No courses assigned.</p>
136
+                    @endif
137
+                </div>
138
+            </div>
139
+</div>
140
+	</div>
141
+</div>
142
+ <!-- =================== tabs =================== -->
143
+<div class="row">
144
+    <!-- Nav tabs -->
145
+   <!-- Tab panes -->
146
+    <ul id="programTabs" class="nav nav-tabs" role="tablist">
147
+        <li role="presentation" class="active"><a href="#courses" aria-controls="courses" role="tab">Courses</a></li>
148
+        <li role="presentation"><a href="#contact" aria-controls="contact" role="tab">Contact Information</a></li>
149
+    </ul>
150
+    <div class="tab-content">
151
+
152
+       <div role="tabpanel" class="tab-pane active" id="courses">
153
+            <div class="row">
154
+                <div class="col-md-12">
155
+                    <h3>Courses in this program</h3>
156
+                    @if(count($grouped_courses)>0)
157
+                        <table class="table table-striped table-condensed datatable">
158
+                            <thead>
159
+                                <tr>
160
+                                    <th>Identifier</th>
161
+                                    <th>Name</th>
162
+                                    <th>Course Program</th>
163
+                                    <th>Number of Students</th>
164
+                                </tr>
165
+                            </thead>
166
+                            <tfoot>
167
+                                <tr class="column-search">
168
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
169
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
170
+                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
171
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
172
+                                </tr>
173
+                            </tfoot>
174
+                            <tbody>
175
+                                @foreach($grouped_courses as $grouped_course)
176
+                                    <tr>
177
+                                        <td class="col-md-2">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
178
+                                        <td class="col-md-4">{{{ $grouped_course->name}}}</td>
179
+                                        <td class="col-md-2">{{{ $grouped_course->program_code}}}</td>
180
+                                        <td class="col-md-3">{{{ $grouped_course->quantity }}}</td>
181
+                                    </tr>
182
+                                @endforeach
183
+                            </tbody>
184
+                        </table>
185
+                    @else
186
+                        <p class="lead"> No courses assigned.</p>
187
+                    @endif
188
+                </div>
189
+            </div>
190
+        </div>
191
+        <div role="tabpanel" class="tab-pane" id="contact">
192
+            <div class="row">
193
+                <div class="col-md-12">
194
+                    <h3>Contact Information</h3>
195
+                    <table class="table table-striped datatable">
196
+                        <thead>
197
+                            <tr>
198
+                                <th>Name</th>
199
+                                <th>Role</th>
200
+                                <th>Program</th>
201
+                                <th>Email</th>
202
+                                <th>Office Phone</th>
203
+                            </tr>
204
+                        </thead>
205
+                        <tfoot>
206
+                            <tr class="column-search">
207
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
208
+                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
209
+                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
210
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
211
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
212
+                            </tr>
213
+                        </tfoot>
214
+                        <tbody>
215
+                            @foreach($users as $user)
216
+                                <tr>
217
+                                    <td>{{ $user->surnames }}, {{ $user->first_name }}</td>
218
+
219
+                                    @if($user->role == 1)
220
+                                        <td>Administrator</td>
221
+                                        <td>All</td>
222
+                                    @elseif($user->role == 2)
223
+                                        <td>School Coordinator</td>
224
+                                        <td>All in {{ $program->school->name }}</td>
225
+                                    @elseif($user->role == 3)
226
+                                        <td>Program Coordinator</td>
227
+                                        <td>
228
+                                            @foreach ($user->programs as $program)
229
+                                                {{ $program->name }}&nbsp;
230
+                                            @endforeach
231
+                                        </td>
232
+                                    @else
233
+                                        <td>Professor</td>
234
+                                        <td>
235
+                                            @foreach ($user->programs as $program)
236
+                                                {{ $program->name }}&nbsp;
237
+                                            @endforeach
238
+                                        </td>
239
+                                    @endif
240
+
241
+                                    <td>
242
+                                        <a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
243
+                                    </td>
244
+                                    <td>
245
+                                        @if($user->office_phone)
246
+                                            {{{ $user->office_phone }}}
247
+
248
+                                            @if($user->office_extension)
249
+                                                <span>ext.</span> {{{ $user->office_extension }}}
250
+                                            @endif
251
+                                        @else
252
+                                            Not set
253
+                                        @endif
254
+                                    </td>
255
+                                </tr>
256
+                            @endforeach
257
+                        </tbody>
258
+                    </table>
259
+                </div>
260
+            </div>
261
+        </div>
262
+    </div>
263
+</div>
264
+<!-- =================== end tabs =================== -->
265
+
266
+@stop
267
+
268
+@section('included-js')
269
+
270
+<!-- HighCharts -->
271
+<script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
272
+<!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
273
+
274
+<!-- Datatables -->
275
+@include('global._datatables_js')
276
+
277
+@stop
278
+
279
+@section('javascript')
280
+
281
+$('#programTabs a').click(function (e) {
282
+    e.preventDefault()
283
+    $(this).tab('show');
284
+});
285
+
286
+
287
+$('#graph').highcharts({
288
+    chart: {
289
+        type: 'bar'
290
+    },
291
+    title: {
292
+        text: 'Performance of {{ $program->name }} Students by Uncombined Learning Outcome'
293
+    },
294
+    legend: {
295
+                reversed: true,
296
+            },
297
+    xAxis: {
298
+        categories: [
299
+            @foreach($outcomes as $outcome)
300
+             @if(isset($outcomes_attempted[$outcome->id]))
301
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted[$outcome->id] }}}, {{{ $outcomes_achieved[$outcome->id] }}})",
302
+            @endif
303
+            @endforeach
304
+        ],
305
+        labels: {
306
+            style: {
307
+                fontSize:'11px'
308
+            },
309
+            step:1,
310
+            useHTML:true,
311
+            formatter: function() {
312
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
313
+            },
314
+        }
315
+    },
316
+    yAxis: {
317
+        min: 0,
318
+        max: 100,
319
+        title: {
320
+            text: 'Percentage'
321
+        },
322
+			plotLines:[{
323
+		value:70,
324
+		color: '#000',
325
+		width:3,
326
+		zIndex:4,
327
+		label:{
328
+			text: 'Goal (70%)',
329
+			style: {
330
+				color: '#000',
331
+				fontSize: '14px',
332
+			}
333
+
334
+		}
335
+	}]
336
+
337
+    },
338
+    tooltip: {
339
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
340
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
341
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
342
+        footerFormat: '</table>',
343
+        shared: true,
344
+        useHTML: true
345
+    },
346
+    plotOptions: {
347
+        bar: {
348
+            //grouping: false,
349
+            shadow: false,
350
+            borderWidth: 0,
351
+        },
352
+        series: {
353
+        pointPadding: 0,
354
+        groupPadding: 0.075
355
+        },
356
+    },
357
+    series: [{
358
+        name: 'Expected Value',
359
+        color: '#555555',
360
+        dataLabels: {
361
+            enabled: true,
362
+            fontSize: 8,
363
+            color: '#fff',
364
+            align: 'right',
365
+            format: '{y:.1f}%',
366
+            style: {
367
+                //fontWeight: 'bold'
368
+            },
369
+            y:-1
370
+        },
371
+        data: [
372
+            @foreach($outcomes as $index => $outcome)
373
+                @if(
374
+                    is_array($outcomes_attempted)
375
+                    && array_key_exists($outcome->id, $outcomes_attempted)
376
+                    && $outcomes_attempted[$outcome->id]!=0)
377
+                @else
378
+                    0,
379
+                @endif
380
+            @endforeach
381
+        ]
382
+
383
+    },{
384
+        name: 'Obtained Value',
385
+        color: '#e70033',
386
+        dataLabels: {
387
+            enabled: true,
388
+            fontSize: 8,
389
+            color: '#fff',
390
+            align: 'right',
391
+            format: '{y:.1f}%',
392
+            style: {
393
+                //fontWeight: 'bold'
394
+            },
395
+            y:-1
396
+        },
397
+        data:[
398
+            @foreach($outcomes as $index => $outcome)
399
+                @if(
400
+                    is_array($outcomes_attempted)
401
+                    && array_key_exists($outcome->id, $outcomes_attempted)
402
+                    && $outcomes_attempted[$outcome->id]!=0)
403
+                    {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
404
+                @else
405
+                    0,
406
+                @endif
407
+            @endforeach
408
+        ]
409
+    }]
410
+});
411
+
412
+$('#graph2').highcharts({
413
+    chart: {
414
+        type: 'bar'
415
+    },
416
+    title: {
417
+        text: 'Performance of {{ $program->name }} Students by Combined Learning Outcome'
418
+    },
419
+    legend: {
420
+                reversed: true,
421
+            },
422
+    xAxis: {
423
+        categories: [
424
+            @foreach($outcomes_colap as $outcome)
425
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted_colap[$outcome->id] }}}, {{{ $outcomes_achieved_colap[$outcome->id] }}})",
426
+            @endforeach
427
+        ],
428
+        labels: {
429
+            style: {
430
+                fontSize:'11px'
431
+            },
432
+            step:1,
433
+            useHTML:true,
434
+            formatter: function() {
435
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
436
+            },
437
+        }
438
+    },
439
+    yAxis: {
440
+        min: 0,
441
+        max: 100,
442
+        title: {
443
+            text: 'Percentage'
444
+        },
445
+        			plotLines:[{
446
+		value:70,
447
+		color: '#000',
448
+		width:3,
449
+		zIndex:4,
450
+		label:{
451
+			text: 'Goal (70%)',
452
+			style: {
453
+				color: '#000',
454
+				fontSize: '14px',
455
+			}
456
+
457
+		}
458
+	}]
459
+
460
+    },
461
+    tooltip: {
462
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
463
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
464
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
465
+        footerFormat: '</table>',
466
+        shared: true,
467
+        useHTML: true
468
+    },
469
+    plotOptions: {
470
+        bar: {
471
+            //grouping: false,
472
+            shadow: false,
473
+            borderWidth: 0,
474
+        },
475
+        series: {
476
+        pointPadding: 0,
477
+        groupPadding: 0.075
478
+        },
479
+    },
480
+    series: [{
481
+        name: 'Expected Value',
482
+        color: '#555555',
483
+        dataLabels: {
484
+            enabled: true,
485
+            fontSize: 8,
486
+            color: '#fff',
487
+            align: 'right',
488
+            format: '{y:.1f}%',
489
+            style: {
490
+                //fontWeight: 'bold'
491
+            },
492
+            y:-1
493
+        },
494
+        data: [
495
+            @foreach($outcomes_colap as $index => $outcome)
496
+                @if(
497
+                    is_array($outcomes_attempted_colap)
498
+                    && array_key_exists($outcome->id, $outcomes_attempted_colap)
499
+                    && $outcomes_attempted_colap[$outcome->id]!=0)
500
+                @else
501
+                    0,
502
+                @endif
503
+            @endforeach
504
+        ]
505
+
506
+    },{
507
+        name: 'Obtained Value',
508
+        color: '#e70033',
509
+        dataLabels: {
510
+            enabled: true,
511
+            fontSize: 8,
512
+            color: '#fff',
513
+            align: 'right',
514
+            format: '{y:.1f}%',
515
+            style: {
516
+                //fontWeight: 'bold'
517
+            },
518
+            y:-1
519
+        },
520
+        data:[
521
+            @foreach($outcomes_colap as $index => $outcome)
522
+                @if(
523
+                    is_array($outcomes_attempted_colap)
524
+                    && array_key_exists($outcome->id, $outcomes_attempted)
525
+                    && $outcomes_attempted_colap[$outcome->id]!=0)
526
+                    {{{ ($outcomes_achieved_colap[$outcome->id]/$outcomes_attempted_colap[$outcome->id])*100 }}},
527
+                @else
528
+                    0,
529
+                @endif
530
+            @endforeach
531
+        ]
532
+    }]
533
+});
534
+
535
+// Include dummy graph for outcomes
536
+@include('global.dummy-outcomes')
537
+
538
+@stop

+ 1525
- 0
app/views/local/managers/shared/rubrics_new.blade.php
File diff suppressed because it is too large
View File


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

@@ -9,6 +9,7 @@
9 9
 @stop
10 10
 
11 11
 @section('main')
12
+<a href="{{ action('SchoolsController@studentSchoolAssessmentReport', array($school->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by School Students</a>
12 13
 <a href="{{ action('SchoolsController@print_school', array($school->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
13 14
 <br>
14 15
 <br>

+ 570
- 0
app/views/local/managers/shared/school_student_result.blade.php View File

@@ -0,0 +1,570 @@
1
+@extends('layouts.master')
2
+
3
+
4
+@section('navigation')
5
+    @if($role==1)
6
+        @include('local.managers.admins._navigation')
7
+    @elseif($role==2)
8
+        @include('local.managers.sCoords._navigation')
9
+    @endif
10
+@stop
11
+
12
+@section('main')
13
+<a href="{{ action('SchoolsController@show', array($school->id)); }}" class="btn btn-primary pull-left" alt="print">Go to Performance by School Courses</a>
14
+
15
+<a href="{{ action('ProgramsController@print_program', array($school->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
16
+<br>
17
+<br>
18
+<div class="row">
19
+    <ul id="resultsTabs" class="nav nav-tabs" role="tablist">
20
+        <li role="presentation" class="active"><a href="#combined" aria-controls="combined" role="tab">Combined</a></li>
21
+        <li role="presentation"><a href="#uncombined" aria-controls="uncombined" role="tab">Uncombined</a></li>
22
+    </ul>
23
+	<div>
24
+<!-- 	<div class="tab-content"> -->
25
+
26
+	<div role="tabpanel" class="tab-pane active" id="combined">
27
+	<div class="row">
28
+		<div class="col-md-12" id="graph2"></div>
29
+	</div>
30
+
31
+            <div class="row">
32
+                <div class="col-md-12">
33
+                    <h3>Performance of {{ $school->name }} Students by Combined Learning Outcome</h3>
34
+                    @if($outcomes->count()>0)
35
+                        <table class="table table-striped table-condensed datatable">
36
+                            <thead>
37
+                                <tr>
38
+                                    <th>Learning Outcome</th>
39
+                                    <th>Program</th>
40
+                                    <th>Program Id</th>
41
+                                    <th>Program Is Graduate</th>
42
+                                    <th>Number Students</th>
43
+                                    <th>Number Students that Achieved the Target</th>
44
+                                    <th>Percentage of Students that Achieved the Target</th>
45
+                                    <th>Semesters</th>
46
+                                </tr>
47
+                            </thead>
48
+                            <tfoot>
49
+                                <tr class="column-search">
50
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
51
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
52
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
53
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
54
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
55
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
56
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
57
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
58
+                                </tr>
59
+                            </tfoot>
60
+                            <tbody>
61
+                                @foreach($programs as $program)
62
+                                  @foreach($outcomes_colap as $outcome)
63
+                                	@if(isset($outcomes_attempted_colap[$program->id][$outcome->id]))
64
+                                    <tr>
65
+										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
66
+										<td>{{{ $program->name }}}</td>
67
+										<td>{{{ $program->id }}}</td>
68
+										<td>{{{ $program->is_graduate }}}</td>
69
+										<td>{{{ $outcomes_attempted_colap[$program->id][$outcome->id] }}}</td>
70
+										<td>{{{ $outcomes_achieved_colap[$program->id][$outcome->id] }}}</td>
71
+										<td>
72
+											@if($outcomes_attempted_colap[$program->id][$outcome->id]!=0)
73
+												{{{ round($outcomes_achieved_colap[$program->id][$outcome->id] / $outcomes_attempted_colap[$program->id][$outcome->id]*100, 2) }}}%
74
+											@else
75
+												N/M
76
+											@endif
77
+										</td>
78
+										<td>
79
+										@if(isset($outcomes_attempted_colap_semesters[$program->id][$outcome->id]))
80
+											{{{ str_replace('"','',json_encode($outcomes_attempted_colap_semesters[$program->id][$outcome->id])) }}}
81
+										@else
82
+											N/M
83
+										@endif
84
+										
85
+										</td>
86
+                                    </tr>
87
+                       				@endif
88
+                                  @endforeach
89
+                                @endforeach
90
+                            </tbody>
91
+                        </table>
92
+                    @else
93
+                        <p class="lead"> No courses assigned.</p>
94
+                    @endif
95
+                </div>
96
+            </div>
97
+            </div>
98
+		<div role="tabpanel" class="tab-pane" id="uncombined">
99
+	<div class="row">
100
+		<div class="col-md-12" id="graph"></div>
101
+	</div>
102
+
103
+            <div class="row">
104
+                <div class="col-md-12">
105
+                    <h3>Performance of {{ $school->name }} Students by Uncombined Learning Outcome</h3>
106
+                    @if($outcomes->count()>0)
107
+                        <table class="table table-striped table-condensed datatable">
108
+                            <thead>
109
+                                <tr>
110
+                                    <th>Learning Outcome</th>
111
+                                    <th>Program</th>
112
+                                    <th>Program Id</th>
113
+                                    <th>Program Is Graduate</th>
114
+                                    <th>Number Students</th>
115
+                                    <th>Number Students that Achieved the Target</th>
116
+                                    <th>Percentage of Students that Achieved the Target</th>
117
+                                    <th>Semesters</th>
118
+                                </tr>
119
+                            </thead>
120
+                            <tfoot>
121
+                                <tr class="column-search">
122
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
123
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
124
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
125
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
126
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
127
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
128
+                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
129
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
130
+                                </tr>
131
+                            </tfoot>
132
+                            <tbody>
133
+                                @foreach($programs as $program)
134
+                               	   @foreach($outcomes as $outcome)
135
+  											@if(isset($outcomes_attempted[$program->id][$outcome->id]))
136
+                                  <tr>
137
+										<td>{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
138
+										<td>{{{ $program->name }}}</td>
139
+										<td>{{{ $program->id }}}</td>
140
+										<td>{{{ $program->is_graduate }}}</td>
141
+										<td>{{{ $outcomes_attempted[$program->id][$outcome->id] }}}</td>
142
+										<td>{{{ $outcomes_achieved[$program->id][$outcome->id] }}}</td>
143
+										<td>
144
+											@if($outcomes_attempted[$program->id][$outcome->id]!=0)
145
+												{{{ round($outcomes_achieved[$program->id][$outcome->id] / $outcomes_attempted[$program->id][$outcome->id]*100, 2) }}}%
146
+											@else
147
+												N/M
148
+											@endif
149
+										</td>
150
+										<td>
151
+											@if(isset($outcomes_attempted_semesters[$program->id][$outcome->id]))
152
+												{{{ str_replace('"','',json_encode($outcomes_attempted_semesters[$program->id][$outcome->id])) }}}
153
+											@else
154
+												N/M
155
+											@endif
156
+										
157
+										</td>
158
+                                    </tr>
159
+											@endif
160
+                                   @endforeach
161
+                                @endforeach
162
+                            </tbody>
163
+                        </table>
164
+                    @else
165
+                        <p class="lead"> No courses assigned.</p>
166
+                    @endif
167
+                </div>
168
+            </div>
169
+</div>
170
+	</div>
171
+</div>
172
+ <!-- =================== tabs =================== -->
173
+<div class="row">
174
+    <!-- Nav tabs -->
175
+   <!-- Tab panes -->
176
+    <ul id="programTabs" class="nav nav-tabs" role="tablist">
177
+        <li role="presentation" class="active"><a href="#courses" aria-controls="courses" role="tab">Courses</a></li>
178
+        <li role="presentation"><a href="#contact" aria-controls="contact" role="tab">Contact Information</a></li>
179
+    </ul>
180
+    <div class="tab-content">
181
+
182
+       <div role="tabpanel" class="tab-pane active" id="courses">
183
+            <div class="row">
184
+                <div class="col-md-12">
185
+                    <h3>Courses in this program</h3>
186
+                    @if(count($grouped_courses)>0)
187
+                        <table class="table table-striped table-condensed datatable">
188
+                            <thead>
189
+                                <tr>
190
+                                    <th>Identifier</th>
191
+                                    <th>Name</th>
192
+                                    <th>Course Program</th>
193
+                                    <th>Number of Students</th>
194
+                                </tr>
195
+                            </thead>
196
+                            <tfoot>
197
+                                <tr class="column-search">
198
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
199
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
200
+                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
201
+                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
202
+                                </tr>
203
+                            </tfoot>
204
+                            <tbody>
205
+                                @foreach($grouped_courses as $grouped_course)
206
+                                    <tr>
207
+                                        <td class="col-md-2">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
208
+                                        <td class="col-md-4">{{{ $grouped_course->name}}}</td>
209
+                                        <td class="col-md-2">{{{ $grouped_course->program_code}}}</td>
210
+                                        <td class="col-md-3">{{{ $grouped_course->quantity }}}</td>
211
+                                    </tr>
212
+                                @endforeach
213
+                            </tbody>
214
+                        </table>
215
+                    @else
216
+                        <p class="lead"> No courses assigned.</p>
217
+                    @endif
218
+                </div>
219
+            </div>
220
+        </div>
221
+        <div role="tabpanel" class="tab-pane" id="contact">
222
+            <div class="row">
223
+                <div class="col-md-12">
224
+                    <h3>Contact Information</h3>
225
+                    <table class="table table-striped datatable">
226
+                        <thead>
227
+                            <tr>
228
+                                <th>Name</th>
229
+                                <th>Role</th>
230
+                                <th>Program</th>
231
+                                <th>Email</th>
232
+                                <th>Office Phone</th>
233
+                            </tr>
234
+                        </thead>
235
+                        <tfoot>
236
+                            <tr class="column-search">
237
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
238
+                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
239
+                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
240
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
241
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
242
+                            </tr>
243
+                        </tfoot>
244
+                        <tbody>
245
+                            @foreach($users as $user)
246
+                                <tr>
247
+                                    <td>{{ $user->surnames }}, {{ $user->first_name }}</td>
248
+
249
+                                    @if($user->role == 1)
250
+                                        <td>Administrator</td>
251
+                                        <td>All</td>
252
+                                    @elseif($user->role == 2)
253
+                                        <td>School Coordinator</td>
254
+                                        <td>All in {{ $program->school->name }}</td>
255
+                                    @elseif($user->role == 3)
256
+                                        <td>Program Coordinator</td>
257
+                                        <td>
258
+                                            @foreach ($user->programs as $program)
259
+                                                {{ $program->name }}&nbsp;
260
+                                            @endforeach
261
+                                        </td>
262
+                                    @else
263
+                                        <td>Professor</td>
264
+                                        <td>
265
+                                            @foreach ($user->programs as $program)
266
+                                                {{ $program->name }}&nbsp;
267
+                                            @endforeach
268
+                                        </td>
269
+                                    @endif
270
+
271
+                                    <td>
272
+                                        <a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
273
+                                    </td>
274
+                                    <td>
275
+                                        @if($user->office_phone)
276
+                                            {{{ $user->office_phone }}}
277
+
278
+                                            @if($user->office_extension)
279
+                                                <span>ext.</span> {{{ $user->office_extension }}}
280
+                                            @endif
281
+                                        @else
282
+                                            Not set
283
+                                        @endif
284
+                                    </td>
285
+                                </tr>
286
+                            @endforeach
287
+                        </tbody>
288
+                    </table>
289
+                </div>
290
+            </div>
291
+        </div>
292
+    </div>
293
+</div>
294
+<!-- =================== end tabs =================== -->
295
+
296
+@stop
297
+
298
+@section('included-js')
299
+
300
+<!-- HighCharts -->
301
+<script src="{{ asset('vendor/highcharts/highcharts.js') }}"></script>
302
+<!--script src="http://code.highcharts.com/modules/exporting.js"></script -->
303
+
304
+<!-- Datatables -->
305
+@include('global._datatables_js')
306
+
307
+@stop
308
+
309
+@section('javascript')
310
+
311
+$('#programTabs a').click(function (e) {
312
+    e.preventDefault()
313
+    $(this).tab('show');
314
+});
315
+
316
+
317
+$('#graph').highcharts({
318
+    chart: {
319
+        type: 'bar'
320
+    },
321
+    title: {
322
+        text: 'Performance of {{ $school->name }} Students by Uncombined Learning Outcome'
323
+    },
324
+    legend: {
325
+                reversed: true,
326
+            },
327
+    xAxis: {
328
+        categories: [
329
+            @foreach($outcomes as $outcome)
330
+            	@if(isset($outcomes_attempted_todo[$outcome->id]))
331
+                 "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted_todo[$outcome->id] }}}, {{{ $outcomes_achieved_todo[$outcome->id] }}})",
332
+            	@else
333
+                    "{{{ $outcome->name }}}<br>(N = 0, 0)",         	
334
+            	@endif
335
+            @endforeach
336
+        ],
337
+        labels: {
338
+            style: {
339
+                fontSize:'11px'
340
+            },
341
+            step:1,
342
+            useHTML:true,
343
+            formatter: function() {
344
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
345
+            },
346
+        }
347
+    },
348
+    yAxis: {
349
+        min: 0,
350
+        max: 100,
351
+        title: {
352
+            text: 'Percentage'
353
+        },
354
+			plotLines:[{
355
+		value:70,
356
+		color: '#000',
357
+		width:3,
358
+		zIndex:4,
359
+		label:{
360
+			text: 'Goal (70%)',
361
+			style: {
362
+				color: '#000',
363
+				fontSize: '14px',
364
+			}
365
+
366
+		}
367
+	}]
368
+
369
+    },
370
+    tooltip: {
371
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
372
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
373
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
374
+        footerFormat: '</table>',
375
+        shared: true,
376
+        useHTML: true
377
+    },
378
+    plotOptions: {
379
+        bar: {
380
+            //grouping: false,
381
+            shadow: false,
382
+            borderWidth: 0,
383
+        },
384
+        series: {
385
+        pointPadding: 0,
386
+        groupPadding: 0.075
387
+        },
388
+    },
389
+    series: [{
390
+        name: 'Expected Value',
391
+        color: '#555555',
392
+        dataLabels: {
393
+            enabled: true,
394
+            fontSize: 8,
395
+            color: '#fff',
396
+            align: 'right',
397
+            format: '{y:.1f}%',
398
+            style: {
399
+                //fontWeight: 'bold'
400
+            },
401
+            y:-1
402
+        },
403
+        data: [
404
+            @foreach($outcomes as $index => $outcome)
405
+                @if(
406
+                    is_array($outcomes_attempted_todo)
407
+                    && array_key_exists($outcome->id, $outcomes_attempted_todo)
408
+                    && $outcomes_attempted_todo[$outcome->id]!=0)
409
+                @else
410
+                    0,
411
+                @endif
412
+            @endforeach
413
+        ]
414
+
415
+    },{
416
+        name: 'Obtained Value',
417
+        color: '#e70033',
418
+        dataLabels: {
419
+            enabled: true,
420
+            fontSize: 8,
421
+            color: '#fff',
422
+            align: 'right',
423
+            format: '{y:.1f}%',
424
+            style: {
425
+                //fontWeight: 'bold'
426
+            },
427
+            y:-1
428
+        },
429
+        data:[
430
+            @foreach($outcomes as $index => $outcome)
431
+                @if(
432
+                    is_array($outcomes_attempted_todo)
433
+                    && array_key_exists($outcome->id, $outcomes_attempted_todo)
434
+                    && $outcomes_attempted_todo[$outcome->id]!=0)
435
+                    {{{ ($outcomes_achieved_todo[$outcome->id]/$outcomes_attempted_todo[$outcome->id])*100 }}},
436
+                @else
437
+                    0,
438
+                @endif
439
+            @endforeach
440
+        ]
441
+    }]
442
+});
443
+
444
+$('#graph2').highcharts({
445
+    chart: {
446
+        type: 'bar'
447
+    },
448
+    title: {
449
+        text: 'Performance of {{ $school->name }} Students by Combined Learning Outcome'
450
+    },
451
+    legend: {
452
+                reversed: true,
453
+            },
454
+    xAxis: {
455
+        categories: [
456
+            @foreach($outcomes_colap as $outcome)
457
+                "{{{ $outcome->name }}}<br>(N = {{{ $outcomes_attempted_colap_todo[$outcome->id] }}}, {{{ $outcomes_achieved_colap_todo[$outcome->id] }}})",
458
+            @endforeach
459
+        ],
460
+        labels: {
461
+            style: {
462
+                fontSize:'11px'
463
+            },
464
+            step:1,
465
+            useHTML:true,
466
+            formatter: function() {
467
+                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
468
+            },
469
+        }
470
+    },
471
+    yAxis: {
472
+        min: 0,
473
+        max: 100,
474
+        title: {
475
+            text: 'Percentage'
476
+        },
477
+        			plotLines:[{
478
+		value:70,
479
+		color: '#000',
480
+		width:3,
481
+		zIndex:4,
482
+		label:{
483
+			text: 'Goal (70%)',
484
+			style: {
485
+				color: '#000',
486
+				fontSize: '14px',
487
+			}
488
+
489
+		}
490
+	}]
491
+
492
+    },
493
+    tooltip: {
494
+        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
495
+        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
496
+            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
497
+        footerFormat: '</table>',
498
+        shared: true,
499
+        useHTML: true
500
+    },
501
+    plotOptions: {
502
+        bar: {
503
+            //grouping: false,
504
+            shadow: false,
505
+            borderWidth: 0,
506
+        },
507
+        series: {
508
+        pointPadding: 0,
509
+        groupPadding: 0.075
510
+        },
511
+    },
512
+    series: [{
513
+        name: 'Expected Value',
514
+        color: '#555555',
515
+        dataLabels: {
516
+            enabled: true,
517
+            fontSize: 8,
518
+            color: '#fff',
519
+            align: 'right',
520
+            format: '{y:.1f}%',
521
+            style: {
522
+                //fontWeight: 'bold'
523
+            },
524
+            y:-1
525
+        },
526
+        data: [
527
+            @foreach($outcomes_colap as $index => $outcome)
528
+                @if(
529
+                    is_array($outcomes_attempted_colap_todo)
530
+                    && array_key_exists($outcome->id, $outcomes_attempted_colap_todo)
531
+                    && $outcomes_attempted_colap_todo[$outcome->id]!=0)
532
+                @else
533
+                    0,
534
+                @endif
535
+            @endforeach
536
+        ]
537
+
538
+    },{
539
+        name: 'Obtained Value',
540
+        color: '#e70033',
541
+        dataLabels: {
542
+            enabled: true,
543
+            fontSize: 8,
544
+            color: '#fff',
545
+            align: 'right',
546
+            format: '{y:.1f}%',
547
+            style: {
548
+                //fontWeight: 'bold'
549
+            },
550
+            y:-1
551
+        },
552
+        data:[
553
+            @foreach($outcomes_colap as $index => $outcome)
554
+                @if(
555
+                    is_array($outcomes_attempted_colap_todo)
556
+                    && array_key_exists($outcome->id, $outcomes_attempted_todo)
557
+                    && $outcomes_attempted_colap_todo[$outcome->id]!=0)
558
+                    {{{ ($outcomes_achieved_colap_todo[$outcome->id]/$outcomes_attempted_colap_todo[$outcome->id])*100 }}},
559
+                @else
560
+                    0,
561
+                @endif
562
+            @endforeach
563
+        ]
564
+    }]
565
+});
566
+
567
+// Include dummy graph for outcomes
568
+@include('global.dummy-outcomes')
569
+
570
+@stop