Ver código fonte

Cambiar uso de program coordinator pal 2.

Gabriel Santiago Plaza 2 anos atrás
pai
commit
533848f0f7

+ 36
- 7
app/controllers/CriteriaController.php Ver arquivo

@@ -15,6 +15,8 @@ class CriteriaController extends \BaseController
15 15
     {
16 16
         $userProgram = Auth::user()['id'];
17 17
 
18
+
19
+
18 20
         $userProgram = DB::select("select program_user.program_id from program_user where user_id = {$userProgram}");
19 21
         Log::info($userProgram);
20 22
         $title = "Criteria";
@@ -77,7 +79,7 @@ class CriteriaController extends \BaseController
77 79
 
78 80
         return json_encode($json_to_send);
79 81
     }
80
-    
82
+
81 83
     public function fetchCriterion()
82 84
     {
83 85
         $json_to_send = array();
@@ -620,16 +622,43 @@ class CriteriaController extends \BaseController
620 622
         $title = "Criteria";
621 623
         $outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
622 624
 
623
-        $schools = School::orderBy('name', 'ASC')->get();
624
-        $criteria = Criterion::withTrashed()->orderBy('name', 'ASC')->get();
625
-        $programs = Program::orderBy('name', 'ASC')->get();
626
-        $objectives = DB::table('objectives')->orderBy('text', 'ASC')->lists('text', 'id');
625
+        //$schools = School::orderBy('name', 'ASC')->get();
626
+        // $criteria = Criterion::withTrashed()->orderBy('name', 'ASC')->get();
627
+
628
+
629
+        // $objectives = DB::table('objectives')->orderBy('text', 'ASC')->lists('text', 'id');
630
+
631
+        $role = Auth::user()->role;
632
+
633
+        switch ($role) {
634
+            case 1:
635
+                $program_ids = DB::table('programs')->lists('id');
636
+                break;
637
+            case 2:
638
+                $program_ids = DB::table('programs')
639
+                    ->where('school_id', Auth::user()->school_id)
640
+                    ->lists('id');
641
+                break;
642
+            case 3:
643
+                $program_ids = DB::table('program_user')
644
+                    ->where('user_id', Auth::user()->id)
645
+                    ->lists('program_id');
646
+                break;
647
+        }
648
+        //Log::info($userProgram);
649
+        $title = "Criteria";
650
+        $outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
651
+
652
+        //$criteria = Criterion::withTrashed()->orderBy('name', 'ASC')->get();
653
+        $programs = Program::whereIn("id", $program_ids)->get();
654
+        return View::make('local.managers.shared.criteria', compact('title', 'outcomes', 'programs', 'objectives'));
655
+
627 656
 
628 657
 
629 658
 
630 659
 
631 660
 
632
-        return View::make('local.managers.admins.criteria', compact('title', 'outcomes', 'schools', 'criteria', 'programs', 'objectives'));
661
+        // return View::make('local.managers.shared.criteria', compact('title', 'outcomes', 'schools', 'criteria', 'programs', 'objectives'));
633 662
     }
634 663
 
635 664
     private function cleanInputEdit()
@@ -1072,4 +1101,4 @@ class CriteriaController extends \BaseController
1072 1101
                 break;
1073 1102
         }
1074 1103
     }
1075
-}
1104
+}

+ 31
- 4
app/controllers/Objective2Controller.php Ver arquivo

@@ -313,10 +313,36 @@ class Objective2Controller extends \BaseController
313 313
 		$title = "Objective";
314 314
 		$outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->get();
315 315
 
316
-		$objectives = Objective::withTrashed()->orderBy('text', 'ASC')->get();
317
-		$programs = Program::orderBy('name', 'ASC')->get();
316
+		$role = Auth::user()->role;
318 317
 
319
-		return View::make('local.managers.admins.objectives', compact('title', 'outcomes', 'objectives', 'programs'));
318
+		switch ($role) {
319
+			case 1:
320
+				$program_ids = DB::table("programs")
321
+					->lists('id');
322
+				break;
323
+
324
+			case 2:
325
+				$program_ids = DB::table('programs')
326
+					->where('school_id', Auth::user()->school_id)
327
+					->lists('id');
328
+
329
+				break;
330
+			case 3:
331
+				$program_ids = DB::table('program_user')
332
+					->where('user_id', Auth::user()->id)
333
+					->lists('program_id');
334
+
335
+
336
+				break;
337
+		}
338
+		$objectives_from_program = DB::table('objective_program')
339
+			->where('program_id', $program_ids)
340
+			->where('objective_program.objective_id', "<>", 0)
341
+			->lists('objective_id');
342
+		$objectives = Objective::withTrashed()->whereIn('id', $objectives_from_program)->orderBy('text', 'ASC')->get();
343
+		$programs = Program::whereIn('id', $program_ids)->orderBy('name', 'ASC')->get();
344
+
345
+		return View::make('local.managers.shared.objectives', compact('title', 'outcomes', 'objectives', 'programs'));
320 346
 	}
321 347
 
322 348
 	public function editProgram()
@@ -330,6 +356,7 @@ class Objective2Controller extends \BaseController
330 356
 		$outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->get();
331 357
 		$objectives_from_program = DB::table('objective_program')
332 358
 			->where('program_id', $userProgram[0]->program_id)
359
+			->where('objective_program.objective_id', "<>", 0)
333 360
 			->lists('objective_id');
334 361
 		$objectives = Objective::withTrashed()->orderBy('text', 'ASC')->whereIn('id', $objectives_from_program)->get();
335 362
 
@@ -377,7 +404,7 @@ class Objective2Controller extends \BaseController
377 404
 		$clean_input = $this->cleanAssocInput();
378 405
 
379 406
 
380
-		Log::info(print_r($clean_input, true));
407
+		//Log::info(print_r($clean_input, true));
381 408
 
382 409
 		/** Validation rules */
383 410
 		$validator = $this->makeValidator($clean_input);

+ 6
- 5
app/controllers/OutcomesController.php Ver arquivo

@@ -406,8 +406,8 @@ class OutcomesController extends \BaseController
406 406
 
407 407
     public function fetchCriteria()
408 408
     {
409
-// 		var_dump((Input::get('filter')));
410
-// 		exit();
409
+        // 		var_dump((Input::get('filter')));
410
+        // 		exit();
411 411
         if (Input::get('filter')) {
412 412
             switch (Input::get('filter')) {
413 413
                 case 'all':
@@ -777,7 +777,7 @@ class OutcomesController extends \BaseController
777 777
     public function assessmentReport()
778 778
     {
779 779
         //$outcome = Outcome::find($outcome_id);
780
-
780
+        set_time_limit(0);
781 781
         //if (!$outcome)
782 782
         //    App::abort('404');
783 783
         $title = "Campus Assessment Report "; //. $outcome->name;
@@ -935,7 +935,7 @@ class OutcomesController extends \BaseController
935 935
         //    App::abort('404');
936 936
         $title = "School Assessment Reports";
937 937
 
938
-
938
+        set_time_limit(0);
939 939
         $school = School::where('id', Auth::user()->school_id)
940 940
             ->has('courses')
941 941
             ->with(array('programs' => function ($query) {
@@ -972,7 +972,7 @@ class OutcomesController extends \BaseController
972 972
         //    App::abort('404');
973 973
         $title = "Program Courses Report";
974 974
 
975
-
975
+        set_time_limit(0);
976 976
         $program = Program::where('id', $program_id)
977 977
             ->has('courses')
978 978
             ->with(array('courses' => function ($query) {
@@ -1020,6 +1020,7 @@ class OutcomesController extends \BaseController
1020 1020
         //$outcome = Outcome::find($outcome_id);
1021 1021
 
1022 1022
         //if (!$outcome)
1023
+        set_time_limit(0);
1023 1024
         //    App::abort('404');
1024 1025
         $title = "My Courses' Assessment Report";
1025 1026
         //$activity_criterion = DB::table('assessments')->lists('activity_criterion_id');

+ 45
- 50
app/controllers/TemplatesController.php Ver arquivo

@@ -62,23 +62,23 @@ class TemplatesController extends \BaseController
62 62
 				break;
63 63
 			case 3:
64 64
 			case 4:
65
-				$program_id = DB::table("program_user")
65
+				$program_ids = DB::table("program_user")
66 66
 					->where('user_id', Auth::user()->id)
67
-					->lists('program_id')[0];
68
-				$school_id = DB::table('programs')
69
-					->where('id', $program_id)
70
-					->lists('school_id')[0];
67
+					->lists('program_id');
68
+				$school_ids = DB::table('programs')
69
+					->whereIn('id', $program_ids)
70
+					->lists('school_id');
71 71
 
72 72
 
73 73
 				$templates = Template::orderBy('name')
74 74
 					->whereNull("school_id")
75
-					->orWhere(function ($query) use (&$school_id) {
76
-						$query->where('school_id', $school_id)
75
+					->orWhere(function ($query) use (&$school_ids) {
76
+						$query->whereIn('school_id', $school_ids)
77 77
 							->whereNull('program_id');
78 78
 					})
79
-					->orWhere(function ($query) use (&$program_id, &$school_id) {
80
-						$query->where('school_id', $school_id)
81
-							->where('program_id', $program_id);
79
+					->orWhere(function ($query) use (&$program_ids, &$school_ids) {
80
+						$query->where('school_id', $school_ids)
81
+							->where('program_id', $program_ids);
82 82
 					})
83 83
 
84 84
 					->get();
@@ -200,49 +200,44 @@ class TemplatesController extends \BaseController
200 200
 			$templates = Template::orderBy('name', 'ASC')->get();
201 201
 			$programs = Program::orderBy('name', 'ASC')->get();
202 202
 			$criteria = Criterion::orderBy('name', 'ASC')->get();
203
-		} 
204
-		else
205
-		{
203
+		} else {
206 204
 			if ($role == 2) {
207 205
 				$programs = Auth::user()->school->programs;
208
-			} 
206
+			}
209 207
 			if ($role == 3) {
210 208
 				$programs = Auth::user()->programs()->get();
211 209
 			}
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 );
210
+			$program_ids = array();
211
+			foreach ($programs as $program) {
212
+				$program_ids[] = $program->id;
220 213
 			}
214
+			$criteria = Criterion::whereHas(
215
+				'programs',
216
+				function ($q) use ($program_ids) {
217
+					$q->whereIn('program_id', $program_ids);
218
+				}
221 219
 			)->orderBy('name', 'ASC')->get();
222 220
 			$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;
221
+				->orderBy('name', 'ASC')->get();
222
+			$criteria_ids = array();
223
+			foreach ($criteria as $criterion) {
224
+				$criteria_ids[] = $criterion->id;
228 225
 			}
229
-			$templates_fuera = Template::whereHas('criteria', function ($q) use ($criteria_ids)
230
-			{
231
-				$q->whereNotIn('criterion_id', $criteria_ids );
226
+			$templates_fuera = Template::whereHas('criteria', function ($q) use ($criteria_ids) {
227
+				$q->whereNotIn('criterion_id', $criteria_ids);
232 228
 			})
233
-			->orderBy('name', 'ASC')->get();
234
-			$templates_fuera_ids=array();		
235
-			foreach($templates_fuera as $tf)
236
-			{
237
-				$templates_fuera_ids[]=$tf->id;
229
+				->orderBy('name', 'ASC')->get();
230
+			$templates_fuera_ids = array();
231
+			foreach ($templates_fuera as $tf) {
232
+				$templates_fuera_ids[] = $tf->id;
238 233
 			}
239 234
 			$templates_dentro = Template::whereNotIn('id', $templates_fuera_ids)
240
-			->orderBy('name', 'ASC')->get();
241
-			
242
-	// 			var_dump(json_encode($templates_dentro));
243
-		}		
244
-	
245
-	
235
+				->orderBy('name', 'ASC')->get();
236
+
237
+			// 			var_dump(json_encode($templates_dentro));
238
+		}
239
+
240
+
246 241
 
247 242
 		return View::make('local.managers.shared.rubrics_new', compact('title', 'templates_dentro', 'templates_fuera', 'outcomes', 'criteria', 'schools', 'programs', 'criteria_ids'));
248 243
 	}
@@ -287,7 +282,7 @@ class TemplatesController extends \BaseController
287 282
 			case 2:
288 283
 				$template->school_id = Auth::user()->school->id;
289 284
 				break;
290
-
285
+				//TODO esto yo no lo hice
291 286
 			case 3:
292 287
 				$template->school_id = Auth::user()->programs[0]->school->id;
293 288
 				$template->program_id = Auth::user()->programs[0]->id;
@@ -378,8 +373,8 @@ class TemplatesController extends \BaseController
378 373
 			->join('template_criterion', 'template_criterion.criterion_id', '=', 'criteria.id')
379 374
 			->where("template_criterion.template_id", '=', Input::get('id'))
380 375
 			->get();
381
-				Log::info(json_encode($template_info['criterion']));
382
-// 				Log::info(($temp_crit->program_ids));
376
+		Log::info(json_encode($template_info['criterion']));
377
+		// 				Log::info(($temp_crit->program_ids));
383 378
 		foreach ($template_info['criterion'] as $temp_crit) {
384 379
 			$temp_crit->scales = DB::table('scales')
385 380
 				->join('criterion_scale', 'criterion_scale.scale_id', '=', 'scales.id')
@@ -390,9 +385,9 @@ class TemplatesController extends \BaseController
390 385
 			$temp_crit->program_ids = json_encode(DB::table('program_criterion')
391 386
 				->where('criterion_id', $temp_crit->id)
392 387
 				->lists('program_id'));
393
-				
394
-						Log::info("ee".json_encode($temp_crit->program_ids));
395
-		
388
+
389
+			Log::info("ee" . json_encode($temp_crit->program_ids));
390
+
396 391
 			$temp_crit->objectives = DB::table('criterion_objective_outcome')
397 392
 				->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
398 393
 				->where('criterion_id', $temp_crit->id)
@@ -409,7 +404,7 @@ class TemplatesController extends \BaseController
409 404
 			$outcomeStr = rtrim($outcomeStr, ',');
410 405
 			$temp_crit->outcomes = $outcomeStr;
411 406
 		}
412
-		Log::info("ee2".json_encode($template_info));
407
+		Log::info("ee2" . json_encode($template_info));
413 408
 
414 409
 		$template_info['titles'] = DB::table('titles')
415 410
 			->join('template_title', 'template_title.title_id', '=', 'titles.id')
@@ -417,7 +412,7 @@ class TemplatesController extends \BaseController
417 412
 			->orderBy('position')
418 413
 			->get();
419 414
 
420
-// 		Log::info(json_encode($template_info));
415
+		// 		Log::info(json_encode($template_info));
421 416
 
422 417
 		return json_encode($template_info);
423 418
 	}
@@ -606,4 +601,4 @@ class TemplatesController extends \BaseController
606 601
 			return Redirect::back();
607 602
 		}
608 603
 	}
609
-}
604
+}

+ 2
- 3
app/controllers/TransformativeActionsController.php Ver arquivo

@@ -867,9 +867,8 @@ class TransformativeActionsController extends \BaseController
867 867
       case 3:
868 868
         $program_id = DB::table('program_user')
869 869
           ->where('user_id', $user_id)
870
-          ->select('program_id')
871
-          ->get();
872
-        $program_id = $program_id[0]->program_id;
870
+          ->lists('program_id');
871
+
873 872
         break;
874 873
     }
875 874
 

+ 38
- 0
app/database/migrations/2022_03_16_150810_create_paths_for_annual_plan.php Ver arquivo

@@ -0,0 +1,38 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class CreatePathsForAnnualPlan extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('paths_for_annual_plans', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->string("path_to_pdf");
19
+			$table->integer('annual_plan_id')->unsigned();
20
+			$table->boolean("last");
21
+			$table->foreign('annual_plan_id')
22
+				->references('id')
23
+				->on('annual_plans')
24
+				->onUpdate('cascade')
25
+				->onDelete('cascade');
26
+		});
27
+	}
28
+
29
+	/**
30
+	 * Reverse the migrations.
31
+	 *
32
+	 * @return void
33
+	 */
34
+	public function down()
35
+	{
36
+		Schema::drop('paths_for_annual_plans');
37
+	}
38
+}

+ 3
- 3
app/models/Course.php Ver arquivo

@@ -274,13 +274,13 @@ class Course extends Eloquent
274 274
         ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
275 275
         ->groupBy('criteria.id');
276 276
 
277
-      /* Log::info($table_per_criterion->toSql());
277
+      /*Log::info($table_per_criterion->toSql());
278 278
       Log::info(array($course_code));
279 279
       Log::info($program_ids);
280
-      Log::info($criteria_id);*/
280
+      Log::info($criteria_id);
281 281
       Log::info('mera 1');
282 282
       Log::info(array($course_code));
283
-      Log::info($table_per_criterion->get());
283
+      Log::info($table_per_criterion->get()); */
284 284
       return $table_per_criterion->get();
285 285
     }
286 286
   }

+ 4
- 4
app/routes.php Ver arquivo

@@ -415,8 +415,8 @@ Route::group(array('before' => 'auth|has_access'), function () {
415 415
 
416 416
         // Gabriel added this, so the school coordinator can add criterias and objectives
417 417
         Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
418
-        Route::get('school-objective', 'Objective2Controller@editSchool');
419
-        Route::get('school-criteria', 'CriteriaController@editSchool');
418
+        Route::get('school-objective', 'Objective2Controller@edit');
419
+        Route::get('school-criteria', 'CriteriaController@edit');
420 420
         Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
421 421
 
422 422
         //Show users annual plan
@@ -473,9 +473,9 @@ Route::group(array('before' => 'auth|has_access'), function () {
473 473
 
474 474
 
475 475
         //Criteria and objectives
476
-        Route::get('program-criteria', 'CriteriaController@editProgram');
476
+        Route::get('program-criteria', 'CriteriaController@edit');
477 477
         Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
478
-        Route::get('program-objective', 'Objective2Controller@editProgram');
478
+        Route::get('program-objective', 'Objective2Controller@edit');
479 479
 
480 480
         // Print program report
481 481
         Route::get('print_program/{id}', 'ProgramsController@print_program');

+ 1
- 1
app/views/local/managers/admins/_navigation.blade.php Ver arquivo

@@ -13,7 +13,7 @@
13 13
                     <li>{{ HTML::linkAction('Objective2Controller@edit', 'Objectives') }}</li>
14 14
                     <li>{{ HTML::linkAction('CriteriaController@edit', 'Criteria') }}</li>
15 15
                     <li>{{ HTML::linkAction('OutcomesController@index', 'Learning Outcomes') }}</li>
16
-                    <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubric Builder') }}</li>
16
+                    <li>{{ HTML::linkAction('TemplatesController@newTemplate_new', 'Rubric Builder') }}</li>
17 17
                     <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
18 18
                     <li>{{ HTML::linkAction('SemestersController@edit', 'Semesters') }}</li>
19 19
                     <li>{{ HTML::linkAction('UsersController@index', 'Users') }}</li>

+ 3
- 0
app/views/local/managers/admins/new_assessment_report.blade.php Ver arquivo

@@ -20,6 +20,7 @@
20 20
                     <li>{{ $semester_info }}</li>
21 21
                 @endforeach
22 22
             </ul>
23
+            <?php set_time_limit(0);?>
23 24
             @foreach ($schools as $school)
24 25
                 <h3>{{ $school->name }}</h3>
25 26
                 <hr>
@@ -262,6 +263,7 @@
262 263
                                                 <strong>({{ $activity->date }})</strong>
263 264
                                             </p>
264 265
                                             <br>
266
+                                            <br>
265 267
 
266 268
                                             <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
267 269
                                             <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
@@ -498,6 +500,7 @@
498 500
                                                 <strong>({{ $activity->date }})</strong>
499 501
                                             </p>
500 502
                                             <br>
503
+                                            <br>
501 504
 
502 505
                                             <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
503 506
                                             <p style="display: inline;"> <i>>= 66.67% of the attempts</i>

+ 28
- 5
app/views/local/managers/pCoords/_navigation.blade.php Ver arquivo

@@ -9,22 +9,22 @@
9 9
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
10 10
                     aria-expanded="false">Management<span class="caret"></span></a>
11 11
                 <ul class="dropdown-menu" role="menu">
12
-                    <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
12
+                    <li>{{ HTML::linkAction('TemplatesController@newTemplate_new', 'Rubrics') }}</li>
13 13
                     <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
14 14
 
15
-                    <li>{{ HTML::linkAction('Objective2Controller@editProgram', 'Objectives') }}</li>
15
+                    <li>{{ HTML::linkAction('Objective2Controller@edit', 'Objectives') }}</li>
16 16
 
17
-                    <li>{{ HTML::linkAction('CriteriaController@editProgram', 'Criteria') }}</li>
17
+                    <li>{{ HTML::linkAction('CriteriaController@edit', 'Criteria') }}</li>
18 18
                     <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}
19 19
                     </li>
20 20
 
21 21
 
22
-                    <li><a href="{{ URL::action('AnnualPlansController@showPlan', Auth::user()->programs[0]->id) }}">Annual
22
+                    <!--<li><a href="{{ URL::action('AnnualPlansController@showPlan', Auth::user()->programs[0]->id) }}">Annual
23 23
                             Plan</a>
24 24
                     <li>
25 25
                     <li><a
26 26
                             href="{{ URL::action('ThreeYearPlanController@threeYearsReport', Auth::user()->programs[0]->id) }}">Three
27
-                            Years Plan</a></li>
27
+                            Years Plan</a></li>-->
28 28
                 </ul>
29 29
             </li>
30 30
 
@@ -68,6 +68,7 @@
68 68
 
69 69
 
70 70
             </li>
71
+
71 72
             <li><a href="{{ URL::action('OutcomesController@annualReport', Auth::user()->programs[0]->id) }}">Annual
72 73
                     Report</a></li>
73 74
 
@@ -75,6 +76,28 @@
75 76
 
76 77
         </ul>
77 78
         </li>
79
+        <li class='dropdown'>
80
+            <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Annual
81
+                Plans<span class="caret"></span></a>
82
+            <ul class='dropdown-menu' role='menu'>
83
+                @foreach (Auth::user()->programs as $program)
84
+                    <li><a
85
+                            href="{{ URL::action('AnnualPlansController@showPlan', [$program->id]) }}">{{ $program->name }}</a>
86
+                    </li>
87
+                @endforeach
88
+            </ul>
89
+        </li>
90
+        <li class='dropdown'>
91
+            <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Three
92
+                year Plans<span class="caret"></span></a>
93
+            <ul class='dropdown-menu' role='menu'>
94
+                @foreach (Auth::user()->programs as $program)
95
+                    <li><a
96
+                            href="{{ URL::action('ThreeYearPlanController@threeYearsReport', [$program->id]) }}">{{ $program->name }}</a>
97
+                    </li>
98
+                @endforeach
99
+            </ul>
100
+        </li>
78 101
 
79 102
         <li class="dropdown">
80 103
             <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span

+ 3
- 1
app/views/local/managers/pCoords/new_assessment_report.blade.php Ver arquivo

@@ -23,7 +23,7 @@
23 23
 
24 24
             @if ($program)
25 25
 
26
-
26
+            <?php set_time_limit(0);?>
27 27
 
28 28
                 <ul id='levelTabs' class="nav nav-tabs" role="tablist">
29 29
                     <!-- For each grouped course -->
@@ -257,6 +257,7 @@
257 257
                                         <strong>({{ $activity->date }})</strong>
258 258
                                     </p>
259 259
                                     <br>
260
+                                    <br>
260 261
                                     <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
261 262
                                     <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
262 263
                                     </p>
@@ -503,6 +504,7 @@
503 504
                                     <strong>({{ $activity->date }})</strong>
504 505
                                 </p>
505 506
                                 <br>
507
+                                <br>
506 508
                                 <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
507 509
                                 <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
508 510
                                 </p>

+ 2
- 2
app/views/local/managers/sCoords/_navigation.blade.php Ver arquivo

@@ -17,8 +17,8 @@
17 17
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
18 18
                     aria-expanded="false">Management<span class="caret"></span></a>
19 19
                 <ul class="dropdown-menu" role="menu">
20
-                    <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives') }}</li>
21
-                    <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
20
+                    <li>{{ HTML::linkAction('Objective2Controller@edit', 'Objectives') }}</li>
21
+                    <li>{{ HTML::linkAction('CriteriaController@edit', 'Criteria') }}</li>
22 22
                     <li>{{ HTML::linkAction('TemplatesController@newTemplate_new', 'Rubrics') }}</li>
23 23
                     <li>{{ HTML::linkAction('TemplatesController@index', 'Rubric List') }}</li>
24 24
 

+ 3
- 3
app/views/local/managers/sCoords/criteria.blade.php Ver arquivo

@@ -6,9 +6,7 @@
6 6
 @section('main')
7 7
 
8 8
     <div class="row">
9
-        <div id="alert_placeholder">
10
-
11
-        </div>
9
+        
12 10
         <div class="col-md-6">
13 11
             <!-- Form to add a new criterion -->
14 12
             <div class="panel panel-default panel-button">
@@ -299,6 +297,8 @@
299 297
             
300 298
             $('.selectpicker').selectpicker('refresh');
301 299
         });
300
+
301
+        
302 302
         function fetchCriterionForEditing() {
303 303
             var id = $('#select-criterion').find(':selected').val();
304 304
 

+ 3
- 1
app/views/local/managers/sCoords/new_assessment_report.blade.php Ver arquivo

@@ -20,7 +20,7 @@
20 20
                     <li>{{ $semester_info }}</li>
21 21
                 @endforeach
22 22
             </ul>
23
-
23
+            <?php set_time_limit(0);?>
24 24
             @if (!$school->programs->isEmpty())
25 25
                 <h3>Table of Contents</h3>
26 26
                 <ol id="table-of-contents" class="upper-roman">
@@ -275,6 +275,7 @@
275 275
                                             <strong>({{ $activity->date }})</strong>
276 276
                                         </p>
277 277
                                         <br>
278
+                                        <br>
278 279
                                         <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
279 280
                                         <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
280 281
                                         </p>
@@ -525,6 +526,7 @@
525 526
                                         <strong>({{ $activity->date }})</strong>
526 527
                                     </p>
527 528
                                     <br>
529
+                                    <br>
528 530
                                     <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
529 531
                                     <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
530 532
                                     </p>

+ 14
- 14
app/views/local/managers/shared/annual_report.blade.php Ver arquivo

@@ -54,7 +54,7 @@
54 54
                     <ul id="levelTabs" class="nav nav-tabs" role="tablist">
55 55
                         <li role="presentation" id='transformative_for_outcome'>
56 56
                             <a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab"
57
-                                aria-expanded="true">Transformative Actions</a>
57
+                                aria-expanded="true">Program Transformative Actions</a>
58 58
                         </li>
59 59
                     </ul>
60 60
                     <div id="allLists" class="tab-content">
@@ -212,7 +212,7 @@
212 212
 
213 213
         function draw_comment_section(typ_semester_outcome_id, outcome_comments) {
214 214
             $('#levelTabs').append('<li role = "presentation" id = "comments_for_outcome">' +
215
-                '<a data-toggle="tab" id="a_for_ta_outcome" href="#comments_outcome" role="tab" >Comments for Outcome</a>' +
215
+                '<a data-toggle="tab" id="a_for_ta_outcome" href="#comments_outcome" role="tab" >Comments</a>' +
216 216
                 '</li>');
217 217
             $('#allLists').append('<div role="tabpanel" class="tab-pane" data-typ-semester-outcome-id = "' +
218 218
                 typ_semester_outcome_id + '" id="comments_outcome"></div>');
@@ -372,12 +372,12 @@
372 372
             if (!transforming_actions.length) {
373 373
                 $("#transformative_for_outcome").hide();
374 374
             } else {
375
-                $('#levelTabs').prepend('<li role = "presentation" id = "transformative_for_outcome">' +
376
-                    '<a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab" >Transformative Actions to Outcome</a>' +
375
+                $('#levelTabs').append('<li role = "presentation" id = "transformative_for_outcome">' +
376
+                    '<a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab" >Program Transformative Actions</a>' +
377 377
                     '</li>');
378
-                $('#allLists').prepend('<div role="tabpanel" class="tab-pane" id="transformative_actions"></div>');
378
+                $('#allLists').append('<div role="tabpanel" class="tab-pane" id="transformative_actions"></div>');
379 379
 
380
-                $('#transformative_actions').html('<h3>Tranformative actions for Learning Outcome')
380
+                $('#transformative_actions').html('<h3>Program Transformative Actions </h3>')
381 381
                 $.each(transforming_actions, function(index, trans_action) {
382 382
                     div = $("<div>", {
383 383
                         'id': 'div_trans_id_' + trans_action.trans_id
@@ -946,11 +946,11 @@
946 946
                         }
947 947
                         GlobalTransCategories = outcome.transformative_actions_categories_html;
948 948
                         var outcomeHTML = "<h4>Performance of Students by Learning Outcome</h4>" +
949
-                            '<h5 style = "display: inline; margin:30px;">Target learning by learning outcome: </h5>' +
950
-                            '<p  style = "display: inline;"> <i>>= ' + outcome.expected_outcome +
951
-                            ' of the attempts</i>' + '</p>' +
949
+                            '<h5 style = "display: inline; margin:30px;">Target to achieve the learning outcome: </h5>' +
950
+                            '<p  style = "display: inline;"> <i> ' + outcome.expected_outcome +
951
+                            '% or more of the attempts </i>' + '</p>' +
952 952
                             '<br><h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by learning outcome: </h5>' +
953
-                            '<p  style = "display: inline;"> <i>' + outcome.outcome_program_goal + '</i></p>';
953
+                            '<p  style = "display: inline;"> <i>' + outcome.outcome_program_goal + '%</i></p>';
954 954
                         $('#outcomeInfo').html('<p class="outcome-definition">' + outcome.definition + '</p>' +
955 955
                             outcomeHTML);
956 956
                         //theStudentOutcomeTable = $("<table/>");
@@ -1179,11 +1179,11 @@
1179 1179
                         if (students_attempted) {
1180 1180
                             studentPercentage = ((students_achieved / students_attempted) * 100).toFixed(2);
1181 1181
                             if (parseFloat(studentPercentage) >= parseFloat(outcome.outcome_program_goal)) {
1182
-                                FinalReport = "<br><p><strong>The students achieved the Learning Outcome with " +
1183
-                                    studentPercentage + "% of students achieving.</strong></p>";
1182
+                                FinalReport = "<p style = 'margin: 30px; '><strong>Results for " + outcome.name+": </strong><em style = 'color: green'>" +
1183
+                                    studentPercentage + "% </em></p>";
1184 1184
                             } else {
1185
-                                FinalReport = "<br><p><strong>The students did not achieve the Learning Outcome with " +
1186
-                                    studentPercentage + "% of students achieving.</strong></p>";
1185
+                                FinalReport = "<p style = 'margin: 30px'><strong>Results for " +outcome.name+": </strong><em style = 'color: red'>"+
1186
+                                    studentPercentage + "% </em></p>";
1187 1187
 
1188 1188
                             }
1189 1189
                         }

app/views/local/managers/pCoords/criteria.blade.php → app/views/local/managers/shared/criteria.blade.php Ver arquivo

@@ -1,7 +1,15 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
+@if(Auth::user()->role == 1)
5
+@include('local.managers.admins._navigation')
6
+
7
+@elseif(Auth::user()->role == 2)
8
+@include('local.managers.sCoords._navigation')
9
+
10
+    @elseif(Auth::user()->role == 3)
4 11
     @include('local.managers.pCoords._navigation')
12
+    @endif
5 13
 @stop
6 14
 @section('main')
7 15
 
@@ -24,9 +32,10 @@
24 32
                             </div>
25 33
 
26 34
                             <div id='objectiveGroupFor0' class='createObjective' data-value='1'>
27
-                                <div class="form-group col-md-11  selectObjective">
35
+                                <div class="form-group col-md-11 selectObjective">
28 36
                                     <label>Associated Objectives for Outcome 1</label>
29
-                                    <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker">
37
+                                    <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker"
38
+                                    onchange="visiblePrograms('allOutcomes')">
30 39
                                     </select>
31 40
 
32 41
                                 </div>
@@ -43,10 +52,12 @@
43 52
                             </button>
44 53
 
45 54
                             <br>
46
-                        </div>
55
+                        
47 56
                         <hr>
48 57
                     </div>
49 58
 
59
+</div>
60
+
50 61
                     <input type='hidden' name='counterOutcome' id='counterOutcome' value=1>
51 62
 
52 63
                     <button id='button-add-outcome' class='btn btn-md btn-secondary' onclick='addOutcomeTest()'>
@@ -60,16 +71,23 @@
60 71
                     <div class="form-group form_validation program_form" id='program-checkboxes'>
61 72
                         {{ Form::label('program_id', 'Associated Program') }}<br>
62 73
                         <br>
63
-
64
-
74
+                        @if(count($programs) ==1)
75
+                        <input type="checkbox" id="program-{{ $programs[0]->name }}" name="program_id[]"
76
+                        value="{{ $programs[0]->id }}"  checked>
77
+                    <label for="program-{{ $programs[0]->name }}"> {{ $programs[0]->name }}
78
+                        [{{ $programs[0]->school->name }}]</label><br>
65 79
                         <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
66 80
                             value="{{ $programs[0]->id }}">
67
-                        <input type="checkbox" id="{{ $programs[0]->name }}" name="program_id[]"
68
-                            value="{{ $programs[0]->id }}" disabled checked>
69
-                        <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }}
70
-                            [{{ $programs[0]->school->name }}]</label><br>
71
-
81
+    
82
+                        @else
83
+                  @foreach ($programs as $program)
84
+                         <input type="checkbox" id="program-{{ $program->id }}" name="program_id[]"
85
+                            value="{{ $program->id }}">
86
+                        <label for="program-{{ $program->id }}"> {{ $program->name }}
87
+                            [{{ $program->school->name }}]</label><br>
88
+                            @endforeach
72 89
 
90
+                    @endif
73 91
                     </div>
74 92
 
75 93
                     <div class="form-group form_validation name_form">
@@ -133,8 +151,10 @@
133 151
                             <select id='select-program' class="form-control selectpicker"
134 152
                                 onchange='fetchAllCriterion("select-program", "assoc_outcomes_fetch")'>
135 153
 
136
-                                <option value='{{ $programs[0]->id }}' data-subtext="{{ $programs[0]->code }}">
137
-                                    {{ $programs[0]->name }}</option>
154
+                                @foreach ($programs as $program)
155
+                                    <option value='{{ $program->id }}' data-subtext="{{ $program->code }}">
156
+                                        {{ $program->name }}</option>
157
+                                @endforeach
138 158
 
139 159
                             </select>
140 160
                         </div>
@@ -150,18 +170,7 @@
150 170
                         {{ Form::label('criterion_id', 'Criterion') }}
151 171
                         <select id="select-criterion" name="id" class="form-control selectpicker"
152 172
                             onchange='fetchCriterionForEditing()'>
153
-                            @foreach ($criteria as $criterion)
154
-                                <option value="{{ $criterion->id }}" data-subtext="
155
-                                                  @if ($criterion->program)
156
-                                    &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
157
-                            @endif
158
-                            ">
159
-                            {{ $criterion->name }}
160
-
161
-
162
-
163
-                            </option>
164
-                            @endforeach
173
+                          
165 174
                         </select>
166 175
                     </div>
167 176
                     <div id='allAssocOutcomes' class='form_validation outcome_form'>
@@ -176,7 +185,7 @@
176 185
                                 <div class="form-group col-md-11 selectObjective">
177 186
                                     <label>Associated Objectives for Outcome 1</label>
178 187
                                     <select id="assoc_objective_0_counter_1" name="objective[]"
179
-                                        class="form-control selectpicker">
188
+                                        class="form-control selectpicker" onchange="visiblePrograms('allAssocOutcomes')">
180 189
                                         <option value="0">No associated objectives</option>
181 190
                                     </select>
182 191
 
@@ -192,9 +201,10 @@
192 201
                                 </span>
193 202
                                 Add another Objective
194 203
                             </button>
195
-                        </div>
204
+                        
196 205
                         <hr>
197 206
                     </div>
207
+                </div>
198 208
                     <button class='btn btn-md btn-secondary button-add-outcome-assoc' onclick='addAssocOutcome()'>
199 209
                         <span class='glyphicon glyphicon-plus'>
200 210
 
@@ -206,18 +216,32 @@
206 216
 
207 217
 
208 218
                     <!-- Associated Program -->
209
-                    <div class="form-group form_validation program_form"">
219
+                    <div class="form-group form_validation program_form" id = 'assoc-program-checkboxes'>
210 220
 
211 221
                             {{ Form::label('program_id2', 'Associated Program') }}<br><br>
212 222
 
223
+                            @if(count($programs) ==1)
224
+                           
213 225
                             <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
214
-                        value="{{ $programs[0]->id }}">
226
+                            value="{{ $programs[0]->id }}">
227
+    
228
+                            <input type="checkbox" id="assoc_program-{{ $programs[0]->id }}" name="program_id[]"
229
+                                value="{{ $programs[0]->id }}"  checked>
230
+                            <label for="assoc_program-{{ $programs[0]->id }}"> {{ $programs[0]->name }}
231
+                                <sub>[{{ $programs[0]->school->name }}]</sub></label><br>
232
+    
233
+                        @else
234
+                  @foreach ($programs as $program)
235
+                         <input type="checkbox" id="assoc_program-{{ $program->id }}" name="program_id[]"
236
+                                value="{{ $program->id }}">
237
+                            <label for="assoc_program-{{ $program->id }}"> {{ $program->name }}
238
+                                <sub>[{{ $program->school->name }}]</sub></label><br>
239
+                       
240
+                            @endforeach
215 241
 
216
-                        <input type="checkbox" id="assoc_program_id_{{ $programs[0]->id }}" name="program_id[]"
217
-                            value="{{ $programs[0]->id }}" disabled checked>
218
-                        <label for="assoc_program_id_{{ $programs[0]->id }}"> {{ $programs[0]->name }}
219
-                            <sub>[{{ $programs[0]->school->name }}]</sub></label><br>
242
+                    @endif
220 243
 
244
+                            
221 245
                     </div>
222 246
 
223 247
 
@@ -605,13 +629,16 @@
605 629
 
606 630
 
607 631
                     */
632
+                            visiblePrograms('allAssocOutcomes');
608 633
 
609
-
610
-
611
-                    // Select status
612
-
613
-
614
-
634
+                    var program_length = criterion.program.length;
635
+                    
636
+                        $('input[type=checkbox]').prop('checked', false);
637
+                        for (var i = 0; i < program_length; i++) {
638
+                        $('#assoc_program-' + criterion.program[i].program_id).prop("checked", true);
639
+                    }
640
+                    
641
+                  
615 642
 
616 643
 
617 644
 
@@ -879,6 +906,98 @@
879 906
 
880 907
         })*/
881 908
 
909
+        visibleProgram = {};
910
+        visibleProgram["allAssocOutcomes"] = {}
911
+        visibleProgram["allOutcomes"] = {}
912
+
913
+        function visiblePrograms(allOutcomesDiv) {
914
+            checkedPrograms = {}
915
+            $('#' + allOutcomesDiv).parent().find('input:checkbox').each(function(index) {
916
+
917
+                id = $(this).attr('id');
918
+                if ($(this).is(':checked')) {
919
+                    checkedPrograms[$(this).attr('id')] = 1;
920
+                    $(this).prop("checked", false);
921
+                }
922
+                program_id = $(this).val();
923
+                if (!(program_id in visibleProgram[allOutcomesDiv])) {
924
+                    visibleProgram[allOutcomesDiv][program_id] = {};
925
+                }
926
+                visibleProgram[allOutcomesDiv][program_id]["checkbox"] = $(this).detach();
927
+                $("label[for='" + id + "']").next('br').remove();
928
+                visibleProgram[allOutcomesDiv][program_id]["label"] = $("label[for='" + id + "']").detach();
929
+
930
+            })
931
+            if (allOutcomesDiv == "allOutcomes") {
932
+                $('#' + allOutcomesDiv).parent().find("select[name='objective[]']").each(function(index) {
933
+
934
+                    //program_ids in objective
935
+                    var the_programs = $(this).find(':selected').data('program-ids');
936
+                    if (!the_programs) return;
937
+
938
+
939
+                    for (index in the_programs) {
940
+                        program_id = the_programs[index];
941
+
942
+                        //if the program_id is inside the visibleProgram scope
943
+                        //and the checkbox isnt alread present
944
+
945
+                        if (program_id in visibleProgram[allOutcomesDiv] &&
946
+                            !($('#program-checkboxes').find('#' + visibleProgram[allOutcomesDiv][program_id][
947
+                                'checkbox'
948
+                            ].attr('id')).val())) {
949
+                            //if it was checked, check it again
950
+                            id = visibleProgram[allOutcomesDiv][program_id]['checkbox'].attr('id');
951
+                            if (checkedPrograms[id]) {
952
+                                visibleProgram[allOutcomesDiv][program_id]['checkbox'].prop('checked', true);
953
+                            }
954
+                            visibleProgram[allOutcomesDiv][program_id]['checkbox'].appendTo('#program-checkboxes');
955
+
956
+
957
+                            visibleProgram[allOutcomesDiv][program_id]['label'].appendTo("#program-checkboxes");
958
+                            $('#program-checkboxes').append('<br>');
959
+
960
+
961
+
962
+                        }
963
+                    }
964
+
965
+                })
966
+            } else {
967
+                $('#' + allOutcomesDiv).find("select[name='objective[]']").each(function(index) {
968
+                    var the_programs = $(this).find(':selected').data('program-ids');
969
+                    if (!the_programs) return;
970
+
971
+
972
+                    for (index in the_programs) {
973
+                        program_id = the_programs[index];
974
+                        if (program_id in visibleProgram[allOutcomesDiv] &&
975
+                            !($('#assoc-program-checkboxes').find('#' + visibleProgram[allOutcomesDiv][program_id][
976
+                                'checkbox'
977
+                            ].attr('id')).val())) {
978
+
979
+                            id = visibleProgram[allOutcomesDiv][program_id]['checkbox'].attr('id');
980
+                            if (checkedPrograms[id]) {
981
+                                visibleProgram[allOutcomesDiv][program_id]['checkbox'].prop('checked', true);
982
+
983
+                            }
984
+                            visibleProgram[allOutcomesDiv][program_id]['checkbox'].appendTo(
985
+                                '#assoc-program-checkboxes');
986
+
987
+                            visibleProgram[allOutcomesDiv][program_id]['label'].appendTo(
988
+                                "#assoc-program-checkboxes");
989
+                            $('#assoc-program-checkboxes').append('<br>');
990
+
991
+
992
+
993
+                        }
994
+                    }
995
+
996
+                })
997
+            }
998
+
999
+        }
1000
+
882 1001
 
883 1002
         function addOptions(select, max, scaleDiv) {
884 1003
 
@@ -1138,14 +1257,14 @@
1138 1257
 
1139 1258
         }
1140 1259
         //Delete Objective
1141
-
1142
-        function deleteObjective(objectiveForm, closeObj, objectiveGroup) {
1260
+        function deleteObjective(objectiveForm, closeObj, objectiveGroup, allOutcomes) {
1143 1261
             $div = document.getElementById(objectiveForm);
1144 1262
             $div.remove();
1145 1263
             $div = document.getElementById(closeObj);
1146 1264
             $div.remove();
1147 1265
             counter = parseInt($('#' + objectiveGroup).data("value"));
1148 1266
             $('#' + objectiveGroup).data("value", counter - 1);
1267
+            visiblePrograms(allOutcomes);
1149 1268
 
1150 1269
 
1151 1270
         }
@@ -1162,6 +1281,7 @@
1162 1281
                 'name': "objective[]",
1163 1282
                 'data-live-search': 'true',
1164 1283
                 'id': originalObjective + '_counter_' + (assocObjectiveCounter + 1).toString(),
1284
+                'onchange': "visiblePrograms('allAssocOutcomes')"
1165 1285
 
1166 1286
 
1167 1287
             });
@@ -1208,7 +1328,8 @@
1208 1328
                 'class': "selectpicker form-control",
1209 1329
                 'name': "objective[]",
1210 1330
                 'data-live-search': 'true',
1211
-                'id': originalObjective + '_counter_' + (counter + 1).toString()
1331
+                'id': originalObjective + '_counter_' + (counter + 1).toString(),
1332
+                'onchange': "visiblePrograms('allOutcomes')"
1212 1333
             });
1213 1334
             var $div = $('<div/>', {
1214 1335
                 'id': 'objectiveForm_' + objForGroup + '_' + counter.toString(),
@@ -1271,7 +1392,7 @@
1271 1392
                 'type': 'button',
1272 1393
                 'class': 'btn btn-primary',
1273 1394
                 'id': 'assoc_close_button' + assocOutcomeCounter,
1274
-                'onclick': '$(this).parent().parent().remove()'
1395
+                'onclick': '$(this).parent().parent().remove(); visiblePrograms("allAssocOutcomes")'
1275 1396
             });
1276 1397
 
1277 1398
             var divForGroup = $('<div/>', {
@@ -1291,7 +1412,8 @@
1291 1412
                 'class': "selectpicker form-control",
1292 1413
                 'name': "objective[]",
1293 1414
                 'data-live-search': 'true',
1294
-                'id': 'assoc_objective_' + assocOutcomeCounter + '_counter_1'
1415
+                'id': 'assoc_objective_' + assocOutcomeCounter + '_counter_1',
1416
+                'onchange': "visiblePrograms('allAssocOutcomes')"
1295 1417
             });
1296 1418
 
1297 1419
             var empty_div = $('<div/>', {
@@ -1554,7 +1676,7 @@
1554 1676
 
1555 1677
 
1556 1678
     fetchAllCriterion("select-program", "assoc_outcomes_fetch");
1557
-
1679
+    visiblePrograms('allOutcomes');
1558 1680
     // --------------------------------------------------------------------------
1559 1681
     // Functions
1560 1682
     // --------------------------------------------------------------------------

app/views/local/managers/pCoords/objectives.blade.php → app/views/local/managers/shared/objectives.blade.php Ver arquivo

@@ -1,7 +1,13 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-    @include('local.managers.pCoords._navigation')
4
+@if(Auth::user()->role==1)
5
+@include('local.managers.admins._navigation')
6
+@elseif(Auth::user()->role==2)
7
+@include('local.managers.sCoords._navigation')
8
+@elseif(Auth::user()->role==3)
9
+@include('local.managers.pCoords._navigation')
10
+@endif
5 11
 @stop
6 12
 @section('main')
7 13
     <div class="row">
@@ -63,12 +69,13 @@
63 69
                         <br>
64 70
 
65 71
 
66
-                        <input type="hidden" id='assoc_program' name="program_id[]" value="{{ $programs[0]->id }}">
67
-                        <input type="checkbox" id="{{ $programs[0]->name }}" name="program_id[]"
68
-                            value="{{ $programs[0]->id }}" disabled checked>
69
-                        <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }}
70
-                            [{{ $programs[0]->school->name }}]</label><br>
72
+                            @foreach ($programs as $program)
71 73
 
74
+                            <input type="checkbox" id="{{ $program->name }}" name="program_id[]"
75
+                                value="{{ $program->id }}">
76
+                            <label for="{{ $program->name }}"> {{ $program->name }}
77
+                                [{{ $program->school->name }}]</label><br>
78
+                        @endforeach
72 79
 
73 80
                     </div>
74 81
 
@@ -196,16 +203,13 @@
196 203
                         <br>
197 204
 
198 205
 
199
-                        <input type="hidden" id='assoc_program_id_{{ $programs[0]->id }}' name="assoc_program_id[]"
200
-                            value="{{ $programs[0]->id }}">
201
-
202
-                        <input type="checkbox" id="{{ $programs[0]->name }}"
203
-                            id="assoc_program_id_{{ $programs[0]->id }}" name="program_id[]"
204
-                            value="{{ $programs[0]->id }}" disabled checked>
205
-                        <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }}
206
-                            [{{ $programs[0]->school->name }}]</label><br>
207
-
206
+                        @foreach ($programs as $program)
208 207
 
208
+                        <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="assoc_program_id[]"
209
+                            value="{{ $program->id }}">
210
+                        <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }}
211
+                            <sub>[{{ $program->school->name }}]</sub></label><br>
212
+                    @endforeach
209 213
                     </div>
210 214
 
211 215
                     <!-- Status -->
@@ -318,7 +322,7 @@
318 322
         function addOutcomeTest() {
319 323
             var $select = $('<select/>', {
320 324
                 'class': "selectpicker form-control",
321
-                'name': "outcome[' + counter.toString() + ']",
325
+                'name': "outcome[" + counter.toString() + "]",
322 326
                 'data-live-search': 'true'
323 327
 
324 328
             });
@@ -342,9 +346,8 @@
342 346
             var $button = $('<button/>', {
343 347
                 'type': 'button',
344 348
                 'class': 'btn btn-primary',
345
-
346 349
                 //send the counter to the function so it can tell which container to remove
347
-                'onclick': 'deleteLast(' + counter.toString() + ')',
350
+                'onclick': 'deleteLast()',
348 351
 
349 352
             });
350 353
             $button.append('X');
@@ -362,7 +365,7 @@
362 365
         }
363 366
 
364 367
         //Recieves the counter variable so it can find the specific div and delete it
365
-        function deleteLast(counter) {
368
+        function deleteLast() {
366 369
             div = document.getElementById('outcomeContainer' + (counter).toString());
367 370
             div.remove();
368 371
         }
@@ -385,7 +388,7 @@
385 388
 
386 389
                     // Select associated outcome
387 390
                     for (var i = counterAssoc; i != 1; i--) {
388
-                        deleteLastAssoc(i);
391
+                        deleteLastAssoc();
389 392
 
390 393
                     }
391 394
                     $('#assoc_outcome0').val(json.outcome[0].outcome_id);
@@ -429,7 +432,13 @@
429 432
 
430 433
                     }
431 434
 
435
+                    var program_length = json.program.length;
436
+                    $('input[type=checkbox]').prop('checked', false);
432 437
 
438
+                    for (var i = 0; i < program_length; i++) {
439
+                        prog = json.program[i].program_id.toString();
440
+                        $('#assoc_program_id_' + prog).prop("checked", true);
441
+                    }
433 442
 
434 443
 
435 444
                     // Select status
@@ -571,7 +580,7 @@
571 580
 
572 581
             outcome_id = []
573 582
             program_id = [];
574
-            program_id.push($('#assoc_program').val());
583
+            
575 584
             status = $('#status').val();
576 585
             text = $('#objective-text').val();
577 586
             id = $('#select-objective').val();
@@ -579,7 +588,10 @@
579 588
             $('#assocOutcomeGroup').find('select').each(function() {
580 589
                 outcome_id.push($(this).val())
581 590
             })
582
-
591
+$('input[name="assoc_program_id[]"]').each(function() {
592
+                if (this.checked)
593
+                    program_id.push($(this).val())
594
+            });
583 595
             $.post(
584 596
                 "{{ URL::action('Objective2Controller@update') }}", {
585 597
                     assoc_outcome: outcome_id,

+ 1
- 1
app/views/local/managers/shared/rubrics.blade.php Ver arquivo

@@ -111,7 +111,7 @@
111 111
                     @endif
112 112
 
113 113
                     <!-- If user is admin or school coordinator, s/he can pick which programs -->
114
-                    @if(Auth::user()->role==1 || Auth::user()->role==2)
114
+                    @if(Auth::user()->role==1 || Auth::user()->role==2 || Auth::user()->role ==3)
115 115
                     <div class="form-group">
116 116
                         <label>Select the Program this rubric belongs to</label>
117 117
                         <select id="select-program" class="form-control selectpicker">

+ 3
- 1
app/views/local/managers/shared/rubrics_new.blade.php Ver arquivo

@@ -135,11 +135,13 @@
135 135
                     @endif
136 136
 
137 137
                     <!-- If user is admin or school coordinator, s/he can pick which programs -->
138
-                    @if(Auth::user()->role==1 || Auth::user()->role==2)
138
+                    @if(Auth::user()->role==1 || Auth::user()->role==2 || Auth::user()->role==3)
139 139
                     <div class="form-group">
140 140
                         <label>Select the Program this rubric belongs to</label>
141 141
                         <select id="select-program" class="form-control selectpicker">
142
+                            @if(Auth::user()->role != 3)
142 143
                             <option data-program-id="0">All</option>
144
+                            @endif
143 145
                             @foreach ($programs as $program)
144 146
                                 <option
145 147
                                     data-program-id="{{ $program->id }}"

+ 4
- 1
app/views/local/professors/new_assessment_report.blade.php Ver arquivo

@@ -28,7 +28,7 @@
28 28
             <!-- For each grouped course -->
29 29
             <ul id="levelTabs" class="nav nav-tabs" role="tablist">
30 30
 
31
-
31
+                <?php set_time_limit(0);?>
32 32
                 @foreach ($courses as $index2 => $course)
33 33
 
34 34
 
@@ -268,6 +268,8 @@
268 268
                                 <p style="display: inline;">{{ $activity->name }}
269 269
                                     <strong>({{ $activity->date }})</strong>
270 270
                                 </p>
271
+                                <br>
272
+                                <br>
271 273
                                 <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
272 274
                                 <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
273 275
                                 </p>
@@ -524,6 +526,7 @@
524 526
                                 <p style="display: inline;">{{ $activity->name }}
525 527
                                     <strong>({{ $activity->date }})</strong>
526 528
                                 </p>
529
+                                <br><br>
527 530
                                 <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
528 531
                                 <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
529 532
                                 </p>