Procházet zdrojové kódy

Utlimo push con el boton de save diagnostic y tablas terminadas

Gabriel Santiago Plaza před 3 roky
rodič
revize
65b66c5cfc
28 změnil soubory, kde provedl 1345 přidání a 239 odebrání
  1. 3
    1
      app/controllers/ActivitiesController.php
  2. 77
    5
      app/controllers/AnnualPlansController.php
  3. 39
    12
      app/controllers/OutcomesController.php
  4. 1
    0
      app/controllers/ProgramsController.php
  5. 2
    0
      app/controllers/SchoolCoordinatorsController.php
  6. 1
    0
      app/controllers/TransformativeActionsController.php
  7. 32
    0
      app/database/migrations/2021_12_20_181154_add_diagnostic_to_activity.php
  8. 131
    2
      app/models/Course.php
  9. 24
    0
      app/models/Objective.php
  10. 28
    0
      app/models/Outcome.php
  11. 3
    2
      app/models/Program.php
  12. 12
    1
      app/routes.php
  13. 1
    1
      app/views/local/managers/admins/assessment_report.blade.php
  14. 1
    1
      app/views/local/managers/admins/new-course-show.blade.php
  15. 1
    1
      app/views/local/managers/pCoords/_navigation.blade.php
  16. 0
    134
      app/views/local/managers/pCoords/annual_report.blade.php
  17. 1
    1
      app/views/local/managers/pCoords/assessment_report.blade.php
  18. 22
    18
      app/views/local/managers/pCoords/new_assessment_report.blade.php
  19. 2
    1
      app/views/local/managers/sCoords/_navigation.blade.php
  20. 1
    1
      app/views/local/managers/sCoords/assessment_report.blade.php
  21. 314
    0
      app/views/local/managers/sCoords/new_assessment_report.blade.php
  22. 541
    0
      app/views/local/managers/shared/annual_report.blade.php
  23. 31
    0
      app/views/local/managers/shared/annual_select.blade.php
  24. 8
    2
      app/views/local/professors/assessment.blade.php
  25. 1
    1
      app/views/local/professors/assessment_report.blade.php
  26. 1
    1
      app/views/local/professors/course.blade.php
  27. 67
    54
      app/views/local/professors/new_assessment_report.blade.php
  28. binární
      tabla_estudiantes.jpg

+ 3
- 1
app/controllers/ActivitiesController.php Zobrazit soubor

@@ -51,6 +51,7 @@ class ActivitiesController extends \BaseController
51 51
 
52 52
             // Gabriel añadió aquí
53 53
             $activity->draft = 1;
54
+            $activity->diagnostic = 0;
54 55
             //
55 56
             $activity->date = date('Y-m-d');
56 57
 
@@ -283,11 +284,12 @@ class ActivitiesController extends \BaseController
283 284
                         }
284 285
                     }
285 286
                     $activity_draft = Input::get('draft');
287
+                    $activity_diagnostic = Input::get('diagnostic');
286 288
                     Log::info(json_encode($weights));
287 289
                     foreach ($weights as $act_crit => $weigh) {
288 290
                         DB::update("update activity_criterion set weight = {$weigh} where id = {$act_crit}");
289 291
                     }
290
-                    DB::update("update activities set draft = {$activity_draft} where id = {$activity_id}");
292
+                    DB::update("update activities set draft = {$activity_draft}, diagnostic = {$activity_diagnostic} where id = {$activity_id}");
291 293
                     // Outcome count
292 294
                     Session::flash('status', 'success');
293 295
                     Session::flash('message', 'Assessment Saved. To add transforming actions click "Transforming Actions".');

+ 77
- 5
app/controllers/AnnualPlansController.php Zobrazit soubor

@@ -146,8 +146,36 @@ class AnnualPlansController extends \BaseController
146 146
 
147 147
 
148 148
     $program = Program::where('id', '=', $program_id)->first();
149
-    $annual_plans = DB::select("select academic_year, semester_start, semester_end, program_id, annual_plans.id as id from annual_plans, annual_cycle where program_id = {$program_id} and annual_cycle.id = annual_plans.annual_cycle_id order by annual_plans.id desc ");
150
-    Log::info($annual_plans);
149
+
150
+    //Dame los annual plans que esten dentro del three year plan
151
+
152
+
153
+    $annual_plans = DB::select("
154
+    
155
+    select 
156
+      academic_year, 
157
+      semester_start, 
158
+      semester_end, 
159
+      program_id, 
160
+      annual_plans.id as id 
161
+    from annual_plans 
162
+    join annual_cycle on annual_cycle_id = annual_cycle.id 
163
+    where program_id = 110 
164
+    and(
165
+      semester_start in(
166
+        select semester_id 
167
+        from typ_semester_outcome 
168
+        join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
169
+        where program_id = {$program_id} )
170
+      or semester_end in(
171
+        select semester_id 
172
+        from typ_semester_outcome 
173
+        join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
174
+        where program_id = {$program_id} )
175
+      )
176
+      order by semester_start desc");
177
+    // $annual_plans = DB::select("select academic_year, semester_start, semester_end, program_id, annual_plans.id as id from annual_plans, annual_cycle where program_id = {$program_id} and annual_cycle.id = annual_plans.annual_cycle_id order by annual_plans.id desc ");
178
+    // Log::info($annual_plans);
151 179
     $outcomes = array();
152 180
     $allSemesterOrder = array();
153 181
     /*foreach ($annual_plans as $an_plan) {
@@ -157,8 +185,8 @@ class AnnualPlansController extends \BaseController
157 185
       $outcomes[$an_plan->id]["second"] = 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 in (select id from typ_program where program_id ={$an_plan->program_id} and three_year_plan_id = {$current_typ->id} ))");
158 186
       $allSemesterOrder[$an_plan->id]["second"] = DB::select("select * from semesters where id = {$an_plan->semester_end}")[0];
159 187
     }*/
160
-    $alltyp = DB::select('select * from three_year_plan order by id desc');
161
-    $current_typ = $current_typ->id;
188
+    //$alltyp = DB::select('select * from three_year_plan order by id desc');
189
+    //$current_typ = $current_typ->id;
162 190
     return View::make('local.managers.shared.annual-plans', compact('title', 'annual_plans', 'current_typ', 'program', 'outcomes', 'allSemesterOrder', 'alltyp'));
163 191
   }
164 192
 
@@ -172,7 +200,18 @@ class AnnualPlansController extends \BaseController
172 200
       ->first();
173 201
 
174 202
     $years = explode('-', $an_plan->academic_year);
175
-    $current_typ_program = DB::select("select * from typ_program where program_id = {$an_plan->program_id} and three_year_plan_id in (select id from three_year_plan where year_start <= {$years[0]} and year_end>= {$years[1]})")[0];
203
+    $current_typ_program = DB::table('typ_program')
204
+      ->join('typ_semester_outcome', 'typ_semester_outcome.typ_program_id', '=', 'typ_program.id')
205
+
206
+
207
+      ->where('program_id', $an_plan->program_id)
208
+      ->where('semester_id', $an_plan->semester_start)
209
+      ->select('typ_program.*')
210
+      ->first();
211
+    Log::info(array($an_plan));
212
+    Log::info(array($current_typ_program));
213
+
214
+    //DB::select("select * from typ_program where program_id = {$an_plan->program_id} and three_year_plan_id in (select id from three_year_plan where year_start <= {$years[0]} and year_end>= {$years[1]})")[0];
176 215
 
177 216
 
178 217
     $json_to_send = [];
@@ -525,4 +564,37 @@ class AnnualPlansController extends \BaseController
525 564
 
526 565
     return $all_courses_info;
527 566
   }
567
+  public function selectProgramPlan()
568
+  {
569
+
570
+    $title = "Program Annual Reports";
571
+    $programs = Auth::user()->school->programs;
572
+
573
+
574
+
575
+    return View::make('local.managers.shared.annual_select', compact('title', 'programs'));
576
+  }
577
+
578
+
579
+
580
+  public function fetchReportWithOutcome()
581
+  {
582
+    $program_id = Input::get('program_id');
583
+    $semester_id = Input::get('semester_id');
584
+    $annual_plan_id = Input::get('annual_plan_id');
585
+    $outcome_id = Input::get('outcome_id');
586
+
587
+    $outcome = Outcome::where('id', $outcome_id)->first();
588
+    $outcome->objectives = $outcome->fetchObjectivesReport($semester_id, $program_id);
589
+    $outcome->outcome_program_goal = DB::table('target_outcomes_program')
590
+      ->where('program_id', $program_id)
591
+      ->where('semester_id', $semester_id)
592
+      ->first()->expected_target;
593
+
594
+    foreach ($outcome->objectives as $index => $objective) {
595
+      $objective->courses = Objective::getPlanReport($objective);
596
+    }
597
+
598
+    return $outcome;
599
+  }
528 600
 }

+ 39
- 12
app/controllers/OutcomesController.php Zobrazit soubor

@@ -896,6 +896,7 @@ class OutcomesController extends \BaseController
896 896
                             ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
897 897
                             ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
898 898
                             ->where('activities.draft', 0)
899
+                            ->where('activities.diagnostic', 0)
899 900
                             ->select('courses.*')->distinct()
900 901
                             ->whereIn('semester_id', Session::get('semesters_ids'))
901 902
                             ->groupBy(array('code', 'number'));
@@ -911,11 +912,11 @@ class OutcomesController extends \BaseController
911 912
      */
912 913
     public function schoolAssessmentReport($outcome_id)
913 914
     {
914
-        //$outcome = Outcome::find($outcome_id);
915
+        $outcome = Outcome::find($outcome_id);
915 916
 
916 917
         //if (!$outcome)
917 918
         //    App::abort('404');
918
-        $title = "Assessment Report: " . $outcome->name;
919
+        $title = "School Assessment Reports";
919 920
 
920 921
 
921 922
         $school = School::where('id', Auth::user()->school_id)
@@ -930,6 +931,7 @@ class OutcomesController extends \BaseController
930 931
                             ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
931 932
                             ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
932 933
                             ->where('activities.draft', 0)
934
+                            ->where('activities.diagnostic', 0)
933 935
                             ->select('courses.*')->distinct()
934 936
                             //->whereNotNull('outcomes_attempted')
935 937
 
@@ -939,7 +941,7 @@ class OutcomesController extends \BaseController
939 941
             }))
940 942
             ->first();
941 943
 
942
-        return View::make('local.managers.sCoords.assessment_report', compact('title', 'school'));
944
+        return View::make('local.managers.sCoords.assessment_report', compact('title', 'school', 'outcome'));
943 945
     }
944 946
 
945 947
     /**
@@ -964,6 +966,7 @@ class OutcomesController extends \BaseController
964 966
                     ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
965 967
                     ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
966 968
                     ->where('activities.draft', 0)
969
+                    ->where('activities.diagnostic', 0)
967 970
                     ->select('courses.*')->distinct()
968 971
 
969 972
                     ->whereIn('semester_id', Session::get('semesters_ids'))
@@ -1002,13 +1005,15 @@ class OutcomesController extends \BaseController
1002 1005
         //if (!$outcome)
1003 1006
         //    App::abort('404');
1004 1007
         $title = "My Courses' Assessment Report";
1005
-        $activity_criterion = DB::table('assessments')->lists('activity_criterion_id');
1008
+        //$activity_criterion = DB::table('assessments')->lists('activity_criterion_id');
1006 1009
         $courses = DB::table("courses")
1007 1010
             ->join('activities', 'activities.course_id', '=', 'courses.id')
1008 1011
             ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
1009
-            ->whereIn('activity_criterion.id', $activity_criterion)
1012
+            ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
1013
+            //->whereIn('activity_criterion.id', $activity_criterion)
1010 1014
             ->where('courses.user_id', '=', Auth::user()->id)
1011 1015
             ->where('activities.draft', '=', 0)
1016
+            ->where('activities.diagnostic', 0)
1012 1017
             ->whereIn('courses.semester_id', Session::get('semesters_ids'))
1013 1018
             ->groupBy(array('code', 'number'))
1014 1019
             ->get();
@@ -1039,14 +1044,36 @@ class OutcomesController extends \BaseController
1039 1044
         $title = "Program Courses Report";
1040 1045
 
1041 1046
 
1042
-        $annual_plans = DB::table('annual_plans')
1043
-            ->join('annual_cycle', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
1044
-            ->where('program_id', $program_id)
1045
-            ->orderBy('semester_start', 'DESC')
1046
-            ->select('*', 'annual_plans.id as annual_id')
1047
-            ->get();
1047
+        $annual_plans = $annual_plans = DB::select("
1048
+    
1049
+        select 
1050
+          academic_year, 
1051
+          semester_start, 
1052
+          semester_end, 
1053
+          program_id, 
1054
+          annual_plans.id as annual_id,
1055
+          annual_cycle.*
1056
+        from annual_plans 
1057
+        join annual_cycle on annual_cycle_id = annual_cycle.id 
1058
+        where program_id = 110 
1059
+        and(
1060
+          semester_start in(
1061
+            select semester_id 
1062
+            from typ_semester_outcome 
1063
+            join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
1064
+            where program_id = {$program_id} )
1065
+          or semester_end in(
1066
+            select semester_id 
1067
+            from typ_semester_outcome 
1068
+            join typ_program on typ_semester_outcome.typ_program_id = typ_program.id 
1069
+            where program_id = {$program_id} )
1070
+          )
1071
+          order by semester_start desc");
1072
+        $program = DB::table('programs')
1073
+            ->where('id', $program_id)
1074
+            ->first();
1048 1075
 
1049 1076
 
1050
-        return View::make('local.managers.pCoords.annual_report', compact('title', 'program_id', 'annual_plans'));
1077
+        return View::make('local.managers.shared.annual_report', compact('title', 'program_id', 'annual_plans', 'program'));
1051 1078
     }
1052 1079
 }

+ 1
- 0
app/controllers/ProgramsController.php Zobrazit soubor

@@ -78,6 +78,7 @@ class ProgramsController extends \BaseController
78 78
       ->leftJoin('activities', function ($query) {
79 79
         $query->on('activities.course_id', '=', 'courses.id');
80 80
         $query->on('activities.draft', '=', DB::raw('0'));
81
+        $query->on('activities.diagnostic', '=', DB::raw('0'));
81 82
       })
82 83
       ->with('semester')
83 84
       ->with('program')

+ 2
- 0
app/controllers/SchoolCoordinatorsController.php Zobrazit soubor

@@ -227,6 +227,7 @@ class SchoolCoordinatorsController extends \BaseController
227 227
                     ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
228 228
                     ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
229 229
                     ->where('activities.draft', 0)
230
+                    ->where('activities.diagnostic', 0)
230 231
                     ->select('courses.*')->distinct();
231 232
             }))->where('is_graduate', 0)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
232 233
 
@@ -304,6 +305,7 @@ class SchoolCoordinatorsController extends \BaseController
304 305
                     ->join('activity_criterion as ac', 'ac.activity_id', '=', 'activities.id')
305 306
                     ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
306 307
                     ->where('activities.draft', 0)
308
+                    ->where('activities.diagnostic', 0)
307 309
                     ->select('courses.*')->distinct();
308 310
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
309 311
 

+ 1
- 0
app/controllers/TransformativeActionsController.php Zobrazit soubor

@@ -1343,6 +1343,7 @@ class TransformativeActionsController extends \BaseController
1343 1343
           ->join('transformative_actions', 'transformative_activity_criterion.trans_action_id', '=', 'transformative_actions.id')
1344 1344
           ->where('activities.course_id', $section->id)
1345 1345
           ->where('activities.draft', 0)
1346
+          ->where('activities.diagnostic', 0)
1346 1347
           ->where('criterion_objective_outcome.outcome_id', $outcome_id)
1347 1348
           ->select('activities.id as activity_id', 'activities.name')
1348 1349
           ->addSelect('transformative_actions.*', 'transformative_activity_criterion.trans_action_id as trans_action_id')

+ 32
- 0
app/database/migrations/2021_12_20_181154_add_diagnostic_to_activity.php Zobrazit soubor

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

+ 131
- 2
app/models/Course.php Zobrazit soubor

@@ -57,6 +57,7 @@ class Course extends Eloquent
57 57
       ->join('assessments', 'assessments.activity_criterion_id', '=', 'ac.id')
58 58
       ->where('activities.course_id', $this->id)
59 59
       ->where('activities.draft', 0)
60
+      ->where('activities.diagnostic', 0)
60 61
       ->select('activities.id')
61 62
       ->distinct()
62 63
       ->lists('activities.id');
@@ -90,6 +91,7 @@ class Course extends Eloquent
90 91
       ->select('criterion_id', 'activity_criterion.id as activity_criterion_id')
91 92
       ->where('courses.id', $this->id)
92 93
       ->where('draft', 0)
94
+      ->where('activities.diagnostic', 0)
93 95
       ->get();
94 96
 
95 97
     // Old data was formed like { "outcome1": cuantity_of_criteria_associated, "outcome2":cuantity_of_criteria}
@@ -112,7 +114,132 @@ class Course extends Eloquent
112 114
 
113 115
     return $outcomes_attempted;
114 116
   }
115
-
117
+  public static function getCriteriaPlanReport($course_code = null)
118
+  {
119
+    if ($course_code) {
120
+      $criteria_id = DB::table('annual_plan_objective')
121
+        ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
122
+        ->lists('criteria_id');
123
+      Log::info($course_code->typ_semester_course_id);
124
+      Log::info("dame ese id");
125
+      $program = Program::where('id', $course_code->program_id)->first();
126
+      // Log::info($program->code);
127
+      if ($program->code == "") {
128
+        $program_ids = DB::table('programs')
129
+          ->where('school_id', $program->school->id)
130
+          ->lists('programs.id');
131
+        //Log::info("estamos");
132
+      } else $program_ids = array($program->id);
133
+
134
+      /*tabla es asi por curso codigo
135
+      *
136
+      *criterioDelPlan    EstudiantesDelProgramaQuePasaron   EstudiantesqueIntentaron
137
+      *    
138
+      *    criterio1                 3                             5
139
+      *    criterio2                 2                             2
140
+      *
141
+      *
142
+      */
143
+      $table_per_criterion = DB::table('program_student_semester')
144
+        ->join('course_student', 'program_student_semester.student_id', '=', 'course_student.student_id')
145
+        ->join('courses', 'courses.id', '=', 'course_student.course_id')
146
+        ->join('activities', 'activities.course_id', '=', 'courses.id')
147
+        ->join('activity_criterion', 'activities.id', '=', 'activity_criterion.activity_id')
148
+        ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
149
+        ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
150
+        ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
151
+
152
+        ->join('assessments', function ($join) {
153
+          $join->on("assessments.student_id", '=', 'program_student_semester.student_id')
154
+            ->on('assessments.activity_criterion_id', '=', 'activity_criterion.id');
155
+        })
156
+        ->where('courses.semester_id', $course_code->semester_id)
157
+        ->whereIn('courses.program_id', $program_ids)
158
+        ->where('courses.code', $course_code->code)
159
+        ->where('courses.number', $course_code->number)
160
+        ->whereIn('program_student_semester.program_id', $program_ids)
161
+        ->whereIn('activity_criterion.criterion_id', $criteria_id)
162
+        ->whereIn('criteria.id', $criteria_id)
163
+        ->where('program_student_semester.semester_id', $course_code->semester_id)
164
+        ->select('criteria.*')
165
+        ->addSelect(DB::raw('count(case when assessments.score>= rubrics.expected_points then 1 else null end) as criteria_achieved'))
166
+        ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
167
+        ->groupBy('criteria.id');
168
+
169
+      /* Log::info($table_per_criterion->toSql());
170
+      Log::info(array($course_code));
171
+      Log::info($program_ids);
172
+      Log::info($criteria_id);*/
173
+      Log::info('mera 1');
174
+      Log::info(array($course_code));
175
+      Log::info($table_per_criterion->get());
176
+      return $table_per_criterion->get();
177
+    }
178
+  }
179
+  public static function getStudentReportForOutcome($course_code = null)
180
+  {
181
+    if ($course_code) {
182
+      $criteria_id = DB::table('annual_plan_objective')
183
+        ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
184
+        ->lists('criteria_id');
185
+      $program = Program::where('id', $course_code->program_id)->first();
186
+      // // Log::info($program->code);
187
+      if ($program->code == "") {
188
+        $program_ids = DB::table('programs')
189
+          ->where('school_id', $program->school->id)
190
+          ->lists('programs.id');
191
+        //    Log::info("estamos");
192
+      } else $program_ids = array($program->id);
193
+
194
+      // Log::info(array($course_code));
195
+
196
+      //Table
197
+      /* Student  criterion_attempted criterion passed
198
+      *     1             2                   1
199
+      *     2             7                   4
200
+      *
201
+      *
202
+      */
203
+      $table_per_student = DB::table('program_student_semester')
204
+        ->join('course_student', 'program_student_semester.student_id', '=', 'course_student.student_id')
205
+        ->join('courses', 'courses.id', '=', 'course_student.course_id')
206
+        ->join('activities', 'activities.course_id', '=', 'courses.id')
207
+        ->join('activity_criterion', 'activities.id', '=', 'activity_criterion.activity_id')
208
+        ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
209
+        ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
210
+        ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
211
+
212
+        ->join('assessments', function ($join) {
213
+          $join->on("assessments.student_id", '=', 'program_student_semester.student_id')
214
+            ->on('assessments.activity_criterion_id', '=', 'activity_criterion.id');
215
+        })
216
+        ->where('courses.semester_id', $course_code->semester_id)
217
+        ->whereIn('courses.program_id', $program_ids)
218
+        ->where('courses.code', $course_code->code)
219
+        ->where('courses.number', $course_code->number)
220
+        ->whereIn('program_student_semester.program_id', $program_ids)
221
+        ->whereIn('activity_criterion.criterion_id', $criteria_id)
222
+        ->where('program_student_semester.semester_id', $course_code->semester_id)
223
+        ->select('course_student.student_id')
224
+        ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
225
+        ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
226
+        ->groupBy('course_student.student_id');
227
+
228
+
229
+
230
+
231
+
232
+      //Log::info($criteria_id);
233
+
234
+      //Log::info($program_ids);
235
+
236
+      //Log::info($table_per_student->toSql());
237
+      $students = $table_per_student->get();
238
+
239
+
240
+      return $students;
241
+    }
242
+  }
116 243
   public function getReportObject()
117 244
   {
118 245
     $reportObject = new stdClass();
@@ -132,7 +259,7 @@ class Course extends Eloquent
132 259
       ->where('courses.id', $this->id)
133 260
       ->groupBy('criteria.id')
134 261
       ->get();
135
-    Log::info($this->id);
262
+    //Log::info($this->id);
136 263
     $reportObject->outcomesReport = DB::table('courses')
137 264
       ->join('activities', 'activities.course_id', '=', 'courses.id')
138 265
       ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
@@ -166,6 +293,7 @@ class Course extends Eloquent
166 293
       ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
167 294
       ->where('courses.id', '=', $this->id)
168 295
       ->where('activities.draft', 0)
296
+      ->where('activities.diagnostic', 0)
169 297
       ->select(
170 298
         'criteria.id',
171 299
         'rubrics.expected_percentage as expected_percentage_students_achieving'/*'expected_percentage_students_achieving',*/,
@@ -226,6 +354,7 @@ class Course extends Eloquent
226 354
         $this->program_id
227 355
       )
228 356
       ->where('activities.draft', 0)
357
+      ->where('activities.diagnostic', 0)
229 358
       ->groupBy('courses.id')
230 359
       ->count();
231 360
 

+ 24
- 0
app/models/Objective.php Zobrazit soubor

@@ -23,7 +23,31 @@ class Objective extends Eloquent
23 23
      *
24 24
      * @return Illuminate\Database\Eloquent\Model
25 25
      */
26
+    //Must have typ_semester_objective_id, program_id,semester_id to work
26 27
 
28
+    //funciona con Outcome::getObjectivesReport
29
+    //Es como la imagen suelta por el app llamada, tabla_estudiantes.jpg
30
+    //
31
+    public static function getPlanReport($objective)
32
+    {
33
+        $course_codes = DB::table('typ_semester_courses')
34
+            ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
35
+            ->where('typ_semester_objective_id', $objective->typ_semester_objective_id)
36
+            ->where('courses.program_id', $objective->program_id)
37
+            ->select('courses.code', 'courses.number', 'typ_semester_courses.id as typ_semester_course_id', DB::raw("'{$objective->semester_id}' as semester_id"), "courses.program_id")
38
+            ->get();
39
+        Log::info($course_codes);
40
+
41
+        //$course_codes['studentPerOutcome'] = array();
42
+
43
+        foreach ($course_codes as $course_code) {
44
+
45
+            $course_code->students = Course::getStudentReportForOutcome($course_code);
46
+            Log::info(array($course_code));
47
+            $course_code->criteria = Course::getCriteriaPlanReport($course_code);
48
+        }
49
+        return $course_codes;
50
+    }
27 51
     public function outcomes()
28 52
     {
29 53
         return $this->belongsToMany('Outcome', 'objective_outcome', 'objective_id', 'outcome_id');

+ 28
- 0
app/models/Outcome.php Zobrazit soubor

@@ -14,6 +14,34 @@ class Outcome extends Eloquent
14 14
 		return $this->hasManyThrough('Criterion', 'Objective')->orderBy('name');
15 15
 	}
16 16
 
17
+
18
+	public function fetchObjectivesReport($semester_id, $program_id)
19
+	{
20
+		/*$objectives = DB::table('typ_semester_outcome')
21
+			->join('typ_semester_objectives', 'typ_semester_objectives.typ_semester_outcome_id', '=', 'typ_semester_outcome.id')
22
+			->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
23
+			->join("typ_program", 'typ_program.id', '=', 'typ_semester_outcome.typ_program_id')
24
+			->where('typ_semester_outcome.semester_id', $semester_id)
25
+			->where('typ_program.program_id', $program_id)
26
+			->where('typ_semester_outcome.outcome_id', $this->id)
27
+			->select('objectives.*')
28
+			->get();*/
29
+
30
+		$objectives = DB::table('objectives')
31
+			->join('typ_semester_objectives', 'typ_semester_objectives.objective_id', '=', 'objectives.id')
32
+			->join('typ_semester_outcome', 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
33
+			->join('typ_program', 'typ_program.id', '=', 'typ_semester_outcome.typ_program_id')
34
+			->where('semester_id', $semester_id)
35
+			->where('program_id', $program_id)
36
+			->where('outcome_id', $this->id)
37
+			->select('objectives.*', 'typ_semester_objectives.id as typ_semester_objective_id', 'program_id', 'semester_id')
38
+			->distinct();
39
+		Log::info($objectives->toSql());
40
+		Log::info('semester_program_outcome' . $semester_id . ',' . $program_id . ',' . $this->id);
41
+
42
+
43
+		return $objectives->get();
44
+	}
17 45
 	/**
18 46
 	 * Return the objectives that the outcome belongs to
19 47
 	 *

+ 3
- 2
app/models/Program.php Zobrazit soubor

@@ -42,7 +42,8 @@ class Program extends Eloquent
42 42
 
43 43
 		return $this->hasManyThrough('Activity', 'Course')
44 44
 			//->whereNotNull('activities.outcomes_attempted')
45
-			->where('activities.draft', 0)->whereIn('semester_id', Session::get('semesters_ids'));
45
+			->where('activities.draft', 0)
46
+			->where('activities.diagnostic', 0)->whereIn('semester_id', Session::get('semesters_ids'));
46 47
 	}
47 48
 
48 49
 	public function assessesOutcome($outcome_id)
@@ -70,7 +71,7 @@ class Program extends Eloquent
70 71
 
71 72
 	public function objectives()
72 73
 	{
73
-		
74
+
74 75
 		return $this->hasMany('Objective');
75 76
 	}
76 77
 

+ 12
- 1
app/routes.php Zobrazit soubor

@@ -167,6 +167,16 @@ Route::group(array('before' => 'auth|has_access'), function () {
167 167
      * Shared Routes
168 168
      */
169 169
 
170
+    Route::get('selectAnnualProgram', array(
171
+        'as' => 'selectAnnualProgram',
172
+        'uses' => 'AnnualPlansController@selectProgramPlan'
173
+    ));
174
+
175
+    Route::post("fetchReportWithOutcome", array(
176
+        'as' => 'fetchReportWithOutcome',
177
+        'uses' => 'AnnualPlansController@fetchReportWithOutcome'
178
+    ));
179
+
170 180
     Route::get('annual_plan_report/{program_id}', array(
171 181
         'as' => 'annual_plan_report/{program_id}',
172 182
         'uses' => 'OutcomesController@annualReport'
@@ -283,7 +293,8 @@ Route::group(array('before' => 'auth|has_access'), function () {
283 293
     Route::get('professor', 'ProfessorsController@overview');
284 294
 
285 295
     // Assessment reports for users' courses
286
-    Route::get('my-assessment-reports', 'OutcomesController@professorAssessmentReports');
296
+
297
+    Route::get('my-assessment-reports', 'OutcomesController@professorAssessmentReport');
287 298
     Route::post('objectives/fetch', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetch'));
288 299
 
289 300
     // Transformative Actions for p-coordinators and professors

+ 1
- 1
app/views/local/managers/admins/assessment_report.blade.php Zobrazit soubor

@@ -114,7 +114,7 @@ Log::info($activity->rubric[0]);
114 114
 
115 115
 ?>
116 116
                                                     <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
117
-                                                    @if($activity->draft == 0 && array_key_exists($outcome->id, $activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1 && isset($section)&& isset($activity->rubric[0]))
117
+                                                    @if($activity->draft == 0 &&$activity->diagnostic==0 && array_key_exists($outcome->id, $activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1 && isset($section)&& isset($activity->rubric[0]))
118 118
                                                         <h5>Measure {{ $activity_index + 1 }}</h5>
119 119
                                                         <?php
120 120
                                                         /*

+ 1
- 1
app/views/local/managers/admins/new-course-show.blade.php Zobrazit soubor

@@ -53,7 +53,7 @@
53 53
                                 @endif
54 54
                             </td>
55 55
                             <td>
56
-                                @if($activity->outcomes_attempted!=NULL && !$activity->draft)
56
+                                @if($activity->outcomes_attempted!=NULL && !$activity->draft && !$activity->diagnostic)
57 57
                                     <span class="glyphicon glyphicon-ok"></span>
58 58
                                 @endif
59 59
                             </td>

+ 1
- 1
app/views/local/managers/pCoords/_navigation.blade.php Zobrazit soubor

@@ -50,7 +50,7 @@
50 50
             </li>
51 51
           
52 52
           @if(count(Auth::user()->courses))
53
-          <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'My Courses\' Reports') }}</li>
53
+          <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'My Courses\' Reports') }}</li>
54 54
           @endif
55 55
 
56 56
    

+ 0
- 134
app/views/local/managers/pCoords/annual_report.blade.php Zobrazit soubor

@@ -1,134 +0,0 @@
1
-@extends('layouts.master')
2
-
3
-@section('navigation')
4
-    @if(Auth::user()->role==1)
5
-        @include('local.managers.admins._navigation')
6
-    @elseif(Auth::user()->role==2)
7
-        @include('local.managers.sCoords._navigation')
8
-    @elseif(Auth::user()->role==3)
9
-        @include('local.managers.pCoords._navigation')
10
-    @endif
11
-@stop
12
-
13
-@section('main')
14
-    <div class="row">
15
-        <div class="col-md-3">
16
-            <div class="category" >
17
-              <label for="annual_plans">Annual Plan</label>
18
-              <div class="select">
19
-                <select  class="selectpicker" name="annual_plan" id="annual_plans" onchange ="fetchAnnualReport(this)">
20
-                  
21
-                  @foreach ($annual_plans as $an_pl)
22
-                    <option value='{{json_encode($an_pl)}}'>Annual Plan {{$an_pl->academic_year}}</option>
23
-                  @endforeach
24
-                </select>
25
-              </div>
26
-            </div>
27
-        </div>
28
-
29
-        <div class='col-md-9' id='report'>
30
-            <ul id = 'levelTabs' class = "nav nav-tabs" role = "tablist">
31
- 
32
-
33
-            </ul>
34
-<div id ='allLists' class="tab-content">
35
-</div>
36
-        </div>
37
-        
38
-
39
-    </div>
40
-
41
-<script>
42
-    function fetchAnnualReport(select){
43
-        object_json = $(select).val();
44
-        object_json = JSON.parse(object_json);
45
-        semester_start = object_json.semester_start;
46
-        semester_end = object_json.semester_end;
47
-        program_id = object_json.program_id;
48
-        annual_plan_id = object_json.annual_id;
49
-
50
-        $.post(
51
-        "{{ URL::action('AnnualPlansController@fetchAnnualReport') }}",
52
-        { 
53
-            semester_start: semester_start,
54
-            semester_end: semester_end,
55
-            program_id: program_id,
56
-            annual_plan_id: annual_plan_id,
57
-            academic_year:object_json.academic_year
58
-
59
-        
60
-        },
61
-        function(data)
62
-        {
63
-            $('#levelTabs').html(' ');
64
-        $.each(data, function(course_code, course_data){
65
-            
66
-            li = $("<li/>", {
67
-                'role':'presentation'
68
-            });
69
-            li.append($('<a/>',{
70
-                'onclick': "$(this).tab('show')",
71
-                'data-toggle':'tab',
72
-                'href':'#'+course_code,
73
-                'role':'tab'
74
-            }).html(course_code.replace('_',' ')));
75
-
76
-            div = $("<div/>",{
77
-                'role':'tabpanel',
78
-                'class':'tab-pane',
79
-                'id':course_code,
80
-            });
81
-
82
-            title = $("<h3/>",{
83
-                'style':'text-align: center'
84
-            }).html('Course: '+course_code.replace('_',' '));
85
-
86
-            criteriaAssessed = $("<h4/>",{
87
-                'style':'display: inline'
88
-            }).html('Criteria Assessed in course')
89
-
90
-            tableCriteria = $("<table/>", {
91
-                'class':'table table-striped table-condensed datatable'
92
-            });
93
-            thead = $("<thead/>").html("<tr>"+
94
-            "<th>Criterion</th>"+
95
-            "<th>Number of Students Assessed</th>"+
96
-            "<th>Number of Students that Achieved The Target</th>"+
97
-            "<th>%</th>"+
98
-            "<th>Outcomes</th>");
99
-            tbody = $("<tbody>");
100
-
101
-
102
-            $('#levelTabs').append(li);
103
-            $("#allLists").append(div);
104
-            
105
-
106
-            $.each(course_data, function(index, reports){
107
-
108
-                $.each(reports.criteriaReport, function(index2, criterion){
109
-                    criterion
110
-                })
111
-            })
112
-            
113
-
114
-        })
115
-
116
-                  
117
-        }
118
-        );
119
-
120
-    }
121
-
122
-    fetchAnnualReport(document.getElementById('annual_plans'));
123
-</script>
124
-@section('included-js')
125
-@include('global._datatables_js')
126
-@stop
127
-    
128
-@stop
129
-
130
-@section('javascript')
131
-
132
-
133
-
134
-@stop

+ 1
- 1
app/views/local/managers/pCoords/assessment_report.blade.php Zobrazit soubor

@@ -93,7 +93,7 @@
93 93
                                                 @foreach($section->activities as $index4 => $activity)
94 94
 
95 95
                                                     <!-- If activity has a rubric and the rubric has the outcome being evaluated -->
96
-                                                    @if($activity->draft ==0 && array_key_exists($outcome->id, (array)$activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1)
96
+                                                    @if($activity->draft ==0 && $activity->diagnostic == 0 && array_key_exists($outcome->id, (array)$activity->o_att_array) && $activity->o_att_array[$outcome->id] >=1)
97 97
                                                         <h5>Measure {{ $index4 + 1 }}</h5>
98 98
                                                         <p>A rubric was used in the {{ $section->code }}-{{ $section->number }} ({{ $section->name }}) course ({{ date('M Y', strtotime($course->updated_at))}}) to assess students’ <u>{{ strtolower($outcome->name) }}</u> in the activity: "<strong>{{ $activity->name }}</strong>". N= {{ count($section->students) }}. </p>
99 99
                                                         <p>The expected performance level was that <strong>{{ $activity->rubric[0]->expected_percentage }}%</strong> of students participating in the activity would score <strong>{{ $activity->rubric[0]->expected_points }} points</strong> or more in the 1-8 point scale used.</p>

+ 22
- 18
app/views/local/managers/pCoords/new_assessment_report.blade.php Zobrazit soubor

@@ -27,7 +27,18 @@
27 27
                         <ul id = 'levelTabs' class = "nav nav-tabs" role = "tablist">
28 28
                                 <!-- For each grouped course -->
29 29
                                 @foreach($program->courses as $index2=>$course)
30
+
31
+                                <li role= "presentation">
32
+                                    <a data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
33
+                                        role ="tab">{{ $course->code}}-{{ $course->number }}</a>
34
+                                    </li>
35
+                        @endforeach
36
+                            </ul>
37
+                            <div id="allLists" class="tab-content">
38
+
39
+
30 40
                                     <!-- If grouped course has activities that evaluate the outcome -->
41
+                                    @foreach($program->courses as $index2=>$course)
31 42
 
32 43
                                     <?php
33 44
 
@@ -51,7 +62,11 @@
51 62
                                 ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
52 63
                                 ->join('assessments', 'assessments.activity_criterion_id', '=','activity_criterion.id')
53 64
                                 //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
54
-                                ->where('course_id', $course->id)
65
+                                ->join('courses','courses.id','=','activities.course_id')
66
+                   ->where('courses.code',$course->code)
67
+                   ->where('courses.number',$course->number)
68
+                   ->where('activities.draft',0)
69
+                   ->where('activities.diagnostic',0)
55 70
                                 //->where('criterion_objective_outcome.outcome_id', $outcome->id)
56 71
                                 ->select('activity_id')
57 72
                                 ->lists('activity_id');
@@ -69,12 +84,8 @@
69 84
                             
70 85
                             
71 86
                                     ?>
72
-                    @if($sections_evaluating)
73
-                                    <li role= "presentation">
74
-                                        <a onclick = "$(this).tab('show');" data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
75
-                                            role ="tab">{{ $course->code}}-{{ $course->number }}</a>
76
-                                        </li>
77
-                                        @section('lists')
87
+                    
88
+                                  
78 89
                                         <div role = "tabpanel" class = 'tab-pane' id = "{{$course->code}}-{{$course->number}}">
79 90
                                             @foreach($sections_evaluating as $index3 => $section)
80 91
                                             <h3 style="text-align: center"> Course: {{$course->code}} {{$course->number}}-{{$section->section}} </h3> 
@@ -84,7 +95,7 @@
84 95
                                             <p style="display: inline;">{{$activity->name}} <strong>({{$activity->date}})</strong></p>
85 96
                                             <br>
86 97
                                             <br>
87
-                                            <h5 style="display: inline;">Performance Indicators: </h4>
98
+                                            <h5 style="display: inline;">Performance Indicators: </h5>
88 99
                                                 <?php
89 100
                                                 Log::info($activity->rubric[0]);
90 101
                                                 ?>
@@ -107,7 +118,7 @@
107 118
                                     @endif
108 119
                                     </i></p>
109 120
                                     <br>
110
-                                    <h5 style="display: inline;">Scale: </h4>
121
+                                    <h5 style="display: inline;">Scale: </h5>
111 122
                                     @if($activity->rubric[0]->max_score == 1)
112 123
                                     <p style="display: inline;">1 point scale</p>
113 124
                                     @else
@@ -276,19 +287,12 @@ $expected = DB::table('target_outcomes_program')
276 287
 
277 288
 @endforeach
278 289
 @endforeach
279
-@stop
290
+                                        </div>
280 291
 
281
-@else
282
-    <h4>There is no assessment for this course.</h4>
292
+            @endforeach
283 293
 
284
-@endif
285 294
 
286
-            @endforeach
287
-            <ul>
288 295
 
289
-        <div id="allLists" class="tab-content">
290
-        @yield('lists')
291
-        </div>
292 296
 @else
293 297
 <h4>This program has not assessed any activity</h4>
294 298
 @endif

+ 2
- 1
app/views/local/managers/sCoords/_navigation.blade.php Zobrazit soubor

@@ -42,9 +42,10 @@
42 42
         <ul class="dropdown-menu" role="menu">
43 43
           <li>{{ HTML::linkAction('OutcomesController@managerAssessmentReports', 'School Reports') }}</li>
44 44
           @if(count(Auth::user()->courses))
45
-          <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'My Courses\' Reports') }}</li>
45
+          <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'My Courses\' Reports') }}</li>
46 46
           
47 47
           @endif
48
+          <li>{{HTML::linkAction('AnnualPlansController@selectProgramPlan','Annual Reports')}}</li>
48 49
           <li>{{ HTML::linkAction('TransformativeActionsController@viewFormativeActions', 'Tranformative and Formative Actions')}}
49 50
     
50 51
         </ul>

+ 1
- 1
app/views/local/managers/sCoords/assessment_report.blade.php Zobrazit soubor

@@ -27,7 +27,7 @@
27 27
                 <ol id="table-of-contents" class="upper-roman">
28 28
 
29 29
                 </ol>
30
-
30
+                
31 31
                 <h3 id="{{ $outcome->id }}" class="outcome">{{ $outcome->name }}</h3>
32 32
                 <table class="table table-condensed table-bordered">
33 33
                     <thead>

+ 314
- 0
app/views/local/managers/sCoords/new_assessment_report.blade.php Zobrazit soubor

@@ -0,0 +1,314 @@
1
+@extends('layouts.master')
2
+
3
+@section('navigation')
4
+    @if(Auth::user()->role==1)
5
+        @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role==2)
7
+        @include('local.managers.sCoords._navigation')
8
+    @elseif(Auth::user()->role==3)
9
+        @include('local.managers.pCoords._navigation')
10
+    @endif
11
+@stop
12
+
13
+@section('main')
14
+    <div class="row">
15
+        <div class="col-md-12">
16
+            <p>This report contains performance information for all your Program's assessed courses during the following semester(s):</p>
17
+            <ul>
18
+                @foreach (Session::get('semesters_info') as $semester_info)
19
+                    <li>{{ $semester_info }}</li>
20
+                @endforeach
21
+            </ul>
22
+
23
+            @if(!$school->programs->isEmpty())
24
+
25
+                
26
+
27
+                        <ul id = 'levelTabs' class = "nav nav-tabs" role = "tablist">
28
+                                <!-- For each grouped course -->
29
+                                @foreach($program->courses as $index2=>$course)
30
+
31
+                                <li role= "presentation">
32
+                                    <a data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
33
+                                        role ="tab">{{ $course->code}}-{{ $course->number }}</a>
34
+                                    </li>
35
+                        @endforeach
36
+                            </ul>
37
+                            <div id="allLists" class="tab-content">
38
+
39
+
40
+                                    <!-- If grouped course has activities that evaluate the outcome -->
41
+                                    @foreach($program->courses as $index2=>$course)
42
+
43
+                                    <?php
44
+
45
+                                        /*$sections_evaluating = Course::has('activities')
46
+                                        ->whereNotNull('outcomes_attempted')
47
+                                        ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
48
+                                        ->with(array('activities'=>function($query) use(&$outcome){
49
+                                            $query->whereNotNull('outcomes_attempted');
50
+                                            $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
51
+                                        ->where('code', $course->code)->where('number',$course->number)
52
+                                        ->whereIn('semester_id', Session::get('semesters_ids'))
53
+                                        ->get();*/
54
+
55
+
56
+                                        $sections_evaluating = Course::has('activities')
57
+                            
58
+                            //->whereNotNull('outcomes_attempted')
59
+                            //->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
60
+                            ->with(array('activities'=>function($query) use(&$course){
61
+                                $activities = DB::table('activities')
62
+                                ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
63
+                                ->join('assessments', 'assessments.activity_criterion_id', '=','activity_criterion.id')
64
+                                //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
65
+                                ->join('courses','courses.id','=','activities.course_id')
66
+                   ->where('courses.code',$course->code)
67
+                   ->where('courses.number',$course->number)
68
+                   ->where('activities.draft',0)
69
+                   ->where('activities.diagnostic',0)
70
+                                //->where('criterion_objective_outcome.outcome_id', $outcome->id)
71
+                                ->select('activity_id')
72
+                                ->lists('activity_id');
73
+
74
+                                //$query->whereNotNull('outcomes_attempted');
75
+                                //$query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
76
+                            $query->whereIn('id', $activities);
77
+                        } ))
78
+                                
79
+
80
+                            ->where('code', $course->code)->where('number',$course->number)
81
+                            ->whereIn('semester_id', Session::get('semesters_ids'))
82
+                            ->orderBy('semester_id')
83
+                            ->get();
84
+                            
85
+                            
86
+                                    ?>
87
+                    
88
+                                  
89
+                                        <div role = "tabpanel" class = 'tab-pane' id = "{{$course->code}}-{{$course->number}}">
90
+                                            @foreach($sections_evaluating as $index3 => $section)
91
+                                            <h3 style="text-align: center"> Course: {{$course->code}} {{$course->number}}-{{$section->section}} </h3> 
92
+                                            @foreach($section->publishedActivities as $index4 => $activity)
93
+
94
+                                            <h5 style="display: inline;">Activity {{$index4+1}}: </h5>
95
+                                            <p style="display: inline;">{{$activity->name}} <strong>({{$activity->date}})</strong></p>
96
+                                            <br>
97
+                                            <br>
98
+                                            <h5 style="display: inline;">Performance Indicators: </h5>
99
+                                                <?php
100
+                                                Log::info($activity->rubric[0]);
101
+                                                ?>
102
+                                            <p style="display: inline;"><i>{{$activity->rubric[0]->num_scales}} (
103
+                                            <?php
104
+                                                $titles = $activity->rubric[0]->getTitles();
105
+                                                ?>
106
+                                            @if(sizeof($titles) != 1)
107
+                                            @foreach ($titles as $index5=>$rubric_title)
108
+                                            @if($index5!= ($activity->rubric[0]->num_scales)-1 )
109
+                                                {{$rubric_title->text}},
110
+                                            @else
111
+                                                and {{$rubric_title->text}}
112
+                                            @endif
113
+                                                
114
+                                        @endforeach
115
+                                    )
116
+                                    @else
117
+                                        {{$titles[0]->text}} )
118
+                                    @endif
119
+                                    </i></p>
120
+                                    <br>
121
+                                    <h5 style="display: inline;">Scale: </h5>
122
+                                    @if($activity->rubric[0]->max_score == 1)
123
+                                    <p style="display: inline;">1 point scale</p>
124
+                                    @else
125
+                                    <p style="display: inline;">1-{{$activity->rubric[0]->max_score}} point scale</p>
126
+    
127
+                                    @endif
128
+                                    <br>
129
+                                    <br>
130
+                                    <h4>Perfomance by Learning Outcome Criteria</h4>
131
+                                    <h5 style = "display: inline; margin:30px;">Target by criterion: </h5>
132
+                                    <p  style = "display: inline;"> <i>{{$activity->rubric[0]->expected_points}} or more</i>
133
+                                    </p>
134
+                                    <br>
135
+                                    <h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by criterion: </h5>
136
+                                    <p  style = "display: inline;"> <i>{{$activity->rubric[0]->expected_percentage}} %</i>
137
+                                    </p>
138
+                                    <br>
139
+                                    <table class='table table-striped table-condensed datatable'>
140
+                                        <thead>
141
+                                            <tr>
142
+                                                <th>
143
+                                                    Criterion
144
+                                                </th>
145
+                                                <th>
146
+                                                    Number of Students Assessed
147
+                                                </th>
148
+                                                <th>
149
+                                                    Number of students that achieved the target
150
+                                                </th>
151
+                                                <th>
152
+                                                    %
153
+                                                </th>
154
+                                                <th>
155
+                                                    Outcomes
156
+                                                </th>
157
+                                            </tr>
158
+                                        </thead>
159
+                                        <tbody>
160
+                                            @foreach($activity->allActivityCriterionInfo() as $index5=>$ac_criterion)
161
+                                            <tr>
162
+                                                <td> {{$ac_criterion->name}}</td>
163
+                                                <td>{{Criterion::students_attempted($ac_criterion->criterion_id, $activity->id)}}
164
+                                                </td>
165
+                                                <td>
166
+                                                {{Criterion::students_achieved($ac_criterion->criterion_id, $activity->id)}}
167
+        
168
+                                                </td>
169
+                                                <?php
170
+        
171
+                                                $out_att = Criterion::students_attempted($ac_criterion->criterion_id, $activity->id);
172
+                                                $out_ach = Criterion::students_achieved($ac_criterion->criterion_id, $activity->id);
173
+                                                
174
+                                                $percentage = "N/A";
175
+                                                $activity->getOutcomeReport();
176
+                                                
177
+                                                ?>
178
+@if($out_att==0)
179
+<td class="col-md-1 danger">{{ $percentage }}</td>
180
+
181
+@else
182
+<?php
183
+$percentage = round(($out_ach/$out_att)*100, 2)
184
+?>
185
+    @if ($percentage>=$activity->rubric[0]->expected_percentage)
186
+    <td class="col-md-1 success">{{ $percentage }}%</td>
187
+                     
188
+    @else
189
+    <td class="col-md-1 danger">{{ $percentage }}%</td>
190
+          
191
+    @endif
192
+    @endif
193
+    <td>
194
+                                            
195
+        @foreach(Criterion::outcomes($ac_criterion->criterion_id) as $index6=>$outcome)
196
+                                            
197
+        {{$index6 + 1}}.   <?php echo $outcome->name."\n\n\n <br>" ?>
198
+        
199
+       
200
+
201
+       @endforeach
202
+       
203
+       
204
+   </td>
205
+</tr>
206
+@endforeach
207
+</tbody>
208
+
209
+</table>
210
+<hr>
211
+<br>
212
+
213
+<h4>Perfomance by Learning Outcome Student</h4>
214
+<h5 style = "display: inline; margin:30px;">Target by outcome: </h5>
215
+<p  style = "display: inline;"> <i>>= 66.67% of the attempts</i>
216
+</p>
217
+<br>
218
+<h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by outcome: </h5>
219
+<p  style = "display: inline;"> <i> 
220
+<?php
221
+$expected = DB::table('target_outcomes_program')
222
+->where('program_id', $course->program_id)
223
+->where('semester_id', $course->semester_id)
224
+->first()->expected_target;
225
+
226
+
227
+?>
228
+{{$expected}}
229
+</i>
230
+</p>
231
+<br>
232
+<table class='table table-striped table-condensed datatable'>
233
+<thead>
234
+   <tr>
235
+       <th>
236
+           Outcome
237
+       </th>
238
+       <th>
239
+           Number of Students Assessed
240
+       </th>
241
+       <th>
242
+           Number of students that achieved the target
243
+       </th>
244
+       <th>
245
+           %
246
+       </th>
247
+       
248
+   </tr>
249
+</thead>
250
+<tbody>
251
+   @foreach($activity->getOutcomeReport() as $outcome)
252
+   <tr>
253
+       <td>
254
+           {{$outcome->name}}
255
+       </td>
256
+       <td>
257
+           {{$outcome->attempted}}
258
+       </td>
259
+       <td>
260
+           {{$outcome->achieved}}
261
+       </td>
262
+       @if($outcome->percentage>= $expected)
263
+           <td class="col-md-1 success">{{ $outcome->percentage }}%</td>
264
+                            
265
+           @else
266
+           <td class="col-md-1 danger">{{ $outcome->percentage }}%</td>
267
+                 
268
+           @endif
269
+
270
+
271
+
272
+      
273
+
274
+   </tr>
275
+
276
+   @endforeach
277
+</tbody>
278
+</table>
279
+
280
+<br>
281
+<hr>
282
+
283
+
284
+
285
+
286
+
287
+
288
+@endforeach
289
+@endforeach
290
+                                        </div>
291
+
292
+            @endforeach
293
+
294
+
295
+
296
+@else
297
+<h4>This program has not assessed any activity</h4>
298
+@endif
299
+
300
+        </div>
301
+    </div>
302
+
303
+
304
+@section('included-js')
305
+@include('global._datatables_js')
306
+@stop
307
+    
308
+@stop
309
+
310
+@section('javascript')
311
+
312
+
313
+
314
+@stop

+ 541
- 0
app/views/local/managers/shared/annual_report.blade.php Zobrazit soubor

@@ -0,0 +1,541 @@
1
+@extends('layouts.master-2')
2
+
3
+@section('navigation')
4
+    @if(Auth::user()->role==1)
5
+      @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role==2)
7
+      @include('local.managers.sCoords._navigation')
8
+    @elseif(Auth::user()->role==3)
9
+      @include('local.managers.pCoords._navigation')
10
+    @elseif(Auth::user()->role==4)
11
+      @include('local.professors._navigation')
12
+    @endif
13
+@stop
14
+@section('main')
15
+
16
+  {{-- TODO: look where to place this script.
17
+          if placed inside .ready() or before it,
18
+            an error that the function is not defined occurs. --}}
19
+  {{-- TODO: no reconoce acentos --}}
20
+
21
+
22
+  <div class="row">
23
+    <div class="col-md-3">
24
+      <select class = "form-control selectpicker" id = "annual_plan" onchange="fetchInfo('annual_plan')">
25
+        <option value = '0'> Nothing Selected</option>
26
+        @foreach ($annual_plans as $an_plan)
27
+        <option value={{$an_plan->annual_id}}>Plan {{$an_plan->academic_year}}</option>
28
+            
29
+        @endforeach
30
+      </select>
31
+      <br>
32
+     
33
+
34
+    
35
+      <div id='allOutcomes'> 
36
+      
37
+      </div>
38
+    </div>
39
+    
40
+
41
+    <div class="col-md-9">
42
+      <div id="outcome-display" class="panel panel-default">
43
+        <div class="panel-heading">
44
+          <h4 class=" panel-title" style="cursor:auto!important;">
45
+            Primer Semestre 2019-2020
46
+          </h4>
47
+        </div>
48
+        <div class="panel-body">
49
+          <div id = 'outcomeInfo'>
50
+            
51
+          </div>
52
+          <div id="tableOutcome">
53
+          </div>
54
+
55
+          <ul id = "levelTabs" class="nav nav-tabs" role="tablist">
56
+
57
+          </ul>
58
+          <div id="allLists" class="tab-content">
59
+
60
+          </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>
66
+
67
+                </table>
68
+                
69
+            </div>-->
70
+
71
+        </div>
72
+      </div>
73
+    </div>
74
+
75
+
76
+    <div class="col-md-9">
77
+      <div class="no-outcome alert alert-info">
78
+        <p>Select a Learning Outcome to view its information</p>
79
+      </div>
80
+    </div>
81
+
82
+  </div>
83
+  <script>
84
+   function nextChar(c) {
85
+    return String.fromCharCode(c.charCodeAt(0) + 1);
86
+}
87
+changed = false;
88
+
89
+$(document).ready(function()
90
+{
91
+  // --------------------------------------------------------------------------
92
+  // Page load
93
+  // --------------------------------------------------------------------------
94
+
95
+  // Hide accordion panel contents by default
96
+  $('.panel-group .panel-body').hide();
97
+
98
+  $('#outcome-display').parent().hide();
99
+
100
+  // --------------------------------------------------------------------------
101
+  // Functions
102
+  // --------------------------------------------------------------------------
103
+
104
+  // --------------------------------------------------------------------------
105
+  // Events
106
+  // --------------------------------------------------------------------------
107
+
108
+   // When list item is clicked, load corresponding info
109
+
110
+});
111
+   function fetchEverything(li)
112
+  {
113
+    var outcome_id = $(li).data('outcome-id');
114
+    var name = $(li).data('outcome-name');
115
+    var semester_id = $(li).data('semester-id');
116
+    var annual_plan_id = $(li).data('annual-plan');
117
+    $('#theChange').data('annual-plan', annual_plan);
118
+    $.post(
119
+    "{{URL::action('AnnualPlansController@fetchReportWithOutcome')}}",
120
+    { semester_id: semester_id,
121
+    outcome_id: outcome_id,
122
+    program_id: {{$program->id}},
123
+    annual_plan_id:annual_plan_id
124
+  },
125
+    function(outcome)
126
+    {
127
+        if(outcome.objectives){
128
+            $('table').show();
129
+          $('#outcome-display').parent().show();
130
+          $('#outcome-display .panel-title').html(name);
131
+          $('#allLists').empty();
132
+          $('#levelTabs').empty();
133
+          $('.no-outcome').hide();
134
+          var outcomeHTML = "<h4>Perfomance by Learning Outcome Student</h4>"+
135
+          '<h5 style = "display: inline; margin:30px;">Target by outcome: </h5>'+
136
+          '<p  style = "display: inline;"> <i>>= '+outcome.expected_outcome+' of the attempts</i>'+'</p>'
137
+          +'<br><h5 style = "display: inline; margin:30px;">Expected percent of students achieving the target by outcome: </h5>'
138
+          +'<p  style = "display: inline;"> <i>'+outcome.outcome_program_goal+'</i></p>';
139
+          $('#outcomeInfo').html('<p class="outcome-definition">'+outcome.definition+'</p>' +outcomeHTML);
140
+          //theStudentOutcomeTable = $("<table/>");
141
+          //theStudentOutcomeTable.hide();
142
+          ///$('#outcomeInfo').append(theStudentOutcomeTable);
143
+
144
+                  
145
+
146
+                  wholeDict ={};
147
+
148
+
149
+                  tableStudent = $('<table/>',{
150
+                    'class':'table table-striped table-condensed datatable'
151
+                  });
152
+                  tableStudent.html('<thead><tr>'+
153
+                  '<th>Student</th>'+
154
+                  '<th>Criteria Attempted</th>'+
155
+                  '<th>Criteria Achieved</th>'+
156
+                  '<th>Percentage</th>'+
157
+                  '<th>Outcome Achieved</th>'+
158
+                  '</tr></thead><tbody></tbody>');
159
+          $.each(outcome.objectives, function(index, objective){
160
+
161
+                li = $('<li/>',{
162
+                    'role':'presentation'
163
+                });
164
+                a = $('<a/>',{
165
+                    'data-toggle':'tab',
166
+                    'href':'#'+objective.id,
167
+                    'role':'tab'
168
+                }).html('Objective '+(index+1));
169
+                li.append(a);
170
+                $('#levelTabs').append(li);
171
+                objective_title = "<h3>"+objective.text+'</h3>';
172
+                div = $('<div/>',{
173
+                    'role':'tabpanel',
174
+                    'class':'tab-pane',
175
+                    'id':objective.id
176
+                }).html(objective_title);
177
+
178
+      
179
+
180
+               
181
+                div.appendTo($('#allLists'))
182
+                
183
+                
184
+                if(objective.courses){
185
+                  $.each(objective.courses, function(index, course_code){
186
+                    if(course_code.criteria.length){
187
+                      
188
+                      $.each(course_code.students, function(index, student){
189
+                        if(wholeDict[student.student_id] === undefined){
190
+                          wholeDict[student.student_id] = { 'student':student.student_id, 
191
+                          'criteria_attempted':0,
192
+                          'criteria_achieved':0}
193
+
194
+                        }
195
+                        wholeDict[student.student_id]["criteria_attempted"] += student.criteria_attempted;
196
+                        wholeDict[student.student_id]["criteria_achieved"] += student.criteria_achieved;
197
+
198
+                      });
199
+                      div.append('<p>The following results are from the courses in the selected semester with the focused criteria in the selected annual plan</p>');
200
+                        table = $('<table/>',{
201
+                          'class':'table table-striped table-condensed datatable'
202
+                        }).html('<thead><th>Criterion</th><th>'+
203
+                        'Number of Students Assessed </th>'+
204
+                        '<th>Number of students that achieved the target</th></thead>');
205
+                        tbody = $('<tbody/>')
206
+                      $.each(course_code.criteria, function(index, criterion){
207
+
208
+                        tr = $('<tr/>').append(
209
+                          "<td>"+criterion.name+"</td>"+
210
+                          "<td>"+criterion.criteria_attempted+"</td>"+
211
+                          "<td>"+criterion.criteria_achieved+"</td>"
212
+                        );
213
+                        tbody.append(tr);
214
+                      });
215
+                      table.append(tbody);
216
+                      div.append('<h3>'+course_code.code + ' '+ course_code.number+'</h3>')
217
+                      div.append(table);
218
+                      table.DataTable();
219
+
220
+                      
221
+                    }
222
+                    
223
+                    
224
+                  })
225
+                  
226
+
227
+               
228
+
229
+                }
230
+                else{
231
+                  div.append('<div class="no-outcome alert alert-info"'+
232
+        '<p>No Course in plan has assessed yet</p>'+
233
+      '</div>')
234
+                }
235
+                
236
+                
237
+          })
238
+          theArray =[];
239
+         
240
+          $('#tableOutcome').html(tableStudent);
241
+//tableStudent.appendTo($('#outcomeInfo'));
242
+          
243
+          tableStudent = tableStudent.DataTable({
244
+            dom: 'Bfrtip',
245
+        buttons: [
246
+             'csv', 'excel', 'pdf', 'print'
247
+        ]
248
+          });
249
+          students_attempted =0;
250
+          students_achieved = 0;
251
+ $.each(wholeDict, function(key, dict){
252
+  
253
+
254
+if(dict.criteria_attempted){
255
+  students_attempted +=1;
256
+  percentage = ((dict.criteria_achieved/dict.criteria_attempted)*100).toFixed(2);
257
+  if(parseFloat(percentage)>= parseFloat(outcome.expected_outcome)){
258
+  achieved =  "Yes"
259
+  students_achieved +=1;
260
+  }
261
+  else achieved = "No"
262
+}
263
+else{
264
+  percentage = "N/A"
265
+  achieved = "N/A"
266
+}
267
+            tableStudent.row.add([
268
+                dict.student,
269
+                dict.criteria_attempted,
270
+                dict.criteria_achieved,
271
+                percentage,
272
+                achieved
273
+            
274
+              ]);
275
+          })
276
+
277
+            tableStudent.draw();
278
+            
279
+          if(students_attempted){
280
+            studentPercentage = ((students_achieved/students_attempted) *100).toFixed(2);
281
+            if(studentPercentage >= outcome.outcome_program_goal){
282
+            FinalReport= "<br><p><strong>The students achieved the Learning Outcome with " +studentPercentage+"% of students achieving.</strong></p>";
283
+            }
284
+            else{
285
+              FinalReport = "<br><p><strong>The students did not achieve the Learning Outcome with " +studentPercentage+"% of students achieving.</strong></p>";
286
+            
287
+            }
288
+          }
289
+          
290
+          $("#outcomeInfo").append(FinalReport)
291
+
292
+
293
+            
294
+  
295
+
296
+          /* table.row.add([
297
+                objectivesHTML,
298
+                courseshtml,
299
+                
300
+                courseTAhtml
301
+                
302
+              ]);
303
+              table.draw();
304
+             */
305
+        }
306
+ else
307
+        {
308
+          $('table').hide();
309
+        }
310
+
311
+       
312
+
313
+    
314
+
315
+    
316
+        
317
+        
318
+ 
319
+    }
320
+    
321
+    );
322
+
323
+  }
324
+function posttoTransAnnual(annual_id, selectTransId, typ_course_id){
325
+  ta = $("#"+selectTransId).val();
326
+  old_ta = $("#"+selectTransId).data('old-TA');
327
+  if(ta == "0")return;
328
+  $.post("../annual-plan-postTA",
329
+  {annual_id : annual_id,
330
+  TA_id:ta,
331
+  typ_course_id : typ_course_id,
332
+  old_ta:old_ta
333
+  },
334
+  function(message){
335
+    
336
+      $("#"+selectTransId).data('old-TA', ta);
337
+    
338
+  }
339
+  )
340
+}
341
+function addTAselect(options, master_div, annual_plan_id, objective_id, typ_course_id, selected_ta){
342
+  var $div = $('<div/>', {
343
+      
344
+      'class': 'form-group '
345
+  });
346
+  counter = parseInt($('#'+master_div).data('amount-ta'));
347
+  
348
+  var selectTA = $('<select/>',{
349
+            'class': "selectpicker form-control",
350
+            'data-live-search':'true',
351
+            'data-old-TA' :'0',
352
+            'data-width': '180px',
353
+            
354
+            'id': 'transformativeForObjective'+master_div+'_'+counter,
355
+            'onchange':'posttoTransAnnual('+annual_plan_id+', "transformativeForObjective'+master_div+'_'+counter+'", '+typ_course_id+')'
356
+
357
+          });
358
+          selectTA.append(options);
359
+          
360
+          selectTA.appendTo($div);
361
+          selectTA.val(selected_ta);
362
+          selectTA.data('old-TA', selected_ta);
363
+          selectTA.selectpicker('refresh');
364
+          $span = $('<span/>', {
365
+    'id':'close',
366
+    'onclick':'  postDeleteTA('+annual_plan_id+', "transformativeForObjective'+master_div+'_'+counter+'", '+typ_course_id+'); this.parentNode.parentNode.removeChild(this.parentNode);return false;'
367
+  }).html('x');
368
+  $span.appendTo($div);
369
+  $div.append("<br><br>");
370
+  $('#'+master_div).append("<br>");
371
+  
372
+  $div.appendTo($('#'+master_div));
373
+  $('#'+master_div).data('amount-ta', counter+1);
374
+
375
+
376
+}
377
+function postDeleteTA(annual_id, selectTransId, typ_course_id){
378
+  ta = $("#"+selectTransId).val();
379
+
380
+  
381
+  if(ta == "0")return;
382
+  $.post("../annual-plan-deleteTA",
383
+  {annual_id : annual_id,
384
+  TA_id:ta,
385
+  typ_id : typ_course_id,
386
+
387
+  }
388
+  );
389
+  parent = $("#"+selectTransId).parent().parent().parent();
390
+  counter = parseInt(parent.data('amount-ta'));
391
+  parent.data('amount-ta', counter-1);
392
+}
393
+function postToAnnualPlans(typ_course_id, criteria_select){
394
+  var criteria = $('#'+criteria_select).val();
395
+  var oldCriteria = $('#'+criteria_select).data('old-criteria');
396
+  var criteriaNode = document.getElementById(criteria_select).parentNode.parentNode.parentNode;
397
+  
398
+  var annual = criteriaNode.dataset.annualPlan;
399
+  $.post("../annual-plan-postOnChange",
400
+  {criteria : criteria, 
401
+  typ_course_id : typ_course_id,
402
+  annual_plan : annual,
403
+  old_criteria :oldCriteria
404
+  },
405
+  function(message){
406
+    if(message =="Duplicate entry, please choose another criteria."){
407
+      alert(message)
408
+    }
409
+    else{
410
+        $('#'+criteria_select).data('old-criteria', criteria);  
411
+    changed = true;
412
+    }
413
+
414
+  })
415
+}
416
+
417
+
418
+function addCriteriaTest(div, new_id_for_select, typ_course_id, i=null, options) {
419
+  
420
+  if(!i) amount_select = $('#'+div).data("amount-select");
421
+  else amount_select = i;
422
+  $select = $('<select/>',{
423
+            'class': "selectpicker form-control",
424
+            'data-live-search':'true',
425
+            'data-old-criteria' :'0',
426
+            'data-width': '180px',
427
+            
428
+            'id': 'criteriaFor'+new_id_for_select+'_'+amount_select,
429
+            'onchange':'postToAnnualPlans('+typ_course_id+', "criteriaFor'+new_id_for_select+'_'+amount_select+'")'
430
+
431
+          })
432
+
433
+  var $div = $('<div/>', {
434
+      'id': 'courseSelect_' + new_id_for_select +'_'+amount_select,
435
+      'class': 'form-group '
436
+  });
437
+
438
+  $select.append(options);
439
+  $select.appendTo($div);
440
+  $span = $('<span/>', {
441
+    'id':'close',
442
+    'onclick':'  postDelete('+typ_course_id+', "criteriaFor'+new_id_for_select+'_'+amount_select+'"); this.parentNode.parentNode.removeChild(this.parentNode);return false;'
443
+  }).html('x');
444
+  $div.append($span);
445
+ $div.append("<br><br>")
446
+ $('#'+div).append("<br>");
447
+  $div.appendTo($("#"+div));
448
+  
449
+
450
+  
451
+          $select.selectpicker('refresh');
452
+  
453
+  
454
+
455
+ 
456
+  $("#"+div).data("amount-select", amount_select+1);
457
+
458
+}
459
+$('#allOutcomes').hide();
460
+function postDelete(typ_course_id, criteria_select){
461
+  var criteria = $('#'+criteria_select).val();
462
+  var oldCriteria = $('#'+criteria_select).data('old-criteria');
463
+  var criteriaNode = document.getElementById(criteria_select).parentNode.parentNode.parentNode;
464
+  
465
+  var annual = criteriaNode.dataset.annualPlan;
466
+  $.post("../annual-plan-deleteCriteria",
467
+  {criteria : criteria, 
468
+  typ_course_id : typ_course_id,
469
+  annual_plan : annual,
470
+  old_criteria :oldCriteria
471
+  });
472
+
473
+}
474
+
475
+function fetchInfo(id){
476
+  annual_id = $("#"+id).val();
477
+  program_id = {{$program->id}};
478
+  $.post("{{URL::action('AnnualPlansController@fetchInfo')}}",
479
+    {
480
+        id:annual_id,
481
+        program_id:program_id
482
+        
483
+
484
+    },
485
+    function(json){
486
+      
487
+      div = $('<div/>', {
488
+        'class':'list-group',
489
+        'id':'list'
490
+      });
491
+      header5 = $('<h5/>', {
492
+        'style':"padding-left: 10px"
493
+      }).html("First Semester");
494
+      div.append(header5);
495
+      list = '';
496
+      for(outcome in json.outcomes.first){
497
+        list+= "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '"+json.annual_plans.id+"' data-semester-id = '"+json.allSemesterOrder.first.id+"' data-outcome-id='"+json.outcomes.first[outcome].id+"' data-outcome-name ='"+json.outcomes.first[outcome].name+"' class='list-group-item' >"+json.outcomes.first[outcome].name+" </li>";
498
+        
499
+      }
500
+      div.append(list);
501
+      header4 = $('<h5/>', {
502
+        'style':"padding-left: 10px"
503
+      }).html("Second Semester");
504
+      div.append(header4);
505
+      list = '';
506
+      for(outcome in json.outcomes.second){
507
+        list+= "<li style='padding-left: 25px' onclick = 'fetchEverything(this)' data-annual-plan = '"+json.annual_plans.id+"' data-semester-id = '"+json.allSemesterOrder.second.id+"' data-outcome-id='"+json.outcomes.second[outcome].id+"' data-outcome-name ='"+json.outcomes.second[outcome].name+"' class='list-group-item' >"+json.outcomes.second[outcome].name+" </li>";
508
+        
509
+      }
510
+      div.append(list);
511
+     html = div[0].innerHTML;
512
+     
513
+      $("#allOutcomes").html(div[0].innerHTML);
514
+      $("#allOutcomes").show();
515
+
516
+},
517
+"json",
518
+  );
519
+  
520
+  }
521
+
522
+
523
+function deleteObjective(objectiveSelectDiv, closeObj){
524
+
525
+  $('#'+objectiveSelectDiv).remove();
526
+  $('#'+closeObj).remove();
527
+  $('#'+div).data("amount-select", $('#'+div).data("amount-select")-1);
528
+
529
+}
530
+</script>
531
+
532
+
533
+  
534
+
535
+@stop
536
+
537
+@section('included-js')
538
+    @include('global._datatables_js')
539
+@stop
540
+
541
+

+ 31
- 0
app/views/local/managers/shared/annual_select.blade.php Zobrazit soubor

@@ -0,0 +1,31 @@
1
+@extends('layouts.master')
2
+
3
+@section('navigation')
4
+    @if(Auth::user()->role==1)
5
+        @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role==2)
7
+        @include('local.managers.sCoords._navigation')
8
+    @elseif(Auth::user()->role==3)
9
+        @include('local.managers.pCoords._navigation')
10
+    @endif
11
+@stop
12
+
13
+@section('main')
14
+    <div class="row">
15
+        <div class="col-md-12">
16
+            <p>Click the links below to see the reports on Annual Plans </p>
17
+           
18
+            <p>Due to the large amount of information in these reports, please allow them to load a few seconds.</p>
19
+
20
+            <ol id="table-of-contents" class="upper-roman">
21
+            @foreach($programs as $program)
22
+                <li>
23
+                    <a href="{{ URL::action('OutcomesController@annualReport', array($program->id))}}">
24
+                        {{ $program->name }}
25
+                    </a>
26
+                </li>
27
+            @endforeach
28
+            </ol>
29
+        </div>
30
+    </div>
31
+@stop

+ 8
- 2
app/views/local/professors/assessment.blade.php Zobrazit soubor

@@ -211,19 +211,24 @@
211 211
 
212 212
         <div class="text-center">
213 213
             <button id="button-submit-assessment" class="btn btn-primary btn-lg publish">Publish Assessment</button>
214
+            <button id="button-diagnostic-assessment" class="btn btn-primary btn-lg diagnostic">Save as Diagnostic Test</button>
214 215
             <button id="button-draft-assessment" class="btn btn-primary btn-lg draft">Save as Draft</button>
216
+   
215 217
         </div>
216 218
     </div>
217 219
 </div>
218 220
 <script>
219 221
 
220
-$('#button-submit-assessment, #button-draft-assessment').on('click', function(e)
222
+$('#button-submit-assessment, #button-draft-assessment, #button-diagnostic-assessment').on('click', function(e)
221 223
 {
222 224
 
223 225
     var draft = 0;
226
+    var diagnostic=0
224 227
 
225 228
     if($(this).hasClass('draft'))
226 229
         draft = 1;
230
+    if($(this).hasClass('diagnostic'))
231
+        diagnostic = 1;
227 232
 
228 233
     var expected_points = parseInt($('#expected_points').text());
229 234
     var expected_percentage = parseInt($('#expected_percentage').text());
@@ -350,7 +355,8 @@ $('#button-submit-assessment, #button-draft-assessment').on('click', function(e)
350 355
             draft: draft,
351 356
             weights: JSON.stringify(weights),
352 357
         
353
-            student_info: JSON.stringify(student_info)
358
+            student_info: JSON.stringify(student_info),
359
+            diagnostic:diagnostic
354 360
         },
355 361
         function(data)
356 362
         {

+ 1
- 1
app/views/local/professors/assessment_report.blade.php Zobrazit soubor

@@ -83,7 +83,7 @@ Log::info($activity->cap_array);
83 83
 Log::info('aqui papi');?>
84 84
 
85 85
                                         <!-- If activity is not draft, has a rubric and the rubric has the outcome being evaluated -->
86
-                                        @if($activity->draft ==0 && array_key_exists($outcome->id, (array)$activity->o_att_array))
86
+                                        @if($activity->draft ==0 && $activity->diagnostic ==0&& array_key_exists($outcome->id, (array)$activity->o_att_array))
87 87
                                             <h5>Measure {{ $index4 + 1 }}</h5>
88 88
                                             <p>A rubric was used in the {{ $section->code }}-{{ $section->number }} ({{ $section->name }}) course ({{ date('M Y', strtotime($course->updated_at))}}) to assess students’ <u>{{ strtolower($outcome->name) }}</u> in the activity: "<strong>{{ $activity->name }}</strong>". At the time of assessment there were {{ $activity->amount_of_assessed_students() }} students in the section.</p>
89 89
                                             <p>The expected performance level was that <strong>{{ $activity->rubric[0]->expected_percentage }}%</strong> of students participating in the activity would score <strong>{{ $activity->rubric[0]->expected_points }} points</strong>  or more in the 1-{{$activity->rubric[0]->max_score}} point scale used.</p>

+ 1
- 1
app/views/local/professors/course.blade.php Zobrazit soubor

@@ -91,7 +91,7 @@
91 91
                             @endif
92 92
                         </td>
93 93
                         <td>
94
-                            @if($activity->o_att_array && !$activity->draft)
94
+                            @if($activity->o_att_array && !$activity->draft && !$activity->diagnostic)
95 95
                                 <span class="glyphicon glyphicon-ok"></span>
96 96
                             @endif
97 97
                         </td>

+ 67
- 54
app/views/local/professors/new_assessment_report.blade.php Zobrazit soubor

@@ -22,58 +22,76 @@
22 22
                     <li>{{ $semester_info }}</li>
23 23
                 @endforeach
24 24
             </ul>
25
+         
25 26
 
26 27
                                 <!-- For each grouped course -->
27 28
                                 <ul id = "levelTabs" class="nav nav-tabs" role="tablist">
28 29
                                         
29 30
                                    
30 31
                                 @foreach($courses as $index2=>$course)
31
-                                <?php
32
-
33
-                                /*$sections_evaluating = Course::has('activities')
34
-                                ->whereNotNull('outcomes_attempted')
35
-                                ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
36
-                                ->with(array('activities'=>function($query) use(&$outcome){
37
-                                    $query->whereNotNull('outcomes_attempted');
38
-                                    $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
39
-                                ->where('code', $course->code)->where('number',$course->number)
40
-                                ->whereIn('semester_id', Session::get('semesters_ids'))
41
-                                ->get();*/
42
-
43
-
44
-                                $sections_evaluating = Course::has('activities')
45
-                    
46
-                    //->whereNotNull('outcomes_attempted')
47
-                    //->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
48
-                    ->with(array('activities'=>function($query) use(&$course){
49
-                        $activities = DB::table('activities')
50
-                        ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
51
-                        ->join('assessments', 'assessments.activity_criterion_id', '=','activity_criterion.id')
52
-                        //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
53
-                        ->where('course_id', $course->id)
54
-                        //->where('criterion_objective_outcome.outcome_id', $outcome->id)
55
-                        ->select('activity_id')
56
-                        ->lists('activity_id');
57
-
58
-                        //$query->whereNotNull('outcomes_attempted');
59
-                        //$query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
60
-                    $query->whereIn('id', $activities);
61
-                } ))
62
-                        
63
-
64
-                    ->where('code', $course->code)->where('number',$course->number)
65
-                    ->whereIn('semester_id', Session::get('semesters_ids'))
66
-                    ->get();
67
-                    
68
-                    
69
-                            ?>
70
-                            @if($sections_evaluating)
32
+                              
33
+                            
34
+                          
71 35
                                    <li role= "presentation">
72
-                                        <a onclick = "$(this).tab('show');" data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
36
+                                        <a data-toggle = "tab" href ="#{{ $course->code}}-{{ $course->number }}"
73 37
                                             role ="tab">{{ $course->code}}-{{ $course->number }}</a>
74 38
                                         </li>
39
+                            @endforeach
40
+                                </ul>
41
+                                <div id="allLists" class="tab-content">
42
+                                   
43
+                                
44
+
75 45
 
76
-                            @section('lists')
46
+                           @foreach($courses as $index2=>$course)
47
+
48
+                           <?php
49
+
50
+                           /*$sections_evaluating = Course::has('activities')
51
+                           ->whereNotNull('outcomes_attempted')
52
+                           ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
53
+                           ->with(array('activities'=>function($query) use(&$outcome){
54
+                               $query->whereNotNull('outcomes_attempted');
55
+                               $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
56
+                           ->where('code', $course->code)->where('number',$course->number)
57
+                           ->whereIn('semester_id', Session::get('semesters_ids'))
58
+                           ->get();*/
59
+
60
+
61
+                           $sections_evaluating = Course::has('activities')
62
+               
63
+               //->whereNotNull('outcomes_attempted')
64
+               //->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
65
+               ->with(array('activities'=>function($query) use(&$course){
66
+                   $activities = DB::table('activities')
67
+                   ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
68
+                   ->join('assessments', 'assessments.activity_criterion_id', '=','activity_criterion.id')
69
+                   //->join('criterion_objective_outcome', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
70
+                   ->join('courses','courses.id','=','activities.course_id')
71
+                   ->where('courses.code',$course->code)
72
+                   ->where('courses.number',$course->number)
73
+                   ->where('activities.draft',0)
74
+                   ->where('activities.diagnostic',0)
75
+                   //->where('criterion_objective_outcome.outcome_id', $outcome->id)
76
+                   ->select('activity_id')
77
+                   ->lists('activity_id');
78
+
79
+                   //$query->whereNotNull('outcomes_attempted');
80
+                   //$query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
81
+               $query->whereIn('activities.id', $activities);
82
+           } ))
83
+                   
84
+
85
+               ->where('code', $course->code)->where('number',$course->number)
86
+               ->where('user_id',Auth::user()->id)
87
+               ->whereIn('semester_id', Session::get('semesters_ids'))
88
+               ->orderBy('semester_id')
89
+               ->get();
90
+               
91
+              
92
+                       ?>
93
+
94
+                            
77 95
                             <div role = "tabpanel" class = 'tab-pane' id = "{{$course->code}}-{{$course->number}}">
78 96
                                 @foreach($sections_evaluating as $index3 => $section)
79 97
                                 <h3 style="text-align: center"> Course: {{$course->code}} {{$course->number}}-{{$section->section}}</h3> 
@@ -82,11 +100,11 @@
82 100
                                 ?>
83 101
                                 @foreach($section->publishedActivities as $index4 => $activity)
84 102
 
85
-                                <h5 style="display: inline;">Activity {{$index4+1}}: </h4>
103
+                                <h5 style="display: inline;">Activity {{$index4+1}}: </h5>
86 104
                                 <p style="display: inline;">{{$activity->name}} <strong>({{$activity->date}})</strong></p>
87 105
                                 <br>
88 106
                                 <br>
89
-                                <h5 style="display: inline;">Performance Indicators: </h4>
107
+                                <h5 style="display: inline;">Performance Indicators: </h5>
90 108
                                     <?php
91 109
                                     Log::info($activity->rubric[0]);
92 110
                                     ?>
@@ -109,7 +127,7 @@
109 127
                                 @endif
110 128
                                 </i></p>
111 129
                                 <br>
112
-                                <h5 style="display: inline;">Scale: </h4>
130
+                                <h5 style="display: inline;">Scale: </h5>
113 131
                                 @if($activity->rubric[0]->max_score == 1)
114 132
 
115 133
                                <p style="display: inline;">1 point scale</p>
@@ -288,19 +306,14 @@
288 306
 
289 307
                                 
290 308
                                 @endforeach
309
+                            
291 310
                                 @endforeach
292
-                            @stop
311
+                            </div>
293 312
 
294
-                            @else
295
-                                <h4>There is no assessment for this course.</h4>
296
-
297
-                            @endif
313
+                            
298 314
 
299 315
                                         @endforeach
300
-                                        <ul>
301
-                                    <div id="allLists" class="tab-content">
302
-                                    @yield('lists')
303
-                                    </div>
316
+                            
304 317
 
305 318
             
306 319
 

binární
tabla_estudiantes.jpg Zobrazit soubor