浏览代码

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

Trabajos en OutcomesController en paralelo
父节点
当前提交
300ec6d14e
共有 26 个文件被更改,包括 2773 次插入435 次删除
  1. 138
    5
      app/controllers/AnnualPlansController.php
  2. 2
    2
      app/controllers/OutcomesController.php
  3. 110
    2
      app/controllers/TransformativeActionsController.php
  4. 2
    2
      app/database/migrations/2022_02_04_040351_add_submit_in_typ_program.php
  5. 32
    0
      app/database/migrations/2022_02_10_194719_add_time_limit_annual_cycle.php
  6. 32
    0
      app/database/migrations/2022_02_10_195154_add_time_limit_three_year_plan.php
  7. 43
    0
      app/database/migrations/2022_02_13_122758_create_typ_outcome_report_comments.php
  8. 32
    0
      app/database/migrations/2022_02_13_122842_add_results_to_transformative_status.php
  9. 39
    0
      app/database/migrations/2022_02_15_121554_create_transformative_future_course.php
  10. 38
    0
      app/database/migrations/2022_02_15_131614_add_user_id_to_template.php
  11. 37
    0
      app/database/migrations/2022_02_15_184454_add_semester_id_transformative_action_status.php
  12. 4
    1
      app/models/Activity.php
  13. 15
    1
      app/models/Course.php
  14. 1
    0
      app/models/Objective.php
  15. 9
    1
      app/models/TransformativeAction.php
  16. 11
    0
      app/models/TransformativeActionStatus.php
  17. 21
    0
      app/routes.php
  18. 4
    4
      app/views/global/view-three-year-plan.blade.php
  19. 240
    32
      app/views/local/managers/admins/new_assessment_report.blade.php
  20. 1
    1
      app/views/local/managers/pCoords/criteria.blade.php
  21. 247
    0
      app/views/local/managers/pCoords/new_assessment_report.blade.php
  22. 251
    0
      app/views/local/managers/sCoords/new_assessment_report.blade.php
  23. 745
    314
      app/views/local/managers/shared/annual-plans.blade.php
  24. 460
    67
      app/views/local/managers/shared/annual_report.blade.php
  25. 1
    0
      app/views/local/professors/course.blade.php
  26. 258
    3
      app/views/local/professors/new_assessment_report.blade.php

+ 138
- 5
app/controllers/AnnualPlansController.php 查看文件

@@ -206,7 +206,7 @@ class AnnualPlansController extends \BaseController
206 206
     $an_plan = DB::table("annual_plans")
207 207
       ->join('annual_cycle', 'annual_cycle.id', '=', 'annual_plans.annual_cycle_id')
208 208
       ->where('annual_plans.id', '=', Input::get('id'))
209
-      ->select('annual_plans.id as id', 'program_id', 'academic_year', 'semester_start', 'semester_end')
209
+      ->select('annual_plans.id as id', 'program_id', 'academic_year', 'semester_start', 'semester_end', 'is_submitted')
210 210
       ->first();
211 211
 
212 212
     $years = explode('-', $an_plan->academic_year);
@@ -232,18 +232,26 @@ class AnnualPlansController extends \BaseController
232 232
 
233 233
     $json_to_send["outcomes"]["first"] = DB::table('outcomes')
234 234
       ->join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
235
+      ->join('typ_semester_objectives', 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
236
+      ->join('typ_semester_courses', 'typ_semester_objectives.id', '=', 'typ_semester_courses.typ_semester_objective_id')
235 237
       ->where('semester_id', $an_plan->semester_start)
236 238
       ->where('typ_program_id', $current_typ_program->id)
239
+
237 240
       ->select('outcomes.*', 'typ_semester_outcome.id as typ_semester_outcome_id')
241
+      ->groupBy('typ_semester_outcome_id')
238 242
       ->get();
239 243
 
240 244
     //DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id = {$an_plan->semester_start} and typ_program_id = {$current_typ_program->id})");
241 245
     $json_to_send["allSemesterOrder"]["first"] = DB::select("select * from semesters where id = {$an_plan->semester_start}")[0];
242 246
     $json_to_send["outcomes"]["second"] = DB::table('outcomes')
243 247
       ->join('typ_semester_outcome', 'typ_semester_outcome.outcome_id', '=', 'outcomes.id')
248
+      ->join('typ_semester_objectives', 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
249
+      ->join('typ_semester_courses', 'typ_semester_objectives.id', '=', 'typ_semester_courses.typ_semester_objective_id')
250
+
244 251
       ->where('semester_id', $an_plan->semester_end)
245 252
       ->where('typ_program_id', $current_typ_program->id)
246 253
       ->select('outcomes.*', 'typ_semester_outcome.id as typ_semester_outcome_id')
254
+      ->groupBy('typ_semester_outcome_id')
247 255
       ->get();
248 256
 
249 257
     //DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id ={$an_plan->semester_end} and typ_program_id  = {$current_typ_program->id})");
@@ -346,17 +354,34 @@ class AnnualPlansController extends \BaseController
346 354
     $typ_info['transformative_actions_for_outcome'] = DB::table('transformative_actions')
347 355
       ->join('transformative_typ_outcome', 'transformative_typ_outcome.trans_id', '=', 'transformative_actions.id')
348 356
       ->where('transformative_typ_outcome.typ_semester_outcome_id', $typ_semester_outcome_id)
357
+
349 358
       ->get();
350 359
     $typ_info['categories'] = "<option value='0'>Nothing Selected</option>";
351 360
 
352 361
     $types = DB::table('transformative_actions')
353
-      ->select('type_of_TA')
362
+      ->select('type_of_TA', 'is_custom')
354 363
       ->where('type_of_TA', '<>', '')
355
-      ->distinct()
364
+      ->where(function ($query) use (&$program_id) {
365
+        $query->whereNull('program_id')
366
+          ->orWhere('program_id', $program_id);
367
+      })
368
+      ->where('by_professor', 0)
369
+      ->groupBy('type_of_TA')
356 370
       ->get();
371
+    $optGroupGeneral = "<optgroup label='General Transformative Actions'>";
372
+    $optGroupCustom = "<optgroup label ='Program Custom Actions'>";
357 373
     foreach ($types as $type) {
358
-      $typ_info['categories'] .= "<option value = '" . $type->type_of_TA . "'>" . $type->type_of_TA . "</option>";
374
+
375
+      if ($type->is_custom) {
376
+        $optGroupCustom .= "<option value = '" . $type->type_of_TA . "' data-is-custom = '1'>" . $type->type_of_TA . "</option>";
377
+      } else {
378
+        $optGroupGeneral .= "<option value = '" . $type->type_of_TA . "' data-is-custom = '0'>" . $type->type_of_TA . "</option>";
379
+      }
359 380
     }
381
+    $typ_info['categories'] .= $optGroupGeneral . '</optgroup>';
382
+    $typ_info['categories'] .= $optGroupCustom . '</optgroup>';
383
+
384
+
360 385
     $typ_info['categories'] .= '<option value ="new"> New Type of Transformative Action</option>';
361 386
     return json_encode($typ_info);
362 387
   }
@@ -662,7 +687,7 @@ class AnnualPlansController extends \BaseController
662 687
     return View::make('local.managers.shared.annual_select', compact('title', 'programs'));
663 688
   }
664 689
 
665
-
690
+  //Fetch report in annual_plan_report
666 691
 
667 692
   public function fetchReportWithOutcome()
668 693
   {
@@ -670,6 +695,7 @@ class AnnualPlansController extends \BaseController
670 695
     $semester_id = Input::get('semester_id');
671 696
     $annual_plan_id = Input::get('annual_plan_id');
672 697
     $outcome_id = Input::get('outcome_id');
698
+    $typ_semester_outcome_id = Input::get('typ_semester_outcome_id');
673 699
 
674 700
     $outcome = Outcome::where('id', $outcome_id)->first();
675 701
     $outcome->objectives = $outcome->fetchObjectivesReport($semester_id, $program_id);
@@ -677,6 +703,19 @@ class AnnualPlansController extends \BaseController
677 703
       ->where('program_id', $program_id)
678 704
       ->where('semester_id', $semester_id)
679 705
       ->first();
706
+    $outcome->transforming_actions = DB::table('transformative_typ_outcome')
707
+      ->join('transformative_actions', 'transformative_actions.id', '=', 'transformative_typ_outcome.trans_id')
708
+      ->leftJoin('transformative_action_status', 'transformative_actions.id', '=', 'transformative_action_status.trans_id')
709
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
710
+      ->select('transformative_actions.*', 'transformative_action_status.*', 'transformative_actions.id as trans_id')
711
+      ->get();
712
+    $outcome->semester_info = DB::table('semesters')
713
+      ->where('id', $semester_id)
714
+      ->first();
715
+    $outcome->comments = DB::table('typ_outcome_report_comments')
716
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
717
+      ->get();
718
+
680 719
 
681 720
     foreach ($outcome->objectives as $index => $objective) {
682 721
       $objective->courses = Objective::getPlanReport($objective);
@@ -721,4 +760,98 @@ class AnnualPlansController extends \BaseController
721 760
     }
722 761
     return $courses;
723 762
   }
763
+
764
+  public function submitAnnualPlan()
765
+  {
766
+    $annual_plan_id = Input::get('annual_plan_id');
767
+    DB::table('annual_plans')->where('id', $annual_plan_id)->update(array(
768
+      'is_submitted' => 1,
769
+      'submitted_on' => date('Y-m-d H:i:s')
770
+    ));
771
+    return;
772
+  }
773
+
774
+  public function fetchTheAnnualPlan()
775
+  {
776
+    $outcome_id = Input::get('id');
777
+    $semester_id = Input::get('semester');
778
+    $typ_semester_outcome_id = Input::get('typ_semester_outcome_id');
779
+    $program_id = Input::get('program_id');
780
+
781
+    $outcome = Outcome::find($outcome_id);
782
+
783
+    //El nombre es annual_plan_objective, fue cambiado como mil veces por Arlene y su combo
784
+    // Así que está mal escrito. Sorry future programmer
785
+
786
+    $array_to_send = [];
787
+    $array_to_send['typ_objectives'] = DB::table('typ_semester_objectives')
788
+      ->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
789
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
790
+      ->select('objectives.*', 'typ_semester_outcome_id', 'typ_semester_objectives.id as typ_semester_objective_id')
791
+      ->get();
792
+    $array_to_send['typ_courses'] = DB::table('typ_semester_objectives')
793
+      ->join('typ_semester_courses', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
794
+      ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
795
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
796
+      ->select('courses.*', 'typ_semester_objective_id', 'typ_semester_courses.id as typ_semester_course_id')
797
+      ->get();
798
+    $array_to_send['courses_criteria'] = DB::table('typ_semester_objectives')
799
+      ->join('typ_semester_courses', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
800
+      ->join('annual_plan_objective', 'annual_plan_objective.typ_semester_course_id', '=', 'typ_semester_courses.id')
801
+      ->join('criteria', 'criteria.id', '=', 'annual_plan_objective.criteria_id')
802
+      ->select('typ_semester_course_id', 'annual_plan_objective.*', 'criteria.*')
803
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
804
+      ->groupBy('typ_semester_course_id')
805
+      ->get();
806
+    $array_to_send['courses_transformative_actions'] = DB::table('typ_semester_objectives')
807
+      ->join('typ_semester_courses', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
808
+      ->join('annual_plan_transformative', 'annual_plan_transformative.typ_semester_course_id', '=', 'typ_semester_courses.id')
809
+      ->join('transformative_actions', 'transformative_actions.id', '=', 'annual_plan_transformative.trans_id')
810
+      ->select('typ_semester_course_id', 'annual_plan_transformative.*', 'transformative_actions.*')
811
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
812
+      ->groupBy('typ_semester_course_id')
813
+      ->get();
814
+    $array_to_send['transformative_outcome'] = DB::table('transformative_actions')
815
+      ->join('transformative_typ_outcome', 'transformative_actions.id', '=', 'transformative_typ_outcome.trans_id')
816
+      ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
817
+      ->get();
818
+
819
+    $array_to_send['expected_target'] = DB::table('target_outcomes_program')
820
+      ->where('program_id', $program_id)
821
+      ->where('semester_id', $semester_id)
822
+      ->first();
823
+    return $array_to_send;
824
+  }
825
+
826
+  public function addCommentsToOutcome()
827
+  {
828
+    $edit_id = Input::get('edit_id');
829
+    $typ_semester_outcome_id = Input::get('typ_outcome_semester_id');
830
+    $comments = Input::get('comments');
831
+
832
+    Log::info(Input::all());
833
+
834
+    if ($edit_id) {
835
+      DB::table('typ_outcome_report_comments')
836
+        ->where('id', $edit_id)->update(array(
837
+          'user_id' => Auth::user()->id,
838
+          'typ_semester_outcome_id' => $typ_semester_outcome_id,
839
+          'comments' => $comments
840
+        ));
841
+    } else {
842
+      $edit_id = DB::table('typ_outcome_report_comments')->insertGetId(array(
843
+        'user_id' => Auth::user()->id,
844
+        'typ_semester_outcome_id' => $typ_semester_outcome_id,
845
+        'comments' => $comments
846
+      ));
847
+    }
848
+    return $edit_id;
849
+  }
850
+  public function deleteCommentsFromOutcome()
851
+  {
852
+    $comment_id = Input::get('id');
853
+
854
+    DB::table('typ_outcome_report_comments')->where('id', $comment_id)->delete();
855
+    return;
856
+  }
724 857
 }

+ 2
- 2
app/controllers/OutcomesController.php 查看文件

@@ -1071,8 +1071,8 @@ private function cmp($a, $b) {
1071 1071
         from annual_plans 
1072 1072
         join annual_cycle on annual_cycle_id = annual_cycle.id 
1073 1073
         where program_id = {$program_id} 
1074
-        and
1075
-        annual_plans.is_submitted =1
1074
+        
1075
+        
1076 1076
           order by semester_start desc");
1077 1077
         $program = DB::table('programs')
1078 1078
             ->where('id', $program_id)

+ 110
- 2
app/controllers/TransformativeActionsController.php 查看文件

@@ -46,7 +46,7 @@ class TransformativeActionsController extends \BaseController
46 46
     $types = DB::table('transformative_actions')
47 47
       ->select('type_of_TA')
48 48
       ->where('type_of_TA', '<>', '')
49
-      ->distinct()
49
+      ->groupBy('type_of_TA')
50 50
       ->get();
51 51
     // if user is program coordinator
52 52
 
@@ -1404,4 +1404,112 @@ class TransformativeActionsController extends \BaseController
1404 1404
     }
1405 1405
     return $grouped_courses;
1406 1406
   }
1407
-}
1407
+  public function createTAForOutcome()
1408
+  {
1409
+    $is_custom = Input::get('is_custom');
1410
+    $category = Input::get('category');
1411
+    $is_new = Input::get('is_new');
1412
+    $name = Input::get('name');
1413
+    $description = Input::get('description');
1414
+    $edit_ta_id = Input::get('edit');
1415
+    if ($is_new || $is_custom)
1416
+      $program_id = Input::get('program_id');
1417
+    else $program_id = NULL;
1418
+    $typ_semester_outcome_id = Input::get('typ_semester_outcome_id');
1419
+
1420
+    if (!$edit_ta_id) {
1421
+      $ta_id = DB::table('transformative_actions')->insertGetId(array(
1422
+        'program_id' => $program_id,
1423
+        'type_of_TA' => $category,
1424
+        'at_text' => $name,
1425
+        'description' => $description,
1426
+        'user_id' => Auth::user()->id,
1427
+        'created_at' => date('Y-m-d H:i:s'),
1428
+        'updated_at' => date('Y-m-d H:i:s'),
1429
+        'by_professor' => 0,
1430
+        'is_custom' => $is_custom
1431
+      ));
1432
+      DB::table('transformative_typ_outcome')->insert(array(
1433
+        'trans_id' => $ta_id,
1434
+        'typ_semester_outcome_id' => $typ_semester_outcome_id,
1435
+        'proposing_coordinator_id' => Auth::user()->id,
1436
+
1437
+      ));
1438
+    } else {
1439
+      DB::table('transformative_actions')
1440
+        ->where('id', $edit_ta_id)
1441
+        ->update(array(
1442
+          'program_id' => $program_id,
1443
+          'type_of_TA' => $category,
1444
+          'at_text' => $name,
1445
+          'description' => $description,
1446
+          'user_id' => Auth::user()->id,
1447
+          'created_at' => date('Y-m-d H:i:s'),
1448
+          'updated_at' => date('Y-m-d H:i:s'),
1449
+          'by_professor' => 0,
1450
+          'is_custom' => $is_custom
1451
+        ));
1452
+      $ta_id = $edit_ta_id;
1453
+    }
1454
+    return $ta_id;
1455
+  }
1456
+  public function deleteTaFromOutcome()
1457
+  {
1458
+    DB::table('transformative_actions')
1459
+      ->where('id', Input::get('trans_id'))
1460
+      ->delete();
1461
+    return;
1462
+  }
1463
+
1464
+  public function fetchStatus()
1465
+  {
1466
+    $trans_id = Input::get('trans_id');
1467
+    $semester_id = Input::get('semester_id');
1468
+    $transformative_action = DB::table('transformative_actions')
1469
+      ->where('id', $trans_id)
1470
+      ->first();
1471
+    $transformative_action->status = DB::table('transformative_action_status')
1472
+      ->where('trans_id', $transformative_action->id)
1473
+      ->where('semester_id', $semester_id)
1474
+      ->first();
1475
+
1476
+
1477
+    //TransformativeAction::find($trans_id)->status($semester_id);
1478
+
1479
+    return array($transformative_action);
1480
+  }
1481
+  public function saveTransStatus()
1482
+  {
1483
+    $semester_id = Input::get('semester_id');
1484
+    $trans_id = Input::get('trans_id');
1485
+    $results = Input::get('results');
1486
+    $comments = Input::get('comments');
1487
+    $accomplished = Input::get('accomplished');
1488
+    $was_it_useful = Input::get('was_it_useful');
1489
+
1490
+    $existing_status = DB::table('transformative_action_status')
1491
+      ->where('semester_id', $semester_id)
1492
+      ->where('trans_id', $trans_id)
1493
+      ->first();
1494
+    if ($existing_status) {
1495
+      DB::table('transformative_action_status')->update(array(
1496
+        'results' => $results,
1497
+        'comments' => $comments,
1498
+        'accomplished' => $accomplished,
1499
+        'it_was_useful' => $was_it_useful,
1500
+        'supervised_coordinator_id' => Auth::user()->id
1501
+      ));
1502
+    } else {
1503
+      DB::table('transformative_action_status')->insert(array(
1504
+        'trans_id' => $trans_id,
1505
+        'results' => $results,
1506
+        'comments' => $comments,
1507
+        'accomplished' => $accomplished,
1508
+        'it_was_useful' => $was_it_useful,
1509
+        'semester_id' => $semester_id,
1510
+        'supervised_coordinator_id' => Auth::user()->id
1511
+      ));
1512
+    }
1513
+    return "done";
1514
+  }
1515
+}

+ 2
- 2
app/database/migrations/2022_02_04_040351_add_submit_in_typ_program.php 查看文件

@@ -13,7 +13,7 @@ class AddSubmitInTypProgram extends Migration
13 13
 	 */
14 14
 	public function up()
15 15
 	{
16
-		Schema::table('courses', function (Blueprint $table) {
16
+		Schema::table('typ_program', function (Blueprint $table) {
17 17
 			$table->boolean('is_submitted');
18 18
 		});
19 19
 	}
@@ -25,7 +25,7 @@ class AddSubmitInTypProgram extends Migration
25 25
 	 */
26 26
 	public function down()
27 27
 	{
28
-		Schema::table('courses', function (Blueprint $table) {
28
+		Schema::table('typ_program', function (Blueprint $table) {
29 29
 			$table->dropColumn('is_submitted');
30 30
 		});
31 31
 	}

+ 32
- 0
app/database/migrations/2022_02_10_194719_add_time_limit_annual_cycle.php 查看文件

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class AddTimeLimitAnnualCycle extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::table('annual_cycle', function (Blueprint $table) {
17
+			$table->timestamp('is_due_for')->nullable();
18
+		});
19
+	}
20
+
21
+	/**
22
+	 * Reverse the migrations.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function down()
27
+	{
28
+		Schema::table('annual_cycle', function (Blueprint $table) {
29
+			$table->dropColumn('is_due_for');
30
+		});
31
+	}
32
+}

+ 32
- 0
app/database/migrations/2022_02_10_195154_add_time_limit_three_year_plan.php 查看文件

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class AddTimeLimitThreeYearPlan extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::table('three_year_plan', function (Blueprint $table) {
17
+			$table->timestamp('is_due_for')->nullable();
18
+		});
19
+	}
20
+
21
+	/**
22
+	 * Reverse the migrations.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function down()
27
+	{
28
+		Schema::table('three_year_plan', function (Blueprint $table) {
29
+			$table->dropColumn('is_due_for');
30
+		});
31
+	}
32
+}

+ 43
- 0
app/database/migrations/2022_02_13_122758_create_typ_outcome_report_comments.php 查看文件

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

+ 32
- 0
app/database/migrations/2022_02_13_122842_add_results_to_transformative_status.php 查看文件

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class AddResultsToTransformativeStatus extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::table('transformative_action_status', function (Blueprint $table) {
17
+			$table->text('results')->nullable();
18
+		});
19
+	}
20
+
21
+	/**
22
+	 * Reverse the migrations.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function down()
27
+	{
28
+		Schema::table('transformative_action_status', function (Blueprint $table) {
29
+			$table->dropColumn('results');
30
+		});
31
+	}
32
+}

+ 39
- 0
app/database/migrations/2022_02_15_121554_create_transformative_future_course.php 查看文件

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

+ 38
- 0
app/database/migrations/2022_02_15_131614_add_user_id_to_template.php 查看文件

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

+ 37
- 0
app/database/migrations/2022_02_15_184454_add_semester_id_transformative_action_status.php 查看文件

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

+ 4
- 1
app/models/Activity.php 查看文件

@@ -393,7 +393,10 @@ class Activity extends Eloquent
393 393
     $outcomes_attempted = [];
394 394
 
395 395
     $all_criterion = DB::table('activity_criterion')
396
+      ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
396 397
       ->where('activity_criterion.activity_id', '=', $this->id)
398
+      ->groupBy('criterion_id')
399
+
397 400
       ->lists('criterion_id');
398 401
 
399 402
     foreach ($all_criterion as $index => $criterion_id) {
@@ -414,4 +417,4 @@ class Activity extends Eloquent
414 417
     //return json_decode($this->outcomes_attempted, true);
415 418
     return $outcomes_attempted;
416 419
   }
417
-}
420
+}

+ 15
- 1
app/models/Course.php 查看文件

@@ -64,6 +64,20 @@ class Course extends Eloquent
64 64
     //$this->hasMany('Activity')->whereNotNull('activities.outcomes_attempted')->where('activities.draft', 0)->orderBy('date', 'asc');
65 65
     return  $this->hasMany('Activity')->whereIn('activities.id', $activitiesAssessed)->orderBy('date', 'asc');
66 66
   }
67
+  public function diagnosticActivities()
68
+  {
69
+    $activitiesAssessed = DB::table('activities')
70
+      ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
71
+      ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
72
+      ->where('activities.course_id', $this->id)
73
+      ->where('activities.draft', 0)
74
+      ->where('activities.diagnostic', 1)
75
+      ->select('activities.id')
76
+      ->distinct()
77
+      ->lists('activities.id');
78
+    //$this->hasMany('Activity')
79
+    return  $this->hasMany('Activity')->whereIn('activities.id', $activitiesAssessed)->orderBy('date', 'asc');
80
+  }
67 81
 
68 82
   public function outcomes_attempted()
69 83
   {
@@ -181,7 +195,7 @@ class Course extends Eloquent
181 195
   public static function getStudentReportForOutcome($course_code = null)
182 196
   {
183 197
     if ($course_code) {
184
-      Log::info('entré');
198
+      //Log::info('entré');
185 199
       $criteria_id = DB::table('annual_plan_objective')
186 200
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
187 201
         ->lists('criteria_id');

+ 1
- 0
app/models/Objective.php 查看文件

@@ -46,6 +46,7 @@ class Objective extends Eloquent
46 46
                 ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
47 47
                 ->select('transformative_actions.*')
48 48
                 ->get();
49
+
49 50
             $course_code->students = Course::getStudentReportForOutcome($course_code);
50 51
             Log::info(array($course_code));
51 52
             $course_code->criteria = Course::getCriteriaPlanReport($course_code);

+ 9
- 1
app/models/TransformativeAction.php 查看文件

@@ -3,4 +3,12 @@
3 3
 class TransformativeAction extends Eloquent
4 4
 {
5 5
     protected $table = 'transformative_actions';
6
-}
6
+
7
+    public function scopeStatus($query, $semester_id)
8
+    {
9
+        return $query->join('transformative_action_status')
10
+            ->where('trans_id', $this->id)
11
+            ->where('semester_id', $semester_id)
12
+            ->first();
13
+    }
14
+}

+ 11
- 0
app/models/TransformativeActionStatus.php 查看文件

@@ -0,0 +1,11 @@
1
+<?php
2
+
3
+class TransformativeActionStatus extends Eloquent
4
+{
5
+    protected $table = 'transformative_action_status';
6
+
7
+    public function trans_id()
8
+    {
9
+        return $this->belongsTo('TransformativeAction');
10
+    }
11
+}

+ 21
- 0
app/routes.php 查看文件

@@ -166,6 +166,20 @@ Route::group(array('before' => 'auth|has_access'), function () {
166 166
     /**
167 167
      * Shared Routes
168 168
      */
169
+
170
+    // Annual Plan routes
171
+    Route::post('deleteCommentsFromOutcome', array('uses' => 'AnnualPlansController@deleteCommentsFromOutcome'));
172
+    Route::post('addCommentsToOutcome', array('uses' => 'AnnualPlansController@addCommentsToOutcome'));
173
+    Route::post('fetchAnnualPlan', array('uses' => 'AnnualPlansController@fetchTheAnnualPlan'));
174
+
175
+    Route::post('deleteTaFromOutcome', array('uses' => 'TransformativeActionsController@deleteTaFromOutcome'));
176
+    Route::post(
177
+        'postTransformativeToOutcome',
178
+        array(
179
+            'as' => 'postTransformativeToOutcome',
180
+            'uses' => 'TransformativeActionsController@createTAForOutcome'
181
+        )
182
+    );
169 183
     Route::post('fetchObjectiveInfo', array(
170 184
         'as' => 'fetchObjectiveInfo',
171 185
         'uses' => 'AnnualPlansController@fetchObjectiveInfo'
@@ -188,6 +202,13 @@ Route::group(array('before' => 'auth|has_access'), function () {
188 202
         'as' => 'fetchAnnualReport',
189 203
         'uses' => 'AnnualPlansController@fetchAnnualReport'
190 204
     ));
205
+
206
+    Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
207
+
208
+    Route::post('fetchTransformativeStatus', array('uses' => 'TransformativeActionsController@fetchStatus'));
209
+
210
+    Route::post('saveTransStatus', array('uses' => 'TransformativeActionsController@saveTransStatus'));
211
+    //other stuff
191 212
     Route::post('postActivityCriterionTrans/{activity_id}', array(
192 213
         'as' => 'postActivityCriterionTrans/{activity_id}',
193 214
         'uses' => 'TransformativeActionsController@postActivityCriterion'

+ 4
- 4
app/views/global/view-three-year-plan.blade.php 查看文件

@@ -103,10 +103,10 @@
103 103
           <li data-cycle-id="{{$typ->id}}" class="list-group-item">{{$typ->year_start}}-{{$typ->year_end}}</li>
104 104
         @endforeach
105 105
       </div>
106
-      <br>
106
+      <br> <!--<button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
107
+      -->
107 108
     </div>
108
-        <button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
109
-
109
+       
110 110
 <!-- Modal -->
111 111
 <div id="three_year" class="modal fade" role="dialog">
112 112
   <div class="modal-dialog">
@@ -138,7 +138,7 @@
138 138
 
139 139
   </div>
140 140
 </div>
141
-      </div>
141
+      
142 142
    
143 143
 
144 144
     <div class="col-md-9">

+ 240
- 32
app/views/local/managers/admins/new_assessment_report.blade.php 查看文件

@@ -29,8 +29,6 @@
29 29
 
30 30
                     </ol>
31 31
                     @foreach ($school->programs as $program)
32
-
33
-
34 32
                         {{-- <ul id='levelTabs' class="nav nav-tabs" role="tablist">
35 33
                         <!-- For each grouped course -->
36 34
                         @foreach ($program->courses as $index2 => $course)
@@ -54,18 +52,17 @@
54 52
 
55 53
                                 <!-- If grouped course has activities that evaluate the outcome -->
56 54
                                 @foreach ($program->courses as $index2 => $course)
57
-
58 55
                                     <?php
59 56
                                     
60 57
                                     /*$sections_evaluating = Course::has('activities')
61
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->whereNotNull('outcomes_attempted')
62
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
63
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->with(array('activities'=>function($query) use(&$outcome){
64
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $query->whereNotNull('outcomes_attempted');
65
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
66
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->where('code', $course->code)->where('number',$course->number)
67
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->whereIn('semester_id', Session::get('semesters_ids'))
68
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ->get();*/
58
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->whereNotNull('outcomes_attempted')
59
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
60
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->with(array('activities'=>function($query) use(&$outcome){
61
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                $query->whereNotNull('outcomes_attempted');
62
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
63
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->where('code', $course->code)->where('number',$course->number)
64
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->whereIn('semester_id', Session::get('semesters_ids'))
65
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ->get();*/
69 66
                                     
70 67
                                     $sections_evaluating = Course::has('activities')
71 68
                                     
@@ -107,8 +104,8 @@
107 104
                                             <h3 style="text-align: center"> Course: {{ $course->code }}
108 105
                                                 {{ $course->number }}-{{ $section->section }} </h3>
109 106
                                         @endif
107
+                                        <h4>Non-Diagnostic Activities</h4>
110 108
                                         @foreach ($section->publishedActivities as $index4 => $activity)
111
-
112 109
                                             <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
113 110
                                             <p style="display: inline;">{{ $activity->name }}
114 111
                                                 <strong>({{ $activity->date }})</strong>
@@ -130,7 +127,6 @@
130 127
                                                             @else
131 128
                                                                 and {{ $rubric_title->text }}
132 129
                                                             @endif
133
-
134 130
                                                         @endforeach
135 131
                                                         )
136 132
                                                     @else
@@ -145,7 +141,6 @@
145 141
                                                 <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point
146 142
                                                     scale
147 143
                                                 </p>
148
-
149 144
                                             @endif
150 145
                                             <br>
151 146
                                             <br>
@@ -217,17 +212,12 @@
217 212
 
218 213
                                                                 @else
219 214
                                                                     <td class="col-md-1 danger">{{ $percentage }}%</td>
220
-
221 215
                                                                 @endif
222 216
                                                             @endif
223 217
                                                             <td>
224 218
 
225 219
                                                                 @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
226
-
227 220
                                                                     <?php echo $outcome->name . "\n\n\n <br>"; ?>
228
-
229
-
230
-
231 221
                                                                 @endforeach
232 222
 
233 223
 
@@ -254,18 +244,12 @@
254 244
                                                 <ul style="margin:30px;">
255 245
                                                     @foreach ($formative_actions as $criteria)
256 246
                                                         <li> <i>{{ $criteria->name }} <i></li>
257
-
258 247
                                                     @endforeach
259 248
                                                 </ul>
260
-
261
-
262
-
263 249
                                             @endif
264 250
                                             <br>
265 251
                                             <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
266 252
                                             @if ($activity->assessment_comments != null)
267
-
268
-
269 253
                                                 <p style="display: inline;">{{ $activity->assessment_comments }}</p>
270 254
                                             @endif
271 255
                                             <br>
@@ -295,10 +279,9 @@
295 279
                                                         ->first(); //->expected_target;
296 280
                                                     if (!$expected) {
297 281
                                                         $expected = 'It has not been defined in the annual plan';
282
+                                                    } else {
283
+                                                        $expected = $expected->expected_target;
298 284
                                                     }
299
-                                                    else{
300
-                                            $expected = $expected->expected_target;
301
-                                        }
302 285
                                                     ?>
303 286
                                                     {{ $expected }}
304 287
                                                 </i>
@@ -343,7 +326,6 @@
343 326
                                                                 <td class="col-md-1 danger">
344 327
                                                                     {{ $outcome->percentage }}%
345 328
                                                                 </td>
346
-
347 329
                                                             @endif
348 330
 
349 331
 
@@ -351,23 +333,250 @@
351 333
 
352 334
 
353 335
                                                         </tr>
336
+                                                    @endforeach
337
+                                                </tbody>
338
+                                            </table>
339
+
340
+                                            <br>
341
+                                            <hr>
342
+                                        @endforeach
343
+                                        <h4>Diagnostic Activities</h4>
344
+                                        @foreach ($section->diagnosticActivities as $index4 => $activity)
345
+                                            <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
346
+                                            <p style="display: inline;">{{ $activity->name }}
347
+                                                <strong>({{ $activity->date }})</strong>
348
+                                            </p>
349
+                                            <br>
350
+                                            <br>
351
+                                            <h5 style="display: inline;">Performance Indicators: </h5>
352
+                                            <?php
353
+                                            Log::info($activity->rubric[0]);
354
+                                            ?>
355
+                                            <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
356
+                                                    <?php
357
+                                                    $titles = $activity->rubric[0]->getTitles();
358
+                                                    ?>
359
+                                                    @if (sizeof($titles) != 1)
360
+                                                        @foreach ($titles as $index5 => $rubric_title)
361
+                                                            @if ($index5 != $activity->rubric[0]->num_scales - 1)
362
+                                                                {{ $rubric_title->text }},
363
+                                                            @else
364
+                                                                and {{ $rubric_title->text }}
365
+                                                            @endif
366
+                                                        @endforeach
367
+                                                        )
368
+                                                    @else
369
+                                                        {{ $titles[0]->text }} )
370
+                                                    @endif
371
+                                                </i></p>
372
+                                            <br>
373
+                                            <h5 style="display: inline;">Scale: </h5>
374
+                                            @if ($activity->rubric[0]->max_score == 1)
375
+                                                <p style="display: inline;">1 point scale</p>
376
+                                            @else
377
+                                                <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point
378
+                                                    scale
379
+                                                </p>
380
+                                            @endif
381
+                                            <br>
382
+                                            <br>
383
+                                            <h4>Performance of Students by Learning Outcome Criteria</h4>
384
+                                            <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
385
+                                            <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }}
386
+                                                    or
387
+                                                    more</i>
388
+                                            </p>
389
+                                            <br>
390
+                                            <h5 style="display: inline; margin:30px;">Expected percent of students achieving
391
+                                                the
392
+                                                target by criterion: </h5>
393
+                                            <p style="display: inline;">
394
+                                                <i>{{ $activity->rubric[0]->expected_percentage }}
395
+                                                    %</i>
396
+                                            </p>
397
+
398
+                                            <br>
399
+
400
+                                            <table class='table table-striped table-condensed datatable'>
401
+                                                <thead>
402
+                                                    <tr>
403
+                                                        <th>
404
+                                                            Criterion
405
+                                                        </th>
406
+                                                        <th>
407
+                                                            Number of Students Assessed
408
+                                                        </th>
409
+                                                        <th>
410
+                                                            Number of students that achieved the target
411
+                                                        </th>
412
+                                                        <th>
413
+                                                            %
414
+                                                        </th>
415
+                                                        <th>
416
+                                                            Learning Outcomes
417
+                                                        </th>
418
+                                                    </tr>
419
+                                                </thead>
420
+                                                <tbody>
421
+                                                    @foreach ($activity->allActivityCriterionInfo() as $index5 => $ac_criterion)
422
+                                                        <tr>
423
+                                                            <td> {{ $ac_criterion->name }}</td>
424
+                                                            <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity->id) }}
425
+                                                            </td>
426
+                                                            <td>
427
+                                                                {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity->id) }}
428
+
429
+                                                            </td>
430
+                                                            <?php
431
+                                                            
432
+                                                            $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
433
+                                                            $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
434
+                                                            
435
+                                                            $percentage = 'N/A';
436
+                                                            $activity->getOutcomeReport();
437
+                                                            
438
+                                                            ?>
439
+                                                            @if ($out_att == 0)
440
+                                                                <td class="col-md-1 danger">{{ $percentage }}</td>
441
+
442
+                                                            @else
443
+                                                                <?php
444
+                                                                $percentage = round(($out_ach / $out_att) * 100, 2);
445
+                                                                ?>
446
+                                                                @if ($percentage >= $activity->rubric[0]->expected_percentage)
447
+                                                                    <td class="col-md-1 success">{{ $percentage }}%</td>
448
+
449
+                                                                @else
450
+                                                                    <td class="col-md-1 danger">{{ $percentage }}%</td>
451
+                                                                @endif
452
+                                                            @endif
453
+                                                            <td>
454
+
455
+                                                                @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
456
+                                                                    <?php echo $outcome->name . "\n\n\n <br>"; ?>
457
+                                                                @endforeach
458
+
354 459
 
460
+                                                            </td>
461
+                                                        </tr>
355 462
                                                     @endforeach
356 463
                                                 </tbody>
464
+
357 465
                                             </table>
466
+                                            <br>
467
+                                            <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
468
+                                            <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
469
+                                            @if ($formative_actions)
470
+                                                <p style="display: inline;">
471
+                                                    <u>{{ $formative_actions[0]->at_text }}:
472
+                                                    </u>
358 473
 
474
+                                                    <i>{{ $formative_actions[0]->description }}
475
+                                                    </i>
476
+                                                </p>
477
+                                                <br>
478
+                                                <h5 style="display: inline; margin:30px;">Formative Action's Associated
479
+                                                    Criteria: </h5>
480
+                                                <ul style="margin:30px;">
481
+                                                    @foreach ($formative_actions as $criteria)
482
+                                                        <li> <i>{{ $criteria->name }} <i></li>
483
+                                                    @endforeach
484
+                                                </ul>
485
+                                            @endif
486
+                                            <br>
487
+                                            <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
488
+                                            @if ($activity->assessment_comments != null)
489
+                                                <p style="display: inline;">{{ $activity->assessment_comments }}</p>
490
+                                            @endif
359 491
                                             <br>
360 492
                                             <hr>
493
+                                            <br>
361 494
 
495
+                                            <h4>Performance of Students by Learning Outcome</h4>
496
+                                            <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
497
+                                            <p style="display: inline;">{{ $activity->name }}
498
+                                                <strong>({{ $activity->date }})</strong>
499
+                                            </p>
500
+                                            <br>
362 501
 
502
+                                            <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
503
+                                            <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
504
+                                            </p>
505
+                                            <br>
506
+                                            <h5 style="display: inline; margin:30px;">Expected percent of students
507
+                                                achieving
508
+                                                the
509
+                                                target by learning outcome: </h5>
510
+                                            <p style="display: inline;"> <i>
511
+                                                    <?php
512
+                                                    $expected = DB::table('target_outcomes_program')
513
+                                                        ->where('program_id', $course->program_id)
514
+                                                        ->where('semester_id', $course->semester_id)
515
+                                                        ->first(); //->expected_target;
516
+                                                    if (!$expected) {
517
+                                                        $expected = 'It has not been defined in the annual plan';
518
+                                                    } else {
519
+                                                        $expected = $expected->expected_target;
520
+                                                    }
521
+                                                    ?>
522
+                                                    {{ $expected }}
523
+                                                </i>
524
+                                            </p>
525
+                                            <br>
526
+                                            <table class='table table-striped table-condensed datatable'>
527
+                                                <thead>
528
+                                                    <tr>
529
+                                                        <th>
530
+                                                            Learning Outcome
531
+                                                        </th>
532
+                                                        <th>
533
+                                                            Number of Students Assessed
534
+                                                        </th>
535
+                                                        <th>
536
+                                                            Number of students that achieved the target
537
+                                                        </th>
538
+                                                        <th>
539
+                                                            %
540
+                                                        </th>
363 541
 
542
+                                                    </tr>
543
+                                                </thead>
544
+                                                <tbody>
545
+                                                    @foreach ($activity->getOutcomeReport() as $outcome)
546
+                                                        <tr>
547
+                                                            <td>
548
+                                                                {{ $outcome->name }}
549
+                                                            </td>
550
+                                                            <td>
551
+                                                                {{ $outcome->attempted }}
552
+                                                            </td>
553
+                                                            <td>
554
+                                                                {{ $outcome->achieved }}
555
+                                                            </td>
556
+                                                            @if ($outcome->percentage >= $expected)
557
+                                                                <td class="col-md-1 success">
558
+                                                                    {{ $outcome->percentage }}%
559
+                                                                </td>
560
+
561
+                                                            @else
562
+                                                                <td class="col-md-1 danger">
563
+                                                                    {{ $outcome->percentage }}%
564
+                                                                </td>
565
+                                                            @endif
364 566
 
365 567
 
366 568
 
367
-                                        @endforeach
368
-                                    @endforeach
369 569
 
370 570
 
571
+                                                        </tr>
572
+                                                    @endforeach
573
+                                                </tbody>
574
+                                            </table>
575
+
576
+                                            <br>
577
+                                            <hr>
578
+                                        @endforeach
579
+                                    @endforeach
371 580
                                 @endforeach
372 581
                             </div>
373 582
                         </div>
@@ -378,7 +587,6 @@
378 587
                 @else
379 588
                     <h4>This program has not assessed any activity</h4>
380 589
                 @endif
381
-
382 590
             @endforeach
383 591
 
384 592
         </div>

+ 1
- 1
app/views/local/managers/pCoords/criteria.blade.php 查看文件

@@ -212,7 +212,7 @@
212 212
 
213 213
                             {{ Form::label('program_id2', 'Associated Program') }}<br><br>
214 214
 
215
-                            <input type=" hidden" id="{{ $programs[0]->name }}" name="program_id[]"
215
+                            <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
216 216
                         value="{{ $programs[0]->id }}">
217 217
 
218 218
                         <input type="checkbox" id="assoc_program_id_{{ $programs[0]->id }}" name="program_id[]"

+ 247
- 0
app/views/local/managers/pCoords/new_assessment_report.blade.php 查看文件

@@ -91,6 +91,7 @@
91 91
                             @foreach ($sections_evaluating as $index3 => $section)
92 92
                                 <h3 style="text-align: center"> Course: {{ $course->code }}
93 93
                                     {{ $course->number }}-{{ $section->section }} </h3>
94
+                                    <h4>Non Diagnostic Activities</h4>
94 95
                                 @foreach ($section->publishedActivities as $index4 => $activity)
95 96
 
96 97
                                     <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
@@ -336,6 +337,252 @@
336 337
 
337 338
 
338 339
                                 @endforeach
340
+                                <h4>Diagnostic Activities</h4>
341
+                                @foreach ($section->diagnosticActivities as $index4 => $activity)
342
+
343
+                                <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
344
+                                <p style="display: inline;">{{ $activity->name }}
345
+                                    <strong>({{ $activity->date }})</strong>
346
+                                </p>
347
+                                <br>
348
+                                <br>
349
+                                <h5 style="display: inline;">Performance Indicators: </h5>
350
+                                <?php
351
+                                Log::info($activity->rubric[0]);
352
+                                ?>
353
+                                <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
354
+                                        <?php
355
+                                        $titles = $activity->rubric[0]->getTitles();
356
+                                        ?>
357
+                                        @if (sizeof($titles) != 1)
358
+                                            @foreach ($titles as $index5 => $rubric_title)
359
+                                                @if ($index5 != $activity->rubric[0]->num_scales - 1)
360
+                                                    {{ $rubric_title->text }},
361
+                                                @else
362
+                                                    and {{ $rubric_title->text }}
363
+                                                @endif
364
+
365
+                                            @endforeach
366
+                                            )
367
+                                        @else
368
+                                            {{ $titles[0]->text }} )
369
+                                        @endif
370
+                                    </i></p>
371
+                                <br>
372
+                                <h5 style="display: inline;">Scale: </h5>
373
+                                @if ($activity->rubric[0]->max_score == 1)
374
+                                    <p style="display: inline;">1 point scale</p>
375
+                                @else
376
+                                    <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point scale
377
+                                    </p>
378
+
379
+                                @endif
380
+                                <br>
381
+                                <br>
382
+                                <h4>Performance of Students by Learning Outcome Criteria</h4>
383
+                                <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
384
+                                <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }} or
385
+                                        more</i>
386
+                                </p>
387
+                                <br>
388
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
389
+                                    target by criterion: </h5>
390
+                                <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_percentage }} %</i>
391
+                                </p>
392
+
393
+                                <br>
394
+
395
+                                <table class='table table-striped table-condensed datatable'>
396
+                                    <thead>
397
+                                        <tr>
398
+                                            <th>
399
+                                                Criterion
400
+                                            </th>
401
+                                            <th>
402
+                                                Number of Students Assessed
403
+                                            </th>
404
+                                            <th>
405
+                                                Number of students that achieved the target
406
+                                            </th>
407
+                                            <th>
408
+                                                %
409
+                                            </th>
410
+                                            <th>
411
+                                                Learning Outcomes
412
+                                            </th>
413
+                                        </tr>
414
+                                    </thead>
415
+                                    <tbody>
416
+                                        @foreach ($activity->allActivityCriterionInfo() as $index5 => $ac_criterion)
417
+                                            <tr>
418
+                                                <td> {{ $ac_criterion->name }}</td>
419
+                                                <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity->id) }}
420
+                                                </td>
421
+                                                <td>
422
+                                                    {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity->id) }}
423
+
424
+                                                </td>
425
+                                                <?php
426
+                                                
427
+                                                $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
428
+                                                $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
429
+                                                
430
+                                                $percentage = 'N/A';
431
+                                                $activity->getOutcomeReport();
432
+                                                
433
+                                                ?>
434
+                                                @if ($out_att == 0)
435
+                                                    <td class="col-md-1 danger">{{ $percentage }}</td>
436
+
437
+                                                @else
438
+                                                    <?php
439
+                                                    $percentage = round(($out_ach / $out_att) * 100, 2);
440
+                                                    ?>
441
+                                                    @if ($percentage >= $activity->rubric[0]->expected_percentage)
442
+                                                        <td class="col-md-1 success">{{ $percentage }}%</td>
443
+
444
+                                                    @else
445
+                                                        <td class="col-md-1 danger">{{ $percentage }}%</td>
446
+
447
+                                                    @endif
448
+                                                @endif
449
+                                                <td>
450
+
451
+                                                    @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
452
+
453
+                                                        <?php echo $outcome->name . "\n\n\n <br>"; ?>
454
+
455
+
456
+
457
+                                                    @endforeach
458
+
459
+
460
+                                                </td>
461
+                                            </tr>
462
+                                        @endforeach
463
+                                    </tbody>
464
+
465
+                                </table>
466
+                                <br>
467
+                                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
468
+                                <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
469
+                                @if ($formative_actions)
470
+                                    <p style="display: inline;">
471
+                                        <u>{{ $formative_actions[0]->at_text }}:
472
+                                        </u>
473
+
474
+                                        <i>{{ $formative_actions[0]->description }}
475
+                                        </i>
476
+                                    </p>
477
+                                    <br>
478
+                                    <h5 style="display: inline; margin:30px;">Formative Action's Associated
479
+                                        Criteria: </h5>
480
+                                    <ul style="margin:30px;">
481
+                                        @foreach ($formative_actions as $criteria)
482
+                                            <li> <i>{{ $criteria->name }} <i></li>
483
+
484
+                                        @endforeach
485
+                                    </ul>
486
+
487
+
488
+                                @endif
489
+                                <br>
490
+                                <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
491
+                                @if ($activity->assessment_comments != null)
492
+
493
+
494
+                                    <p style="display: inline;">{{ $activity->assessment_comments }}</p>
495
+                                @endif
496
+                                <br>
497
+                                <hr>
498
+                                <br>
499
+
500
+                                <h4>Performance of Students by Learning Outcome</h4>
501
+                                <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
502
+                                <p style="display: inline;">{{ $activity->name }}
503
+                                    <strong>({{ $activity->date }})</strong>
504
+                                </p>
505
+                                <br>
506
+                                <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
507
+                                <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
508
+                                </p>
509
+                                <br>
510
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
511
+                                    target by learning outcome: </h5>
512
+                                <p style="display: inline;"> <i>
513
+                                        <?php
514
+                                        $expected = DB::table('target_outcomes_program')
515
+                                            ->where('program_id', $course->program_id)
516
+                                            ->where('semester_id', $course->semester_id)
517
+                                            ->first();
518
+                                        if (!$expected) {
519
+                                            $expected = 'It has not been defined in the annual plan';
520
+                                        }
521
+                                        else{
522
+                                        $expected = $expected->expected_target;
523
+                                    }
524
+                                        ?>
525
+                                        {{ $expected }}
526
+                                    </i>
527
+                                </p>
528
+                                <br>
529
+                                <table class='table table-striped table-condensed datatable'>
530
+                                    <thead>
531
+                                        <tr>
532
+                                            <th>
533
+                                                Learning Outcome
534
+                                            </th>
535
+                                            <th>
536
+                                                Number of Students Assessed
537
+                                            </th>
538
+                                            <th>
539
+                                                Number of students that achieved the target
540
+                                            </th>
541
+                                            <th>
542
+                                                %
543
+                                            </th>
544
+
545
+                                        </tr>
546
+                                    </thead>
547
+                                    <tbody>
548
+                                        @foreach ($activity->getOutcomeReport() as $outcome)
549
+                                            <tr>
550
+                                                <td>
551
+                                                    {{ $outcome->name }}
552
+                                                </td>
553
+                                                <td>
554
+                                                    {{ $outcome->attempted }}
555
+                                                </td>
556
+                                                <td>
557
+                                                    {{ $outcome->achieved }}
558
+                                                </td>
559
+                                                @if ($outcome->percentage >= $expected)
560
+                                                    <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
561
+
562
+                                                @else
563
+                                                    <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
564
+
565
+                                                @endif
566
+
567
+
568
+
569
+
570
+
571
+                                            </tr>
572
+
573
+                                        @endforeach
574
+                                    </tbody>
575
+                                </table>
576
+
577
+                                <br>
578
+                                <hr>
579
+
580
+
581
+
582
+
583
+
584
+
585
+                            @endforeach
339 586
                             @endforeach
340 587
                         </div>
341 588
 

+ 251
- 0
app/views/local/managers/sCoords/new_assessment_report.blade.php 查看文件

@@ -105,6 +105,7 @@
105 105
                                         <h3 style="text-align: center"> Course: {{ $course->code }}
106 106
                                             {{ $course->number }}-{{ $section->section }} </h3>
107 107
                                     @endif
108
+                                    <h4> Non-Diagnostic Activities</h4>
108 109
                                     @foreach ($section->publishedActivities as $index4 => $activity)
109 110
 
110 111
                                         <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
@@ -354,6 +355,256 @@
354 355
 
355 356
 
356 357
                                     @endforeach
358
+                                    <h4>Diagnostic Activities</h4>
359
+                                    @foreach ($section->diagnosticActivities as $index4 => $activity)
360
+
361
+                                    <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
362
+                                    <p style="display: inline;">{{ $activity->name }}
363
+                                        <strong>({{ $activity->date }})</strong>
364
+                                    </p>
365
+                                    <br>
366
+                                    <br>
367
+                                    <h5 style="display: inline;">Performance Indicators: </h5>
368
+                                    <?php
369
+                                    Log::info($activity->rubric[0]);
370
+                                    ?>
371
+                                    <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
372
+                                            <?php
373
+                                            $titles = $activity->rubric[0]->getTitles();
374
+                                            ?>
375
+                                            @if (sizeof($titles) != 1)
376
+                                                @foreach ($titles as $index5 => $rubric_title)
377
+                                                    @if ($index5 != $activity->rubric[0]->num_scales - 1)
378
+                                                        {{ $rubric_title->text }},
379
+                                                    @else
380
+                                                        and {{ $rubric_title->text }}
381
+                                                    @endif
382
+
383
+                                                @endforeach
384
+                                                )
385
+                                            @else
386
+                                                {{ $titles[0]->text }} )
387
+                                            @endif
388
+                                        </i></p>
389
+                                    <br>
390
+                                    <h5 style="display: inline;">Scale: </h5>
391
+                                    @if ($activity->rubric[0]->max_score == 1)
392
+                                        <p style="display: inline;">1 point scale</p>
393
+                                    @else
394
+                                        <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point
395
+                                            scale
396
+                                        </p>
397
+
398
+                                    @endif
399
+                                    <br>
400
+                                    <br>
401
+                                    <h4>Performance of Students by Learning Outcome Criteria</h4>
402
+                                    <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
403
+                                    <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }} or
404
+                                            more</i>
405
+                                    </p>
406
+                                    <br>
407
+                                    <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
408
+                                        target by criterion: </h5>
409
+                                    <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_percentage }}
410
+                                            %</i>
411
+                                    </p>
412
+
413
+
414
+                                    <br>
415
+                                    <table class='table table-striped table-condensed datatable'>
416
+                                        <thead>
417
+                                            <tr>
418
+                                                <th>
419
+                                                    Criterion
420
+                                                </th>
421
+                                                <th>
422
+                                                    Number of Students Assessed
423
+                                                </th>
424
+                                                <th>
425
+                                                    Number of students that achieved the target
426
+                                                </th>
427
+                                                <th>
428
+                                                    %
429
+                                                </th>
430
+                                                <th>
431
+                                                    Learning Outcomes
432
+                                                </th>
433
+                                            </tr>
434
+                                        </thead>
435
+                                        <tbody>
436
+                                            @foreach ($activity->allActivityCriterionInfo() as $index5 => $ac_criterion)
437
+                                                <tr>
438
+                                                    <td> {{ $ac_criterion->name }}</td>
439
+                                                    <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity->id) }}
440
+                                                    </td>
441
+                                                    <td>
442
+                                                        {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity->id) }}
443
+
444
+                                                    </td>
445
+                                                    <?php
446
+                                                    
447
+                                                    $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
448
+                                                    $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
449
+                                                    
450
+                                                    $percentage = 'N/A';
451
+                                                    $activity->getOutcomeReport();
452
+                                                    
453
+                                                    ?>
454
+                                                    @if ($out_att == 0)
455
+                                                        <td class="col-md-1 danger">{{ $percentage }}</td>
456
+
457
+                                                    @else
458
+                                                        <?php
459
+                                                        $percentage = round(($out_ach / $out_att) * 100, 2);
460
+                                                        ?>
461
+                                                        @if ($percentage >= $activity->rubric[0]->expected_percentage)
462
+                                                            <td class="col-md-1 success">{{ $percentage }}%</td>
463
+
464
+                                                        @else
465
+                                                            <td class="col-md-1 danger">{{ $percentage }}%</td>
466
+
467
+                                                        @endif
468
+                                                    @endif
469
+                                                    <td>
470
+
471
+                                                        @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
472
+
473
+                                                            <?php echo $outcome->name . "\n\n\n <br>"; ?>
474
+
475
+
476
+
477
+                                                        @endforeach
478
+
479
+
480
+                                                    </td>
481
+                                                </tr>
482
+                                            @endforeach
483
+                                        </tbody>
484
+
485
+                                    </table>
486
+
487
+                                    <br>
488
+                                    <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
489
+                                    <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
490
+                                    @if ($formative_actions)
491
+                                        <p style="display: inline;"> <u>{{ $formative_actions[0]->at_text }}:
492
+                                            </u>
493
+
494
+                                            <i>{{ $formative_actions[0]->description }}
495
+                                            </i>
496
+                                        </p>
497
+                                        <br>
498
+                                        <h5 style="display: inline; margin:30px;">Formative Action's Associated
499
+                                            Criteria: </h5>
500
+                                        <ul style="margin:30px;">
501
+                                            @foreach ($formative_actions as $criteria)
502
+                                                <li> <i>{{ $criteria->name }} <i></li>
503
+
504
+                                            @endforeach
505
+                                        </ul>
506
+
507
+
508
+
509
+                                    @endif
510
+                                    <br>
511
+                                    <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
512
+                                    @if ($activity->assessment_comments != null)
513
+
514
+
515
+                                        <p style="display: inline;">{{ $activity->assessment_comments }}</p>
516
+                                    @endif
517
+                                    <hr>
518
+                                    <br>
519
+
520
+
521
+
522
+                                    <h4>Performance of Students by Learning Outcome</h4>
523
+                                    <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
524
+                                    <p style="display: inline;">{{ $activity->name }}
525
+                                        <strong>({{ $activity->date }})</strong>
526
+                                    </p>
527
+                                    <br>
528
+                                    <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
529
+                                    <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
530
+                                    </p>
531
+                                    <br>
532
+                                    <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
533
+                                        target by learning outcome: </h5>
534
+                                    <p style="display: inline;"> <i>
535
+                                            <?php
536
+                                            $expected = DB::table('target_outcomes_program')
537
+                                                ->where('program_id', $course->program_id)
538
+                                                ->where('semester_id', $course->semester_id)
539
+                                                ->first(); //->expected_target;
540
+                                            if (!$expected) {
541
+                                                $expected = 'It has not been defined in the annual plan';
542
+                                            }
543
+                                            else{
544
+                                        $expected = $expected->expected_target;
545
+                                    }
546
+                                            ?>
547
+                                            {{ $expected }}
548
+                                        </i>
549
+                                    </p>
550
+                                    <br>
551
+                                    <table class='table table-striped table-condensed datatable'>
552
+                                        <thead>
553
+                                            <tr>
554
+                                                <th>
555
+                                                    Learning Outcome
556
+                                                </th>
557
+                                                <th>
558
+                                                    Number of Students Assessed
559
+                                                </th>
560
+                                                <th>
561
+                                                    Number of students that achieved the target
562
+                                                </th>
563
+                                                <th>
564
+                                                    %
565
+                                                </th>
566
+
567
+                                            </tr>
568
+                                        </thead>
569
+                                        <tbody>
570
+                                            @foreach ($activity->getOutcomeReport() as $outcome)
571
+                                                <tr>
572
+                                                    <td>
573
+                                                        {{ $outcome->name }}
574
+                                                    </td>
575
+                                                    <td>
576
+                                                        {{ $outcome->attempted }}
577
+                                                    </td>
578
+                                                    <td>
579
+                                                        {{ $outcome->achieved }}
580
+                                                    </td>
581
+                                                    @if ($outcome->percentage >= $expected)
582
+                                                        <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
583
+
584
+                                                    @else
585
+                                                        <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
586
+
587
+                                                    @endif
588
+
589
+
590
+
591
+
592
+
593
+                                                </tr>
594
+
595
+                                            @endforeach
596
+                                        </tbody>
597
+                                    </table>
598
+
599
+                                    <br>
600
+                                    <hr>
601
+
602
+
603
+
604
+
605
+
606
+
607
+                                @endforeach
357 608
                                 @endforeach
358 609
 
359 610
 

+ 745
- 314
app/views/local/managers/shared/annual-plans.blade.php
文件差异内容过多而无法显示
查看文件


+ 460
- 67
app/views/local/managers/shared/annual_report.blade.php 查看文件

@@ -25,7 +25,6 @@
25 25
                 <option value='0'> Nothing Selected</option>
26 26
                 @foreach ($annual_plans as $an_plan)
27 27
                     <option value={{ $an_plan->annual_id }}>Plan {{ $an_plan->academic_year }}</option>
28
-
29 28
                 @endforeach
30 29
             </select>
31 30
             <br>
@@ -53,20 +52,27 @@
53 52
                     </div>
54 53
 
55 54
                     <ul id="levelTabs" class="nav nav-tabs" role="tablist">
56
-
55
+                        <li role = "presentation" id = 'transformative_for_outcome'>
56
+                            <a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab" aria-expanded="true">Transformative Actions</a>
57
+                        </li>
57 58
                     </ul>
58 59
                     <div id="allLists" class="tab-content">
60
+                        <div role="tabpanel" class="tab-pane active" id="transformative_actions">
59 61
 
62
+                        </div>
60 63
                     </div>
61
-                    <!-- <div class="table-responsive">
62
-                    <table class="table table-striped table-condensed datatable" style="table-layout: fixed ; width : 100%">
63
-                      <thead><tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr></thead>
64
-                      <tbody>
65
-                      </tbody>
64
+                    
66 65
 
67
-                    </table>
68 66
                     
69
-                </div>-->
67
+                    <!-- <div class="table-responsive">
68
+                        <table class="table table-striped table-condensed datatable" style="table-layout: fixed ; width : 100%">
69
+                          <thead><tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr></thead>
70
+                          <tbody>
71
+                          </tbody>
72
+
73
+                        </table>
74
+                        
75
+                    </div>-->
70 76
 
71 77
                 </div>
72 78
             </div>
@@ -80,6 +86,44 @@
80 86
         </div>
81 87
 
82 88
     </div>
89
+    <div class="modal fade" id="modal-status-trans">
90
+        <div class="modal-dialog modal-lg">
91
+            <div class="modal-content">
92
+                <div class="modal-header">
93
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
94
+                            aria-hidden="true">&times;</span></button>
95
+                    <h3 class="modal-title"></h3>
96
+                </div>
97
+                <div class="modal-body">
98
+                   <h5 id="was_it_implemented"> </h5>
99
+              <label class="radio-inline">
100
+                  <input type="radio"  name="implemented" value = "1">Yes</label>
101
+              <label class="radio-inline">
102
+                  <input type="radio" name="implemented" value = "0">No</label>
103
+                  <br>
104
+                <div id='useful_radio_div'>
105
+                    <h5>Was this transformative action helpful to achieve the learning expectation?</h5>
106
+                <label class="radio-inline">
107
+                    <input type="radio"  name="useful" value = "1">Yes</label>
108
+                <label class="radio-inline">
109
+                    <input type="radio" name="useful" value = "0">No</label>
110
+                </div>
111
+                <br>
112
+        <div id='comment_div'>
113
+            <label id="implement_textarea" for='comments'></label>
114
+            <textarea  class="form-control" id='comments'>
115
+            </textarea>
116
+        </div>
117
+            
118
+   
119
+              
120
+            </div>
121
+            <div class='modal-footer'>
122
+                <button type="button" class="btn btn-secondary" data-dismiss="modal" >Cancel</button>
123
+                <button type="button" class="btn btn-primary" id ="save_transformative_info" onclick ='saveTransReport()'>Save</button>
124
+            </div><!-- /.modal-content -->
125
+        </div><!-- /.modal-dialog -->
126
+    </div><!-- /.modal -->
83 127
     <script>
84 128
         function nextChar(c) {
85 129
             return String.fromCharCode(c.charCodeAt(0) + 1);
@@ -90,23 +134,241 @@
90 134
             // --------------------------------------------------------------------------
91 135
             // Page load
92 136
             // --------------------------------------------------------------------------
93
-
137
+            $('#comment_div').hide();
138
+            $('input[name="implemented"]').change(function(){
139
+                //was implemented
140
+                if(!parseInt($(this).val())){
141
+                    $('#useful_radio_div').hide();
142
+                    $('#comment_div').show();
143
+                    $('#comments').val(' ');
144
+                    $('#implement_textarea').html("Explain briefly why this transformative action was not implemented");
145
+                    }
146
+                else{
147
+                    $('#useful_radio_div').show();
148
+                    $('#comment_div').show();
149
+                    $('#implement_textarea').html("Explain briefly details about the implementation of this transformative action");
150
+                   
151
+                }
152
+            })
94 153
             // Hide accordion panel contents by default
95 154
             $('.panel-group .panel-body').hide();
96 155
 
97 156
             $('#outcome-display').parent().hide();
98 157
 
99
-            // --------------------------------------------------------------------------
100
-            // Functions
101
-            // --------------------------------------------------------------------------
158
+            
159
+    
102 160
 
103
-            // --------------------------------------------------------------------------
104
-            // Events
105
-            // --------------------------------------------------------------------------
161
+        });
106 162
 
107
-            // When list item is clicked, load corresponding info
163
+        function draw_comment_section(typ_semester_outcome_id, outcome_comments){
164
+            $('#levelTabs').append('<li role = "presentation" id = "comments_for_outcome">'+
165
+                            '<a data-toggle="tab" id="a_for_ta_outcome" href="#comments_outcome" role="tab" >Comments for Outcome</a>'+
166
+                            '</li>');
167
+            $('#allLists').append('<div role="tabpanel" class="tab-pane" data-typ-semester-outcome-id = "'+typ_semester_outcome_id+'" id="comments_outcome"></div>');
168
+            button_for_adding_comments = $('<button>', {
169
+                'class':'btn btn-secondary',
170
+                'id':'add_comments_button',
171
+                'style':'float: right',
172
+                'onclick': 'add_comments_to_plan()'
173
+            }).html("<span class='glyphicon glyphicon-plus'></span> Add Comments");
174
+            $('#comments_outcome').append('<h3>Comments</h3>')
175
+        if(outcome_comments.length){
176
+            table_for_comments = $('<table>',{
177
+               'class':'table table-striped table-condensed datatable',
178
+               'id':'table_for_comments'
179
+            }).html('<thead><th>Comments</th><th>Edit or Delete</th></thead><tbody></tbody>');
180
+            table_for_comments.appendTo('#comments_outcome');
181
+            table_for_comments = table_for_comments.DataTable();
182
+            $.each(outcome_comments, function(index, comment){
183
+                
184
+                comment_td = '<div id="comments_id_'+comment.id+'">'+comment.comments+'</div>';
185
+                
186
+                inputEdit = $('<input>', {
187
+                                    'type': 'button',
188
+                                    'class': 'btn btn-secondary',
189
+                                    'onclick': 'add_comments_to_plan('+comment.id+')',
190
+                                    'id': 'edit_button_comment_' + comment.id,
191
+                                    'value': 'Edit'
192
+                                }).html('Edit');
193
+                inputDelete = $('<input>', {
194
+                                    'type': 'button',
195
+                                    'class': 'btn btn-primary',
196
+                                    'style': 'display: inline',
197
+                                    'onclick': 'deleteCommentsFromOutcome('+comment.id+')',
198
+                                    'value': 'Delete'
199
+            })
200
+            div = $('<div>');
201
+                                div.append(inputEdit);
202
+                                div.append(inputDelete);
203
+                                table_for_comments.row.add([
204
+                                    comment_td,
205
+                                    div.html()
206
+
207
+                                ]).draw();
208
+         });
209
+         
210
+        }
108 211
 
109
-        });
212
+            $('#comments_outcome').append('<hr>');
213
+            $('#comments_outcome').append(button_for_adding_comments);
214
+
215
+
216
+
217
+           
218
+       
219
+
220
+        
221
+        }
222
+
223
+        function add_comments_to_plan(edit_id = null){
224
+            $('#add_comments_button').hide();
225
+            div_for_inputs = $('<div>', {
226
+                'id':'add_comment_div'
227
+            });
228
+            textarea = $('<textarea>',{
229
+                'class':'form-control',
230
+                'data-comment-id':edit_id,
231
+                'id':'comment_textbox'
232
+            });
233
+            if(edit_id){
234
+            textarea.val($("#comments_id_"+edit_id).html());
235
+            }
236
+            save_button = $('<button>', {
237
+                'class':'btn btn-primary',
238
+                'onclick':'saveComment()',
239
+                'style':'float: right'
240
+            }).html('Save');
241
+            $('#comments_outcome').append(div_for_inputs);
242
+            div_for_inputs.append('<h5>Add new comment</h5>');
243
+            div_for_inputs.append(textarea);
244
+            div_for_inputs.append(save_button);
245
+
246
+        }
247
+
248
+        function saveComment(){
249
+            typ_outcome_semester_id = $("#comments_outcome").data('typ-semester-outcome-id');
250
+            comment_area = $('#comment_textbox');
251
+
252
+            $.post(
253
+                "{{URL::action('AnnualPlansController@addCommentsToOutcome')}}",
254
+                {
255
+                    typ_outcome_semester_id:typ_outcome_semester_id,
256
+                    comments:comment_area.val(),
257
+                    edit_id:comment_area.data('comment-id')
258
+                },
259
+                function(edit_id){
260
+                    $('#add_comment_div').remove();
261
+                    $('#add_comments_button').show();
262
+                    if($('#comments_id_'+edit_id).length){
263
+                        $('#comments_id_'+edit_id).html(comment_area.val());
264
+                    }
265
+                    else{
266
+                        table_for_comments = $('#table_for_comments').DataTable();
267
+                        comment_td = '<div id="comments_id_'+edit_id+'">'+comment_area.val()+'</div>';
268
+                
269
+                inputEdit = $('<input>', {
270
+                                    'type': 'button',
271
+                                    'class': 'btn btn-secondary',
272
+                                    'onclick': 'add_comments_to_plan('+edit_id+')',
273
+                                    'id': 'edit_button_comment_' + edit_id,
274
+                                    'value': 'Edit'
275
+                                }).html('Edit');
276
+                inputDelete = $('<input>', {
277
+                                    'type': 'button',
278
+                                    'class': 'btn btn-primary',
279
+                                    'style': 'display: inline',
280
+                                    'onclick': 'deleteCommentsFromOutcome('+edit_id+')',
281
+                                    'value': 'Delete'
282
+            })
283
+            div = $('<div>');
284
+                                div.append(inputEdit);
285
+                                div.append(inputDelete);
286
+                                table_for_comments.row.add([
287
+                                    comment_td,
288
+                                    div.html()
289
+
290
+                                ]).draw();
291
+                    }
292
+                }
293
+            )
294
+            
295
+        }
296
+
297
+        function deleteCommentsFromOutcome(id){
298
+            $.post(
299
+                "{{URL::action('AnnualPlansController@deleteCommentsFromOutcome')}}",
300
+                {id:id},
301
+                function(){
302
+                    $('#comments_id_'+id).parent().parent().remove();
303
+                    
304
+                }
305
+            )
306
+        }
307
+
308
+
309
+
310
+        // Create everything 
311
+
312
+        function  draw_transformative_actions(transforming_actions, semester_id){
313
+            if(!transforming_actions.length){
314
+                $("#transformative_for_outcome").hide();
315
+            }
316
+            else{
317
+                $('#levelTabs').prepend('<li role = "presentation" id = "transformative_for_outcome">'+
318
+                            '<a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab" >Transformative Actions to Outcome</a>'+
319
+                            '</li>');
320
+                $('#allLists').prepend('<div role="tabpanel" class="tab-pane" id="transformative_actions"></div>');
321
+                        
322
+                $('#transformative_actions').html('<h3>Tranformative actions for Learning Outcome')
323
+                $.each(transforming_actions, function(index, trans_action){
324
+                    div = $("<div>", {
325
+                        'id':'div_trans_id_'+trans_action.trans_id
326
+                    }).html('<p><strong>'+(index+1)+'. '+trans_action.at_text+': </strong>'+trans_action.description+'</p>'+
327
+                    '<p><strong>Category: </strong> '+trans_action.type_of_TA+'</p>');
328
+                    div.append('<label>Results: </label>')
329
+                    input_results = $("<textarea>", {
330
+                        'class':'form-control',
331
+                        'id':'results_for_'+trans_action.trans_id
332
+                    });
333
+                    div.append(input_results)
334
+
335
+                    div.append('<h5>Was this transformative action helpful to achieve the learning expectation?</h5>'+
336
+                    '<label class="radio-inline">'+
337
+                    '<input type="radio"  name="useful_for_'+trans_action.trans_id+'" value = "1">Yes</label>'+
338
+                    '<label class="radio-inline">'+
339
+                    '<input type="radio" name="useful_for_'+trans_action.trans_id+'" value = "0">No</label>');
340
+                    comments = $('<textarea>',{
341
+                        'id':'comments_for_'+trans_action.trans_id,
342
+                        'class':'form-control'
343
+                    });
344
+                    div.append('<br><label>Explain briefly details about the implementation</label>');
345
+                    div.append(comments);
346
+                    
347
+                    button = $('<button>',{
348
+                        "type":"button",
349
+                        "class":"btn btn-primary",
350
+                        "onclick":'saveTransReport('+trans_action.trans_id+', '+semester_id+')',
351
+                        'style':'float: right'
352
+          
353
+                    }).html('Save');
354
+                    div.append('<br>');
355
+                    div.append(button);
356
+                    div.append('<br>');
357
+                    div.append('<hr>');
358
+
359
+                    $('#transformative_actions').append(div);
360
+
361
+                    $('#results_for_'+trans_action.trans_id).val(trans_action.results);
362
+                    $('#comments_for_'+trans_action.trans_id).val(trans_action.comments);
363
+                    $('input[name="useful_for_'+trans_action.trans_id+'"][value="'+trans_action.it_was_useful + '"]').prop('checked', true);
364
+
365
+                
366
+
367
+
368
+
369
+                })
370
+            }
371
+        }
110 372
 
111 373
         function fetchEverything(li) {
112 374
             var outcome_id = $(li).data('outcome-id');
@@ -131,11 +393,10 @@
131 393
                         $('#allLists').empty();
132 394
                         $('#levelTabs').empty();
133 395
                         $('.no-outcome').hide();
134
-                        if(outcome.outcome_program_goal){
396
+                        if (outcome.outcome_program_goal) {
135 397
                             outcome.outcome_program_goal = outcome.outcome_program_goal.expected_target;
136
-                        }
137
-                        else{
138
-                            outcome.outcome_program_goal ='It has not been defined';
398
+                        } else {
399
+                            outcome.outcome_program_goal = 'It has not been defined';
139 400
                         }
140 401
                         var outcomeHTML = "<h4>Performance of Students by Learning Outcome</h4>" +
141 402
                             '<h5 style = "display: inline; margin:30px;">Target learning by learning outcome: </h5>' +
@@ -164,13 +425,16 @@
164 425
                             '<th>Percentage</th>' +
165 426
                             '<th>Outcome Achieved</th>' +
166 427
                             '</tr></thead><tbody></tbody>');
428
+                        first_objective_id = outcome.objectives[0].id;
167 429
                         $.each(outcome.objectives, function(index, objective) {
168 430
 
169 431
                             li = $('<li/>', {
170
-                                'role': 'presentation'
432
+                                'role': 'presentation',
433
+                                'id':'li_for_'+objective.id
171 434
                             });
172 435
                             a = $('<a/>', {
173 436
                                 'data-toggle': 'tab',
437
+                                'id': 'a_for_'+objective.id,
174 438
                                 'href': '#' + objective.id,
175 439
                                 'role': 'tab'
176 440
                             }).html('Objective ' + (index + 1));
@@ -188,6 +452,12 @@
188 452
 
189 453
                             div.appendTo($('#allLists'))
190 454
 
455
+                            div.append(
456
+                                            '<p>The following results are from the courses in the selected semester with the focused criteria in the selected annual plan</p>'
457
+                                        );
458
+
459
+                            
460
+
191 461
 
192 462
                             if (objective.courses) {
193 463
                                 $.each(objective.courses, function(index, course_code) {
@@ -203,22 +473,24 @@
203 473
 
204 474
                                             }
205 475
                                             wholeDict[student.student_id][
206
-                                                "criteria_attempted"] += student
476
+                                                    "criteria_attempted"
477
+                                                ] += student
207 478
                                                 .criteria_attempted;
208 479
                                             wholeDict[student.student_id][
209
-                                                "criteria_achieved"] += student
480
+                                                    "criteria_achieved"
481
+                                                ] += student
210 482
                                                 .criteria_achieved;
211 483
 
212 484
                                         });
213
-                                        div.append(
485
+                                        /*div.append(
214 486
                                             '<p>The following results are from the courses in the selected semester with the focused criteria in the selected annual plan</p>'
215
-                                            );
487
+                                        );*/
216 488
                                         table = $('<table/>', {
217 489
                                             'class': 'table table-striped table-condensed datatable'
218 490
                                         }).html('<thead><th>Criterion</th><th>' +
219 491
                                             'Number of Students Assessed </th>' +
220 492
                                             '<th>Number of students that achieved the target</th></thead>'
221
-                                            );
493
+                                        );
222 494
                                         tbody = $('<tbody/>')
223 495
                                         $.each(course_code.criteria, function(index, criterion) {
224 496
 
@@ -232,27 +504,50 @@
232 504
                                             tbody.append(tr);
233 505
                                         });
234 506
                                         table.append(tbody);
235
-                                        Course_and_transformative = '<h3>' + course_code.code + ' ' +
507
+                                        Course_section = '<h3>' + course_code.code + ' ' +
236 508
                                             course_code.number + '</h3><hr>';
509
+                                            
510
+                                        div.append(Course_section)
511
+                                        div.append('<h4> Criteria Assessed in '+course_code.code+' '+course_code.number+'</h4>')
512
+                                        div.append(table);
237 513
                                         if (course_code.transforming_actions.length) {
238
-                                            Course_and_transformative +=
239
-                                                '<h5> This course was tied to the following transformative actions</h5>';
240
-                                            Course_and_transformative += '<ol>';
514
+                                             table_for_transformative_actions = $('<table>',{
515
+                                                'class': 'table table-striped table-condensed datatable'
516
+                                             }).html('<thead><th>Transformative Actions Proposed in Annual Plan</th>' +
517
+                                            '<th>Follow up </th>' +
518
+                                            '</thead>'
519
+                                        );
520
+                                        tbody_for_transformative_actions = $('<tbody>');
521
+                                            
241 522
                                             $.each(course_code.transforming_actions, function(index,
242 523
                                                 transformative_action) {
243
-                                                Course_and_transformative += '<li><p><strong>' +
244
-                                                    transformative_action.at_text +
245
-                                                    '</strong>: ' + transformative_action
246
-                                                    .description + '</p></li>'
524
+
525
+                                                button_for_followup = $('<button>',{
526
+                                                    'class':'btn btn-secondary',
527
+                                                    'onclick':'give_follow_up_questions('+transformative_action.id+', "'+outcome.semester_info.code+'", '+outcome.semester_info.id+')'
528
+                                                }).html('Follow Up Questions');
529
+                                                table_row = "<tr>"+
530
+                                                '<td><p><strong>'+transformative_action.at_text +': </strong>'+
531
+                                                transformative_action.description+'</p></td>'+
532
+                                                '<td>'+button_for_followup.prop('outerHTML')+'</td></tr>';
533
+
534
+                                                tbody_for_transformative_actions.append(table_row)
535
+                                                
536
+                                                
247 537
                                             })
538
+                                            table_for_transformative_actions.append(tbody_for_transformative_actions);
539
+                                            div.append('<hr><h4>Transformative actions for '+course_code.code+' '+course_code.number+'</h4>')
540
+                                            div.append(table_for_transformative_actions);
541
+                                            //table_for_transformative_actions.DataTable();
248 542
                                         }
249 543
 
250
-                                        div.append(Course_and_transformative)
251
-                                        div.append(table);
544
+                                        
252 545
                                         table.DataTable();
253 546
 
254 547
 
255 548
                                     }
549
+    
550
+                                    
256 551
 
257 552
 
258 553
                                 })
@@ -268,6 +563,11 @@
268 563
 
269 564
 
270 565
                         })
566
+
567
+                        draw_transformative_actions(outcome.transforming_actions, outcome.semester_info.id)
568
+                        draw_comment_section(typ_semester_outcome_id, outcome.comments);
569
+                        
570
+                        //$('#a_for_'+first_objective_id).click();
271 571
                         theArray = [];
272 572
 
273 573
                         $('#tableOutcome').html(tableStudent);
@@ -326,6 +626,10 @@
326 626
 
327 627
 
328 628
 
629
+
630
+
631
+
632
+
329 633
                         /* table.row.add([
330 634
                               objectivesHTML,
331 635
                               courseshtml,
@@ -353,6 +657,87 @@
353 657
 
354 658
         }
355 659
 
660
+        function give_follow_up_questions(trans_id, semester_code, semester_id){
661
+        
662
+
663
+            $.ajax({
664
+                type: 'POST',
665
+                url: "{{ URL::action('TransformativeActionsController@fetchStatus') }}",
666
+                data: {
667
+                    trans_id:trans_id,
668
+                    semester_id:semester_id
669
+                },
670
+                success: function(transformative_action_with_status) {
671
+                    transformative_action = transformative_action_with_status[0];
672
+
673
+                    $('.modal-title').html('<strong>'+transformative_action.at_text+'</strong>: '+transformative_action.description);
674
+                    
675
+                   
676
+                    $('input[name="implemented"]').prop('checked',false);
677
+                    $('input[name="useful"]').prop('checked',false);
678
+                    $('#comments').val(' ');
679
+                    $('#useful_radio_div').hide();
680
+                    $('#comment_div').hide();
681
+                    
682
+                    if(transformative_action['status']){
683
+                        transformative_action['status'].accomplished;
684
+                        $('input[name="implemented"][value="'+ transformative_action['status'].accomplished + '"]').prop('checked', true);
685
+                        if(transformative_action['status'].accomplished){
686
+                        $('#useful_radio_div').show();
687
+                        $('input[name="useful"][value="'+ transformative_action['status'].it_was_useful + '"]').prop('checked', true);
688
+                        }
689
+                        $('#comment_div').show();
690
+                        $('#comments').val(transformative_action['status'].comments);
691
+                        
692
+                    }
693
+
694
+                    $('#was_it_implemented').html('Was this transformative action implemented during Semester '+semester_code);
695
+
696
+
697
+
698
+                    $('#modal-status-trans').modal();
699
+                    $('#save_transformative_info').attr('onclick', 'saveTransReport('+trans_id+','+semester_id+',"modal")');
700
+
701
+                },
702
+                async: true
703
+            });
704
+
705
+        }
706
+
707
+        function saveTransReport(trans_id, semester_id, type_of_input){
708
+            if(type_of_input=='modal'){
709
+                comments = $('#comments').val();
710
+                accomplished = parseInt($('input[name="implemented"]:checked').val());
711
+                if(accomplished)
712
+                was_it_useful = $('input[name="useful"]:checked').val();
713
+                else was_it_useful =0;
714
+                results = "";
715
+            }
716
+            else{
717
+                comments = $('#comments_for_'+trans_id).val();
718
+                accomplished = 1;
719
+                was_it_useful = $('input[name="useful_for_'+trans_id+'"]:checked').val();
720
+                results = $('#results_for_'+trans_id).val();
721
+            }
722
+
723
+            $.post(
724
+                "{{URL::action('TransformativeActionsController@saveTransStatus')}}",
725
+                {
726
+                    semester_id:semester_id,
727
+                    trans_id:trans_id,
728
+                    results:results,
729
+                    comments:comments,
730
+                    accomplished:accomplished,
731
+                    was_it_useful:was_it_useful,
732
+                },
733
+                function(message){
734
+                    alert(message);
735
+                }
736
+            )
737
+        }
738
+
739
+
740
+
356 741
         function posttoTransAnnual(annual_id, selectTransId, typ_course_id) {
357 742
             ta = $("#" + selectTransId).val();
358 743
             old_ta = $("#" + selectTransId).data('old-TA');
@@ -526,39 +911,47 @@
526 911
                         'class': 'list-group',
527 912
                         'id': 'list'
528 913
                     });
529
-                    if(json.outcomes.first){
530
-                    header5 = $('<h5/>', {
531
-                        'style': "padding-left: 10px"
532
-                    }).html("First Semester");
533
-                    div.append(header5);
534
-                    list = '';
535
-                    for (outcome in json.outcomes.first) {
536
-                        list +=
537
-                            "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
538
-                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"' data-semester-id = '" + json.allSemesterOrder.first.id +
539
-                            "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" + json
540
-                            .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[outcome]
541
-                            .name + " </li>";
914
+                    if (json.outcomes.first) {
915
+                        header5 = $('<h5/>', {
916
+                            'style': "padding-left: 10px"
917
+                        }).html("First Semester");
918
+                        div.append(header5);
919
+                        list = '';
920
+                        for (outcome in json.outcomes.first) {
921
+                            list +=
922
+                                "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
923
+                                json.annual_plans.id + "' data-typ-semester-outcome-id ='" + json.outcomes.first[
924
+                                    outcome].typ_semester_outcome_id + "' data-semester-id = '" + json.allSemesterOrder
925
+                                .first.id +
926
+                                "' data-outcome-id='" + json.outcomes.first[outcome].id + "' data-outcome-name ='" +
927
+                                json
928
+                                .outcomes.first[outcome].name + "' class='list-group-item' >" + json.outcomes.first[
929
+                                    outcome]
930
+                                .name + " </li>";
542 931
 
932
+                        }
933
+                        div.append(list);
543 934
                     }
544
-                    div.append(list);
545
-                    }
546
-                    if(json.outcomes.second){
547
-                    header4 = $('<h5/>', {
548
-                        'style': "padding-left: 10px"
549
-                    }).html("Second Semester");
550
-                    div.append(header4);
551
-                    list = '';
552
-                    for (outcome in json.outcomes.second) {
553
-                        list +=
554
-                            "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
555
-                            json.annual_plans.id + "' data-typ-semester-outcome-id ='"+json.outcomes.first[outcome].typ_semester_outcome_id+"'data-semester-id = '" + json.allSemesterOrder.second.id +
556
-                            "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" + json
557
-                            .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
558
-                                outcome].name + " </li>";
935
+                    if (json.outcomes.second) {
936
+                        header4 = $('<h5/>', {
937
+                            'style': "padding-left: 10px"
938
+                        }).html("Second Semester");
939
+                        div.append(header4);
940
+                        list = '';
941
+                        for (outcome in json.outcomes.second) {
942
+                            list +=
943
+                                "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '" +
944
+                                json.annual_plans.id + "' data-typ-semester-outcome-id ='" + json.outcomes.second[
945
+                                    outcome].typ_semester_outcome_id + "'data-semester-id = '" + json.allSemesterOrder
946
+                                .second.id +
947
+                                "' data-outcome-id='" + json.outcomes.second[outcome].id + "' data-outcome-name ='" +
948
+                                json
949
+                                .outcomes.second[outcome].name + "' class='list-group-item' >" + json.outcomes.second[
950
+                                    outcome].name + " </li>";
559 951
 
952
+                        }
953
+                        div.append(list);
560 954
                     }
561
-                    div.append(list);}
562 955
                     html = div[0].innerHTML;
563 956
 
564 957
                     $("#allOutcomes").html(div[0].innerHTML);

+ 1
- 0
app/views/local/professors/course.blade.php 查看文件

@@ -89,6 +89,7 @@
89 89
                         <td>{{ date('M d, Y', strtotime($activity->updated_at)) }}</td>
90 90
                         <td>
91 91
                             @if($activity->o_att_array)
92
+                            <?php Log::info($activity->id);?>
92 93
                                 <span class="glyphicon glyphicon-ok"></span>
93 94
                             @endif
94 95
                         </td>

+ 258
- 3
app/views/local/professors/new_assessment_report.blade.php 查看文件

@@ -97,9 +97,7 @@
97 97
                         @foreach ($sections_evaluating as $index3 => $section)
98 98
                             <h3 style="text-align: center"> Course: {{ $course->code }}
99 99
                                 {{ $course->number }}-{{ $section->section }}</h3>
100
-                            <?php
101
-                            Log::info($section->publishedActivities);
102
-                            ?>
100
+                                <h4> Non-diagnostic Activities</h4>
103 101
                             @foreach ($section->publishedActivities as $index4 => $activity)
104 102
 
105 103
                                 <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
@@ -355,6 +353,263 @@
355 353
 
356 354
 
357 355
                             @endforeach
356
+                            <h4>Diagnostic Activities</h4>
357
+                            @foreach ($section->diagnosticActivities as $index4 => $activity)
358
+
359
+                                <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5>
360
+                                <p style="display: inline;">{{ $activity->name }}
361
+                                    <strong>({{ $activity->date }})</strong>
362
+                                </p>
363
+                                <br>
364
+                                <br>
365
+                                <h5 style="display: inline;">Performance Indicators: </h5>
366
+                                <?php
367
+                                Log::info($activity->rubric[0]);
368
+                                ?>
369
+                                <p style="display: inline;"><i>{{ $activity->rubric[0]->num_scales }} (
370
+                                        <?php
371
+                                        $titles = $activity->rubric[0]->getTitles();
372
+                                        ?>
373
+                                        @if (sizeof($titles) != 1)
374
+                                            @foreach ($titles as $index5 => $rubric_title)
375
+                                                @if ($index5 != $activity->rubric[0]->num_scales - 1)
376
+                                                    {{ $rubric_title->text }},
377
+                                                @else
378
+                                                    and {{ $rubric_title->text }}
379
+                                                @endif
380
+
381
+                                            @endforeach
382
+                                            )
383
+                                        @else
384
+                                            {{ $titles[0]->text }} )
385
+                                        @endif
386
+                                    </i></p>
387
+                                <br>
388
+                                <h5 style="display: inline;">Scale: </h5>
389
+                                @if ($activity->rubric[0]->max_score == 1)
390
+
391
+                                    <p style="display: inline;">1 point scale</p>
392
+                                @else
393
+                                    <p style="display: inline;">1-{{ $activity->rubric[0]->max_score }} point scale</p>
394
+
395
+                                @endif
396
+                                <br>
397
+                                <br>
398
+                                <h4>Performance of Students by Learning Outcome Criteria</h4>
399
+                                <h5 style="display: inline; margin:30px;">Target by criterion: </h5>
400
+                                <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_points }} or more</i>
401
+                                </p>
402
+                                <br>
403
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the target
404
+                                    by criterion: </h5>
405
+                                <p style="display: inline;"> <i>{{ $activity->rubric[0]->expected_percentage }} %</i>
406
+                                </p>
407
+
408
+                                <br>
409
+
410
+
411
+                                <table class='table table-striped table-condensed datatable'>
412
+                                    <thead>
413
+                                        <tr>
414
+                                            <th>
415
+                                                Criterion
416
+                                            </th>
417
+                                            <th>
418
+                                                Number of Students Assessed
419
+                                            </th>
420
+                                            <th>
421
+                                                Number of students that achieved the target
422
+                                            </th>
423
+                                            <th>
424
+                                                %
425
+                                            </th>
426
+                                            <th>
427
+                                                Learning Outcomes
428
+                                            </th>
429
+                                        </tr>
430
+                                    </thead>
431
+                                    <tbody>
432
+                                        @foreach ($activity->allActivityCriterionInfo() as $index5 => $ac_criterion)
433
+                                            <tr>
434
+                                                <td> {{ $ac_criterion->name }}</td>
435
+                                                <td>{{ Criterion::students_attempted($ac_criterion->criterion_id, $activity->id) }}
436
+                                                </td>
437
+                                                <td>
438
+                                                    {{ Criterion::students_achieved($ac_criterion->criterion_id, $activity->id) }}
439
+
440
+                                                </td>
441
+                                                <?php
442
+                                                
443
+                                                $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
444
+                                                $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
445
+                                                
446
+                                                $percentage = 'N/A';
447
+                                                $activity->getOutcomeReport();
448
+                                                
449
+                                                ?>
450
+
451
+                                                @if ($out_att == 0)
452
+                                                    <td class="col-md-1 danger">{{ $percentage }}</td>
453
+
454
+                                                @else
455
+                                                    <?php
456
+                                                    $percentage = round(($out_ach / $out_att) * 100, 2);
457
+                                                    ?>
458
+                                                    @if ($percentage >= $activity->rubric[0]->expected_percentage)
459
+                                                        <td class="col-md-1 success">{{ $percentage }}%</td>
460
+
461
+                                                    @else
462
+                                                        <td class="col-md-1 danger">{{ $percentage }}%</td>
463
+
464
+                                                    @endif
465
+
466
+
467
+
468
+                                                @endif
469
+
470
+
471
+
472
+                                                <td>
473
+
474
+
475
+                                                    @foreach (Criterion::outcomes($ac_criterion->criterion_id) as $index6 => $outcome)
476
+
477
+                                                        <?php echo $outcome->name . "\n\n\n <br>"; ?>
478
+
479
+
480
+
481
+                                                    @endforeach
482
+
483
+
484
+                                                </td>
485
+                                            </tr>
486
+                                        @endforeach
487
+                                    </tbody>
488
+
489
+                                </table>
490
+                                <br>
491
+                                <h5 style="display: inline; margin:30px;">Formative Actions: </h5>
492
+                                <?php $formative_actions = $activity->formativeActionsWithCriteria(); ?>
493
+                                @if ($formative_actions)
494
+                                    <p style="display: inline;"> <u>{{ $formative_actions[0]->at_text }}:
495
+                                        </u>
496
+
497
+                                        <i>{{ $formative_actions[0]->description }}
498
+                                        </i>
499
+                                    </p>
500
+                                    <br>
501
+                                    <h5 style="display: inline; margin:30px;">Formative Action's Associated
502
+                                        Criteria: </h5>
503
+                                    <ul style="margin:30px;">
504
+                                        @foreach ($formative_actions as $criteria)
505
+                                            <li> <i>{{ $criteria->name }} <i></li>
506
+
507
+                                        @endforeach
508
+                                    </ul>
509
+                                @endif
510
+                                <br>
511
+
512
+                                <h5 style="display: inline; margin:30px;">Assessment Comments: </h5>
513
+                                @if ($activity->assessment_comments != null)
514
+
515
+
516
+                                    <p style="display: inline;">{{ $activity->assessment_comments }}</p>
517
+                                @endif
518
+                                <br>
519
+                                <hr>
520
+                                <br>
521
+
522
+                                <h4>Performance of Students by Learning Outcome</h4>
523
+                                <h5 style="display: inline;">Activity {{ $index4 + 1 }}: </h5><br>
524
+                                <p style="display: inline;">{{ $activity->name }}
525
+                                    <strong>({{ $activity->date }})</strong>
526
+                                </p>
527
+                                <h5 style="display: inline; margin:30px;">Target by learning outcome: </h5>
528
+                                <p style="display: inline;"> <i>>= 66.67% of the attempts</i>
529
+                                </p>
530
+                                <br>
531
+                                <h5 style="display: inline; margin:30px;">Expected percent of students achieving the
532
+                                    target
533
+                                    by learning outcome: </h5>
534
+                                <p style="display: inline;"> <i>
535
+                                        <?php
536
+                                        $expected = DB::table('target_outcomes_program')
537
+                                            ->where('program_id', $course->program_id)
538
+                                            ->where('semester_id', $course->semester_id)
539
+                                            ->first(); //->expected_target;
540
+                                        if (!$expected) {
541
+                                            
542
+                                             $expected = 'It has not been defined in the annual plan';
543
+                                        }
544
+                                        else{
545
+                                            $expected = $expected->expected_target;
546
+                                        }
547
+                                        
548
+                                        ?>
549
+                                        {{ $expected }}
550
+                                    </i>
551
+                                </p>
552
+                                <br>
553
+                                <table class='table table-striped table-condensed datatable'>
554
+                                    <thead>
555
+                                        <tr>
556
+                                            <th>
557
+                                                Learning Outcome
558
+                                            </th>
559
+                                            <th>
560
+                                                Number of Students Assessed
561
+                                            </th>
562
+                                            <th>
563
+                                                Number of students that achieved the target
564
+                                            </th>
565
+                                            <th>
566
+                                                %
567
+                                            </th>
568
+
569
+                                        </tr>
570
+                                    </thead>
571
+                                    <tbody>
572
+                                        @foreach ($activity->getOutcomeReport() as $outcome)
573
+                                            <tr>
574
+                                                <td>
575
+                                                    {{ $outcome->name }}
576
+                                                </td>
577
+                                                <td>
578
+                                                    {{ $outcome->attempted }}
579
+                                                </td>
580
+                                                <td>
581
+                                                    {{ $outcome->achieved }}
582
+                                                </td>
583
+                                                @if ($outcome->percentage >= $expected)
584
+                                                    <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
585
+
586
+                                                @else
587
+                                                    <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
588
+
589
+                                                @endif
590
+
591
+
592
+
593
+
594
+
595
+                                            </tr>
596
+
597
+                                        @endforeach
598
+                                    </tbody>
599
+                                </table>
600
+
601
+                                <br>
602
+                                <hr>
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+                            @endforeach
612
+                            
358 613
                         @endforeach
359 614
                     </div>
360 615