Selaa lähdekoodia

Migrations con algunos otros cambios

Gabriel Santiago Plaza 3 vuotta sitten
vanhempi
commit
111ef6b9be
47 muutettua tiedostoa jossa 2993 lisäystä ja 2587 poistoa
  1. 10
    10
      app/controllers/ActivitiesController.php
  2. 1
    1
      app/controllers/AnnualPlansController.php
  3. 165
    105
      app/controllers/CriteriaController.php
  4. 104
    130
      app/controllers/ObjectivesController.php
  5. 35
    11
      app/controllers/OutcomesController.php
  6. 15
    15
      app/controllers/RubricsController.php
  7. 848
    838
      app/controllers/TransformativeActionsController.php
  8. 2
    2
      app/database/migrations/2021_06_01_000529_create_scales_table.php
  9. 2
    1
      app/database/migrations/2021_06_01_235626_create_criteria_table.php
  10. 2
    2
      app/database/migrations/2021_06_02_000507_create_rubrics_table.php
  11. 1
    0
      app/database/migrations/2021_06_03_001143_create_transformative_actions_table.php
  12. 3
    3
      app/database/migrations/2021_06_03_235944_create_courses_table.php
  13. 8
    8
      app/database/migrations/2021_06_04_003757_create_activities_table.php
  14. 1
    1
      app/database/migrations/2021_06_04_003810_create_activity_criterion_table.php
  15. 3
    2
      app/database/migrations/2021_06_05_235636_create_criterion_rubric.php
  16. 1
    0
      app/database/migrations/2021_06_05_235749_create_objective_outcome_table.php
  17. 7
    2
      app/database/migrations/2021_06_06_000025_create_criterion_objective_outcome_table.php
  18. 0
    38
      app/database/migrations/2021_06_06_000518_create_rubric_criteria_scales_table.php
  19. 8
    5
      app/database/migrations/2021_06_06_001211_create_transformative_objective_course_table.php
  20. 1
    0
      app/database/migrations/2021_06_07_001028_create_templates_criterion_table.php
  21. 0
    38
      app/database/migrations/2021_06_07_001036_create_templates_criterion_scale_table.php
  22. 3
    3
      app/database/migrations/2021_06_15_235856_create_annual_plan_transformative_table.php
  23. 0
    34
      app/database/migrations/2021_06_22_150017_delete_min_max_scales.php
  24. 0
    41
      app/database/migrations/2021_06_22_150108_add_copyright_notes_rubric_criterion.php
  25. 0
    34
      app/database/migrations/2021_06_22_150135_change_weight_float.php
  26. 5
    6
      app/database/migrations/2021_07_05_083455_create_titles.php
  27. 0
    43
      app/database/migrations/2021_07_06_075249_fix_activities.php
  28. 6
    1
      app/database/migrations/2021_07_06_082232_rubric_titles.php
  29. 6
    1
      app/database/migrations/2021_07_06_085513_template_titles.php
  30. 0
    33
      app/database/migrations/2021_07_08_093000_add_max_num_to_criteria.php
  31. 0
    32
      app/database/migrations/2021_07_09_150656_edit_template_criterion.php
  32. 8
    12
      app/database/migrations/2021_07_22_092532_create_transformative_activity_criterion.php
  33. 2
    2
      app/database/old_migrations/2020_04_22_095649_create_new_criterion_rubric_table.php
  34. 2
    2
      app/database/old_migrations/2021_03_29_151507_create_transformative_objective_program.php
  35. 1
    1
      app/database/old_migrations/2021_05_20_184230_create_rubric_scales.php
  36. 5
    5
      app/database/seeds/FillNewAssessmentActivityCriterion.php
  37. 2
    2
      app/database/seeds/FillNewCriterionRubric.php
  38. 4
    2
      app/models/Course.php
  39. 44
    46
      app/models/Criterion.php
  40. 1
    1
      app/models/Objective.php
  41. 5
    0
      app/routes.php
  42. 356
    4
      app/views/global/view-learning-outcomes-criteria.blade.php
  43. 0
    1044
      app/views/local/managers/admins/new_criteria.blade.php
  44. 1275
    0
      app/views/local/managers/pCoords/new_criteria.blade.php
  45. 45
    20
      app/views/local/managers/shared/rubrics.blade.php
  46. 5
    5
      app/views/local/professors/assessment.blade.php
  47. 1
    1
      app/views/local/professors/viewrubric.blade.php

+ 10
- 10
app/controllers/ActivitiesController.php Näytä tiedosto

@@ -167,26 +167,26 @@ class ActivitiesController extends \BaseController
167 167
         $rubric = Rubric::find($activity->rubric[0]->id);
168 168
         Log::info($rubric);
169 169
         Log::info($activity);
170
-        $criterion_rubric = DB::table('criteria')
171
-            ->join("criterion_rubric", "criterion_rubric.criterion_id", "=", "criteria.id")
170
+        $rubric_criterion = DB::table('criteria')
171
+            ->join("rubric_criterion", "rubric_criterion.criterion_id", "=", "criteria.id")
172 172
             ->join("activity_criterion", "criteria.id", '=', 'activity_criterion.criterion_id')
173 173
             ->where("activity_criterion.activity_id", '=', $activity->id)
174
-            ->where('criterion_rubric.rubric_id', '=', $rubric->id)
174
+            ->where('rubric_criterion.rubric_id', '=', $rubric->id)
175 175
             ->select('criteria.name', 'criteria.id as criterion_id', 'criteria.subcriteria')
176 176
             ->addSelect('activity_criterion.activity_id', 'activity_criterion.weight', 'activity_criterion.id as activity_criterion_id')
177
-            ->addSelect('criterion_rubric.rubric_id', 'criterion_rubric.id as rubric_criterion_id')
178
-            ->addSelect('criterion_rubric.copyright', 'criterion_rubric.notes')
177
+            ->addSelect('rubric_criterion.rubric_id', 'rubric_criterion.id as rubric_criterion_id')
178
+            ->addSelect('rubric_criterion.copyright', 'rubric_criterion.notes')
179 179
             ->get();
180
-        Log::info($criterion_rubric);
181
-        foreach ($criterion_rubric as $index => $singleCR) {
180
+        Log::info($rubric_criterion);
181
+        foreach ($rubric_criterion as $index => $singleCR) {
182 182
             $singleCR->scales = json_encode(DB::table('scales')->join('rubric_criteria_scale', 'rubric_criteria_scale.scale_id', '=', 'scales.id')
183 183
                 ->where('rubric_criteria_scale.rubric_criterion_id', '=', $singleCR->rubric_criterion_id)
184 184
                 ->orderBy('position')
185 185
                 ->lists('description'));
186 186
         }
187
-        $criterion_rubric_ids = DB::table('criterion_rubric')->where('rubric_id', '=', $rubric->id)->lists('id');
187
+        $rubric_criterion_ids = DB::table('rubric_criterion')->where('rubric_id', '=', $rubric->id)->lists('id');
188 188
         Log::info($rubric);
189
-        Log::info($criterion_rubric);
189
+        Log::info($rubric_criterion);
190 190
 
191 191
 
192 192
 
@@ -213,7 +213,7 @@ class ActivitiesController extends \BaseController
213 213
         Log::info($scores_array);
214 214
 
215 215
 
216
-        return View::make('local.professors.assessment', compact('activity', 'title', 'students', 'course', 'criterion_rubric', 'assessments', 'scores_array', 'rubric'));
216
+        return View::make('local.professors.assessment', compact('activity', 'title', 'students', 'course', 'rubric_criterion', 'assessments', 'scores_array', 'rubric'));
217 217
     }
218 218
 
219 219
     public function saveAssessment()

+ 1
- 1
app/controllers/AnnualPlansController.php Näytä tiedosto

@@ -226,7 +226,7 @@ class AnnualPlansController extends \BaseController
226 226
       }
227 227
 
228 228
 
229
-      $typ_info['custom_transformative'][$objective->id] = DB::select("select * from transformative_actions where is_custom =1 and by_professor=0 and id in (select ta_id from transformative_objective_program where objective_id = {$objective->id})");
229
+      $typ_info['custom_transformative'][$objective->id] = DB::select("select * from transformative_actions where is_custom =1 and by_professor=0 and id in (select ta_id from transformative_objective_course where objective_id = {$objective->id})");
230 230
     }
231 231
     $typ_info['annual_plan'] = $annual_plan;
232 232
     Log::info($typ_info);

+ 165
- 105
app/controllers/CriteriaController.php Näytä tiedosto

@@ -22,7 +22,7 @@ class CriteriaController extends \BaseController
22 22
 
23 23
         $criteria = Criterion::withTrashed()->orderBy('name', 'ASC')->get();
24 24
         $programs = Program::where("id", "=", $userProgram[0]->program_id)->get();
25
-        return View::make('local.managers.pCoords.criteria', compact('title', 'outcomes', 'schools', 'criteria', 'programs', 'objectives'));
25
+        return View::make('local.managers.pCoords.new_criteria', compact('title', 'outcomes', 'schools', 'criteria', 'programs', 'objectives'));
26 26
     }
27 27
 
28 28
     public function editSchool()
@@ -63,7 +63,7 @@ class CriteriaController extends \BaseController
63 63
         } else {
64 64
             foreach ($json_to_send['outcomes'] as $index => $outcome) {
65 65
 
66
-                $outcomeStr .= $outcome->name . ', ';
66
+                $outcomeStr .= ($index + 1) . '. ' . $outcome->name . '<br>';
67 67
             }
68 68
             $outcomeStr = rtrim($outcomeStr, ',');
69 69
         }
@@ -100,21 +100,52 @@ class CriteriaController extends \BaseController
100 100
     }
101 101
     public function fetchObjectivesForSelect()
102 102
     {
103
-
104 103
         $json = array();
105 104
 
106
-        Log::info(Input::get('allOutcomes'));
107
-        foreach (Input::get('allOutcomes') as $id) {
108
-            $json['outcomes'][$id] = DB::select("select name from outcomes where id = {$id}");
109
-            $json['objectives'][$id] = DB::select("select objectives.id, objectives.text, outcomes.name from objectives, objective_outcome, outcomes where  objective_outcome.outcome_id ={$id} and objective_outcome.objective_id = objectives.id and objectives.active=1 and outcomes.id = objective_outcome.outcome_id");
110
-        }
111
-        Log::info(print_r($json, true));
105
+        $outcome_id = Input::get('outcomeID');
106
+
107
+        $json = DB::table('objectives')
108
+            ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
109
+            ->where('outcome_id', '=', $outcome_id)
110
+            ->get();
111
+
112 112
         return json_encode($json);
113 113
     }
114 114
     public function fetchCriterionWithTrashed()
115 115
     {
116 116
 
117 117
         $json = array();
118
+        $json['criteria'] = DB::table('criteria')->where('id', Input::get('id'))->get();
119
+
120
+
121
+        $assoc_outcomes = DB::table('criterion_objective_outcome')->where('criterion_id', Input::get('id'))->lists('outcome_id');
122
+        $json['outcomes'] = DB::table('outcomes')->whereIn('id', $assoc_outcomes)->get();
123
+        $criteria_id = Input::get('id');
124
+        foreach ($json['outcomes'] as $outcome) {
125
+            $id = $outcome->id;
126
+            $json['objectives'][$id] = DB::table('objectives')
127
+                ->join('criterion_objective_outcome', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
128
+                ->where('criterion_id', '=', $criteria_id)
129
+                ->where('outcome_id', '=', $id)
130
+                ->get();
131
+            $json['objectives_assoc'][$id] = DB::table('objectives')
132
+                ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'objectives.id')
133
+                ->where('outcome_id', $id)
134
+                ->get();
135
+        }
136
+        $json['program'] = DB::table('program_criterion')->where('criterion_id', $criteria_id)->get();
137
+        $json['activity_criterion'] = DB::table('assessments')
138
+            ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
139
+            ->where('activity_criterion.criterion_id', $criteria_id)
140
+            ->get();
141
+        $json['scales'] = DB::table('criterion_scale')
142
+            ->join('scales', 'criterion_scale.scale_id', '=', 'scales.id')
143
+            ->where('criterion_id', $criteria_id)
144
+            ->orderBy('position')
145
+            ->get();
146
+
147
+
148
+        /*
118 149
         $json['criteria'] = DB::select(" select * from criteria where id = ?", array(Input::get('id')));
119 150
         $json['outcomes'] = DB::select("select  DISTINCT outcomes.id, outcomes.name from outcomes , criterion_objective_outcome where criterion_objective_outcome.criterion_id = ? and outcomes.id = criterion_objective_outcome.outcome_id order by outcomes.id", array(Input::get('id')));
120 151
         $json['objectives'] = DB::select("SELECT DISTINCT objectives.id, objectives.text FROM objectives, criterion_objective_outcome where criterion_objective_outcome.criterion_id = ? and criterion_objective_outcome.objective_id= objectives.id ", array(Input::get('id')));
@@ -126,7 +157,7 @@ class CriteriaController extends \BaseController
126 157
             $outId = $id->id;
127 158
             $json['outcomes_assoc'][$outId] = DB::select("select name from outcomes where id = {$outId}");
128 159
             $json['objectives_assoc'][$outId] = DB::select("select objectives.id, objectives.text, outcomes.name from objectives, objective_outcome, outcomes where  objective_outcome.outcome_id ={$outId} and objective_outcome.objective_id = objectives.id and objectives.active=1 and outcomes.id = objective_outcome.outcome_id");
129
-        }
160
+        }*/
130 161
 
131 162
         return json_encode($json);
132 163
     }
@@ -203,6 +234,9 @@ class CriteriaController extends \BaseController
203 234
 
204 235
 
205 236
         $clean_input['objective_id'] = Input::get('objective');
237
+        //Log::info('PA los periqueros');
238
+        //Log::info(Input::get('objective'));
239
+        //Log::info($clean_input['objective_id']);
206 240
 
207 241
 
208 242
 
@@ -259,14 +293,15 @@ class CriteriaController extends \BaseController
259 293
     public function create()
260 294
     {
261 295
         $clean_input = $this->cleanInput();
296
+        Log::info("POG???");
262 297
 
263 298
         /** Validation rules */
264
-        $validator = $this->makeValidator($clean_input);
299
+        //$validator = $this->makeValidator($clean_input);
265 300
 
266 301
         /** If validation fails */
267
-        if ($validator->fails()) {
268
-            /** Prepare error message */
269
-            $message = '<p>Error(s) creating a new Criterion:</p><ul>';
302
+        //if ($validator->fails()) {
303
+        /** Prepare error message */
304
+        /*    $message = '<p>Error(s) creating a new Criterion:</p><ul>';
270 305
 
271 306
             foreach ($validator->messages()->all('<li>:message</li>') as $validationError) {
272 307
                 $message .= $validationError;
@@ -275,7 +310,7 @@ class CriteriaController extends \BaseController
275 310
             $message .= '</ul>';
276 311
 
277 312
             /** Send error message and old data */
278
-            Session::flash('status', 'danger');
313
+        /* Session::flash('status', 'danger');
279 314
             Session::flash('message', $message);
280 315
             $role = Auth::user()['role'];
281 316
             switch ($role) {
@@ -292,7 +327,7 @@ class CriteriaController extends \BaseController
292 327
             // Check criterion uniqueness
293 328
             if (!$this->isCriterionUnique($clean_input)) {
294 329
                 /** Send error message and old data*/
295
-                Session::flash('status', 'danger');
330
+        /*Session::flash('status', 'danger');
296 331
                 Session::flash('message', 'This criterion is a duplicate of an already saved criterion because its name and associated program are the same.');
297 332
 
298 333
                 $role = Auth::user()['role'];
@@ -307,110 +342,114 @@ class CriteriaController extends \BaseController
307 342
                         return Redirect::to('program-criteria')->withInput();
308 343
                 }
309 344
             }
345
+*/
346
+        /** Instantiate new criterion */
347
+        $criterion = new Criterion;
348
+        $criterion->name = $clean_input['name'];
349
+        $criterion->subcriteria = $clean_input['subcriteria'];
310 350
 
311
-            /** Instantiate new criterion */
312
-            $criterion = new Criterion;
313
-            $criterion->name = $clean_input['name'];
314
-            $criterion->subcriteria = $clean_input['subcriteria'];
315 351
 
352
+        //gabriel añadió aqui
316 353
 
317
-            //gabriel añadió aqui
354
+        $criterion->num_scales = sizeof($clean_input['scale_description']);
355
+        $criterion->max_score = $clean_input['maximum_score'];
318 356
 
319
-            $criterion->num_scales = $clean_input['number_of_scales'];
320
-            $criterion->max_score = $clean_input['maximum_score'];
357
+        if (Input::get('copyright'))
358
+            $criterion->copyright = $clean_input['copyright'];
321 359
 
322
-            if (Input::get('copyright'))
323
-                $criterion->copyright = $clean_input['copyright'];
360
+        if (Input::get('notes'))
361
+            $criterion->notes = $clean_input['notes'];
324 362
 
325
-            if (Input::get('notes'))
326
-                $criterion->notes = $clean_input['notes'];
327 363
 
328 364
 
365
+        /** If criterion is saved, send success message */
366
+        if ($criterion->save()) {
329 367
 
330
-            /** If criterion is saved, send success message */
331
-            if ($criterion->save()) {
368
+            $criterionId = $criterion->id;
369
+            $parentesis = array('(', ')');
332 370
 
333
-                $criterionId = $criterion->id;
334
-                foreach ($clean_input['outcome_id'] as $outcome_id) {
335
-                    foreach ($clean_input['objective_id'] as $objective_id) {
371
+            foreach ($clean_input['objective_id'] as $objective_id) {
336 372
 
337
-                        DB::insert("insert into `criterion_objective_outcome` (`objective_id`, `outcome_id`, `criterion_id`) values ({$objective_id},{$outcome_id}, {$criterionId})");
338
-                    }
339
-                }
373
+                $outcome_objective = str_replace($parentesis, '', $objective_id);
340 374
 
341
-                for ($i = 0; $i < sizeof($clean_input['scale_description']); $i++) {
375
+                $outcome_objective = explode(',', $outcome_objective);
376
+                DB::insert("insert into `criterion_objective_outcome` (`objective_id`, `outcome_id`, `criterion_id`) values ({$outcome_objective[1]},{$outcome_objective[0]}, {$criterionId})");
377
+            }
342 378
 
343
-                    $existing_scale = DB::table('scales')->where('description', $clean_input['scale_description'][$i])
344
-                        ->first();
345
-                    if ($existing_scale) {
346
-                        DB::insert("insert_into `criterion_scale` (`criterion_id`, `scale_id`, `position`) values({$criterionId},{$existing_scale->id},{$i})");
347
-                    } else {
348
-                        $scale = new Scale;
349 379
 
350
-                        $position = $i;
351
-                        $scale->description = $clean_input['scale_description'][$i];
380
+            for ($i = 0; $i < sizeof($clean_input['scale_description']); $i++) {
352 381
 
382
+                $existing_scale = DB::table('scales')->where('description', $clean_input['scale_description'][$i])
383
+                    ->first();
384
+                if ($existing_scale) {
385
+                    DB::insert("insert into `criterion_scale` (`criterion_id`, `scale_id`, `position`) values({$criterionId},{$existing_scale->id},{$i})");
386
+                } else {
387
+                    $scale = new Scale;
353 388
 
354
-                        if ($scale->save()) {
355
-                            DB::insert("insert into `criterion_scale` (`criterion_id`, `scale_id`, `position`) values({$criterionId},{$scale->id}, {$position})");
356
-                        } else {
357
-                            Session::flash('status', 'danger');
358
-                            Session::flash('message', '<p>Error creating the Scales</p>');
359
-                            $role = Auth::user()['role'];
360
-                            switch ($role) {
361
-                                case 1:
362
-                                    return Redirect::to('criteria')->withInput();
389
+                    $position = $i;
390
+                    $scale->description = $clean_input['scale_description'][$i];
363 391
 
364
-                                case 2:
365
-                                    return Redirect::to('school-criteria')->withInput();
366 392
 
367
-                                case 3:
368
-                                    return Redirect::to('program-criteria')->withInput();
369
-                            }
393
+                    if ($scale->save()) {
394
+                        DB::insert("insert into `criterion_scale` (`criterion_id`, `scale_id`, `position`) values({$criterionId},{$scale->id}, {$position})");
395
+                    } else {
396
+                        Session::flash('status', 'danger');
397
+                        Session::flash('message', '<p>Error creating the Scales</p>');
398
+                        $role = Auth::user()['role'];
399
+                        switch ($role) {
400
+                            case 1:
401
+                                return Redirect::to('criteria')->withInput();
402
+
403
+                            case 2:
404
+                                return Redirect::to('school-criteria')->withInput();
405
+
406
+                            case 3:
407
+                                return Redirect::to('program-criteria')->withInput();
370 408
                         }
371 409
                     }
372 410
                 }
411
+            }
373 412
 
374
-                foreach ($clean_input['program_id'] as $program_id) {
375
-                    DB::insert("insert into `program_criterion` (`criterion_id`, `program_id`) values({$criterionId},{$program_id})");
376
-                }
413
+            foreach ($clean_input['program_id'] as $program_id) {
414
+                DB::insert("insert into `program_criterion` (`criterion_id`, `program_id`) values({$criterionId},{$program_id})");
415
+            }
377 416
 
378
-                Session::flash('status', 'success');
379
-                Session::flash('message', 'Criterion created: "' . $criterion->name . '".');
380
-                $role = Auth::user()['role'];
381
-                switch ($role) {
382
-                    case 1:
383
-                        return Redirect::to('criteria')->withInput();
417
+            Session::flash('status', 'success');
418
+            Session::flash('message', 'Criterion created: "' . $criterion->name . '".');
419
+            $role = Auth::user()['role'];
420
+            switch ($role) {
421
+                case 1:
422
+                    return Redirect::to('criteria')->withInput();
384 423
 
385
-                    case 2:
386
-                        return Redirect::to('school-criteria')->withInput();
424
+                case 2:
425
+                    return Redirect::to('school-criteria')->withInput();
387 426
 
388
-                    case 3:
389
-                        return Redirect::to('program-criteria')->withInput();
390
-                }
427
+                case 3:
428
+                    return Redirect::to('program-criteria')->withInput();
391 429
             }
430
+        }
392 431
 
393
-            /** If saving fails, send error message and old data */
394
-            else {
395
-                Session::flash('status', 'danger');
396
-                Session::flash('message', '<p>Error creating Criterion. Please try again later.</p>');
397
-                $role = Auth::user()['role'];
398
-                switch ($role) {
399
-                    case 1:
400
-                        return Redirect::to('criteria')->withInput();
432
+        /** If saving fails, send error message and old data */
433
+        else {
434
+            Session::flash('status', 'danger');
435
+            Session::flash('message', '<p>Error creating Criterion. Please try again later.</p>');
436
+            $role = Auth::user()['role'];
437
+            switch ($role) {
438
+                case 1:
439
+                    return Redirect::to('criteria')->withInput();
401 440
 
402
-                    case 2:
403
-                        return Redirect::to('school-criteria')->withInput();
441
+                case 2:
442
+                    return Redirect::to('school-criteria')->withInput();
404 443
 
405
-                    case 3:
406
-                        return Redirect::to('program-criteria')->withInput();
407
-                }
444
+                case 3:
445
+                    return Redirect::to('program-criteria')->withInput();
408 446
             }
409 447
         }
410 448
     }
411 449
 
412 450
 
413 451
 
452
+
414 453
     public function edit()
415 454
     {
416 455
         $title = "Criteria";
@@ -450,11 +489,11 @@ class CriteriaController extends \BaseController
450 489
 
451 490
 
452 491
         $clean_input['subcriteria'] = $trimmed;
453
-        $clean_input['outcome_id'] = Input::get('assoc_outcome');
492
+        $clean_input['outcome_id'] = Input::get('outcome');
454 493
 
455 494
 
456 495
 
457
-        $clean_input['objective_id'] = Input::get('assoc_objective');
496
+        $clean_input['objective_id'] = Input::get('objective');
458 497
 
459 498
 
460 499
 
@@ -463,15 +502,32 @@ class CriteriaController extends \BaseController
463 502
 
464 503
         $clean_input['copyright'] = trim(preg_replace('/\t+/', '', Input::get('copyright')));
465 504
         $clean_input['notes'] = trim(preg_replace('/\t+/', '', Input::get('notes')));
466
-        $clean_input['maximum_score'] = (int) Input::get('assoc_maximum_score');
505
+        $clean_input['maximum_score'] = (int) Input::get('maximum_score');
467 506
         //$clean_input['scale_title'] = Input::get('assoc_title');
468
-        $clean_input['scale_description'] = Input::get('assoc_scales');
507
+        $clean_input['scale_description'] = Input::get('Scales');
469 508
         $clean_input['number_of_scales'] = sizeof($clean_input['scale_description']);
470 509
 
471 510
 
472 511
         return $clean_input;
473 512
     }
474 513
 
514
+    public function changeStatus()
515
+    {
516
+        $criterion_id = Input::get('criterion_id');
517
+        $criterion = Criterion::find($criterion_id);
518
+
519
+        if (!$criterion->deleted_at) {
520
+            $criterion->deleted_at = date('Y-m-d H:i:s');
521
+            if ($criterion->save())
522
+                return "deleted";
523
+            else return 'error';
524
+        } else {
525
+            $criterion->deleted_at = NULL;
526
+            if ($criterion->save())
527
+                return "activated";
528
+            else return 'error';
529
+        }
530
+    }
475 531
     public function update()
476 532
     {
477 533
         $criterion = Criterion::withTrashed()->find(Input::get('id'));
@@ -498,33 +554,33 @@ class CriteriaController extends \BaseController
498 554
             $role = Auth::user()['role'];
499 555
             switch ($role) {
500 556
                 case 1:
501
-                    return Redirect::to('objective')->withInput();
557
+                    return Redirect::to('criteria')->withInput();
502 558
 
503 559
                 case 2:
504
-                    return Redirect::to('school-objective')->withInput();
560
+                    return Redirect::to('school-criteria')->withInput();
505 561
 
506 562
                 case 3:
507
-                    return Redirect::to('program-objective')->withInput();
563
+                    return Redirect::to('program-criteria')->withInput();
508 564
             }
509 565
         } else {
510 566
 
511 567
             // // Check criterion uniqueness
512
-            if (!$this->isCriterionUnique($clean_input, $criterion)) {
568
+            /*if (!$this->isCriterionUnique($clean_input, $criterion)) {
513 569
                 /** Send error message and old data */
514
-                Session::flash('status', 'danger');
570
+            /*Session::flash('status', 'danger');
515 571
                 Session::flash('message', 'This criterion is a duplicate of an already saved criterion because its name, assoaciated school or program, and progress indicators are the same.');
516 572
                 $role = Auth::user()['role'];
517 573
                 switch ($role) {
518 574
                     case 1:
519
-                        return Redirect::to('objective')->withInput();
575
+                        return Redirect::to('criteria')->withInput();
520 576
 
521 577
                     case 2:
522
-                        return Redirect::to('school-objective')->withInput();
578
+                        return Redirect::to('school-criteria')->withInput();
523 579
 
524 580
                     case 3:
525
-                        return Redirect::to('program-objective')->withInput();
581
+                        return Redirect::to('program-criteria')->withInput();
526 582
                 }
527
-            }
583
+            }*/
528 584
 
529 585
             /** Set info */
530 586
             $criterion->name = $clean_input['name'];
@@ -561,16 +617,18 @@ class CriteriaController extends \BaseController
561 617
                 $criterion->notes = NULL;
562 618
 
563 619
             /** If criterion is updated, send success message */
620
+            $parentesis = array('(', ')');
564 621
             if ($criterion->save()) {
565 622
                 $criterionId = $criterion->id;
566 623
                 DB::delete("delete from `criterion_objective_outcome` where `criterion_id` ={$criterionId}");
567 624
                 DB::delete("delete from `program_criterion` where `criterion_id` ={$criterionId}");
568 625
 
569
-                foreach ($clean_input['outcome_id'] as $outcome_id) {
570
-                    foreach ($clean_input['objective_id'] as $objective_id) {
626
+                foreach ($clean_input['objective_id'] as $objective_id) {
571 627
 
572
-                        DB::insert("insert into `criterion_objective_outcome` (`objective_id`, `outcome_id`, `criterion_id`) values ({$objective_id},{$outcome_id}, {$criterionId})");
573
-                    }
628
+                    $outcome_objective = str_replace($parentesis, '', $objective_id);
629
+
630
+                    $outcome_objective = explode(',', $outcome_objective);
631
+                    DB::insert("insert into `criterion_objective_outcome` (`objective_id`, `outcome_id`, `criterion_id`) values ({$outcome_objective[1]},{$outcome_objective[0]}, {$criterionId})");
574 632
                 }
575 633
 
576 634
                 /*DB::delete("delete from `scales` where id in (select scale_id id from criterion_scale where criterion_id = {$criterionId})");
@@ -581,7 +639,7 @@ class CriteriaController extends \BaseController
581 639
                     $existing_scale = DB::table('scales')->where('description', $clean_input['scale_description'][$i])
582 640
                         ->first();
583 641
                     if ($existing_scale) {
584
-                        DB::insert("insert_into `criterion_scale` (`criterion_id`, `scale_id`, `position`) values({$criterionId},{$existing_scale->id},{$i})");
642
+                        DB::insert("insert into `criterion_scale` (`criterion_id`, `scale_id`, `position`) values({$criterionId},{$existing_scale->id},{$i})");
585 643
                     } else {
586 644
                         $scale = new Scale;
587 645
 
@@ -689,7 +747,8 @@ class CriteriaController extends \BaseController
689 747
         } elseif (Auth::user()->role == 2) {
690 748
             //buscar los objetivos de la departamento (school)
691 749
             $objectives = DB::table('program_user')
692
-                ->join('objectives', 'objectives.program_id', '=', 'program_user.program_id')
750
+                ->join('objective_program', 'objective_program.program_id', '=', 'program_user.program_id')
751
+                ->join('objectives', 'objectives.id', '=', 'objective_program.objective_id')
693 752
                 ->join('programs', 'programs.id', '=', 'program_user.program_id')
694 753
                 ->where('programs.school_id', Auth::user()->school_id)
695 754
                 ->select('objectives.id', 'objectives.text', 'programs.name')
@@ -698,7 +757,8 @@ class CriteriaController extends \BaseController
698 757
         } elseif ((Auth::user()->role == 3) || (Auth::user()->role == 4)) {
699 758
             //buscar los objetivos de los programas cuales el profesor esta
700 759
             $objectives = DB::table('program_user')
701
-                ->join('objectives', 'objectives.program_id', '=', 'program_user.program_id')
760
+                ->join('objective_program', 'objective_program.program_id', '=', 'program_user.program_id')
761
+                ->join('objectives', 'objectives.id', '=', 'objective_program.objective_id')
702 762
                 ->join('programs', 'programs.id', '=', 'program_user.program_id')
703 763
                 ->where('program_user.user_id', Auth::user()->id)
704 764
                 ->select('objectives.id', 'objectives.text', 'programs.name')

+ 104
- 130
app/controllers/ObjectivesController.php Näytä tiedosto

@@ -1,56 +1,47 @@
1 1
 <?php
2 2
 
3
-class ObjectivesController extends \BaseController {
4
-
5
-    /**
6
-     * Display a listing of the resource.
7
-     *
8
-     * @return Response
9
-     */
10
-    public function fetch()
11
-    {
12
-        try
13
-        {
14
-            $outcome_id = Input::get('outcome_id');
15
-            $program_id = Input::get('program_id');
16
-            $format = Input::get('format');
17
-
18
-
19
-            $objectives = Objective::select('id', 'outcome_id', 'program_id', 'text');
20
-
21
-            if($outcome_id)
22
-            {
23
-                $objectives->where('outcome_id', $outcome_id);
24
-            }
25
-
26
-            if($program_id)
27
-            {
28
-                $objectives->where('program_id', $program_id);
29
-            }
30
-
31
-            if($format == 'select')
32
-            {
33
-                $string = '';
34
-                foreach ($objectives->get() as $objective)
35
-                {
36
-                    $string.='<option value="'.$objective->id.'">'.$objective->text.'</option>';
37
-                }
38
-
39
-                echo $string;
40
-                return;
41
-            }
42
-            else
43
-            {
44
-                return $objectives->get();
45
-            }
46
-        }
47
-        catch (Exception $e)
48
-        {
49
-            echo $e->getMessage();
50
-            return;
3
+class ObjectivesController extends \BaseController
4
+{
5
+
6
+  /**
7
+   * Display a listing of the resource.
8
+   *
9
+   * @return Response
10
+   */
11
+  public function fetch()
12
+  {
13
+    try {
14
+      $outcome_id = Input::get('outcome_id');
15
+      $program_id = Input::get('program_id');
16
+      $format = Input::get('format');
17
+
18
+
19
+      $objectives = Objective::select('id', 'outcome_id', 'program_id', 'text');
20
+
21
+      if ($outcome_id) {
22
+        $objectives->where('outcome_id', $outcome_id);
23
+      }
24
+
25
+      if ($program_id) {
26
+        $objectives->where('program_id', $program_id);
27
+      }
28
+
29
+      if ($format == 'select') {
30
+        $string = '';
31
+        foreach ($objectives->get() as $objective) {
32
+          $string .= '<option value="' . $objective->id . '">' . $objective->text . '</option>';
51 33
         }
52 34
 
35
+        echo $string;
36
+        return;
37
+      } else {
38
+        return $objectives->get();
39
+      }
40
+    } catch (Exception $e) {
41
+      echo $e->getMessage();
42
+      return;
53 43
     }
44
+  }
54 45
 
55 46
   /**
56 47
    * Edit the learning objectives per learning outcome for a program
@@ -60,20 +51,15 @@ class ObjectivesController extends \BaseController {
60 51
     $role = Auth::user()->role;
61 52
 
62 53
     // Redirect users if they try to access forbidden page
63
-  	if($role == 2 && $program->school_id != Auth::user()->school_id)
64
-  	{
65
-		return Redirect::to('/');
66
-  	}
67
-  	else if($role == 3 && !in_array($program->id, Auth::user()->programs->lists('id')))
68
-  	{
69
-		return Redirect::to('/');
70
-  	}
71
-  	else if($role == 4)
72
-  	{
73
-		return Redirect::to('/');
74
-  	}
75
-
76
-    $title = 'Learning Objectives ('.$program->name.')';
54
+    if ($role == 2 && $program->school_id != Auth::user()->school_id) {
55
+      return Redirect::to('/');
56
+    } else if ($role == 3 && !in_array($program->id, Auth::user()->programs->lists('id'))) {
57
+      return Redirect::to('/');
58
+    } else if ($role == 4) {
59
+      return Redirect::to('/');
60
+    }
61
+
62
+    $title = 'Learning Objectives (' . $program->name . ')';
77 63
     $objectives = $program->objectives;
78 64
 
79 65
     // Eager load outcomes related to objectives
@@ -86,37 +72,34 @@ class ObjectivesController extends \BaseController {
86 72
 
87 73
   public function create()
88 74
   {
89
-    try
90
-    {
75
+    try {
91 76
       $outcome_id = Input::get('outcome_id');
92 77
       $program_id = Input::get('program_id');
93 78
       $learning_objective = trim(Input::get('learning_objective'));
94 79
 
95 80
 
96 81
       $validator = Validator::make(
97
-          array(
98
-              'outcome_id' => $outcome_id,
99
-              'program_id' => $program_id,
100
-              'learning_objective' => $learning_objective
101
-          ),
102
-          array(
103
-              'outcome_id' => 'required|integer',
104
-              'program_id' => 'required|integer',
105
-              'learning_objective' => 'required|min:1',
106
-          )
82
+        array(
83
+          'outcome_id' => $outcome_id,
84
+          'program_id' => $program_id,
85
+          'learning_objective' => $learning_objective
86
+        ),
87
+        array(
88
+          'outcome_id' => 'required|integer',
89
+          'program_id' => 'required|integer',
90
+          'learning_objective' => 'required|min:1',
91
+        )
107 92
       );
108 93
 
109
-      if($validator->fails())
110
-      {
94
+      if ($validator->fails()) {
111 95
         /** Prepare error message */
112 96
         $message = '<p>Error(s) creating a new Learning Objective: </p><ul>';
113 97
 
114
-        foreach ($validator->messages()->all('<li>:message</li>') as $validationError)
115
-        {
116
-            $message.=$validationError;
98
+        foreach ($validator->messages()->all('<li>:message</li>') as $validationError) {
99
+          $message .= $validationError;
117 100
         }
118 101
 
119
-        $message.='</ul>';
102
+        $message .= '</ul>';
120 103
 
121 104
         /** Send error message and old data */
122 105
         Session::flash('status', 'danger');
@@ -131,16 +114,14 @@ class ObjectivesController extends \BaseController {
131 114
       ));
132 115
 
133 116
       /** Send success message */
134
-        Session::flash('status', 'success');
135
-        Session::flash('message', 'New Learning Objective successfully created.');
136
-        return Redirect::back();
137
-    }
138
-    catch(Exception $e)
139
-    {
117
+      Session::flash('status', 'success');
118
+      Session::flash('message', 'New Learning Objective successfully created.');
119
+      return Redirect::back();
120
+    } catch (Exception $e) {
140 121
       /** Send error message and old data */
141
-        Session::flash('status', 'danger');
142
-        Session::flash('message', 'An error ocurred trying to create a new Learning Objective. Please try again later.'.$e->getMessage());
143
-        return Redirect::back()->withInput();
122
+      Session::flash('status', 'danger');
123
+      Session::flash('message', 'An error ocurred trying to create a new Learning Objective. Please try again later.' . $e->getMessage());
124
+      return Redirect::back()->withInput();
144 125
     }
145 126
   }
146 127
 
@@ -149,39 +130,36 @@ class ObjectivesController extends \BaseController {
149 130
    */
150 131
   public function update()
151 132
   {
152
-    try
153
-    {
133
+    try {
154 134
       $outcome_id = Input::get('edit_outcome_id');
155 135
       $objective_id = Input::get('edit_objective_id');
156 136
       $active = Input::get('edit_active');
157 137
       $learning_objective = trim(Input::get('edit_learning_objective'));
158 138
 
159 139
       $validator = Validator::make(
160
-          array(
161
-            'outcome_id' => $outcome_id,
162
-            'objective_id' => $objective_id,
163
-            'active' => $active,
164
-            'learning_objective' => $learning_objective
165
-          ),
166
-          array(
167
-            'outcome_id' => 'required|integer',
168
-            'objective_id' => 'required|integer',
169
-            'active' => 'required|integer|boolean',
170
-            'learning_objective' => 'required|min:1',
171
-          )
140
+        array(
141
+          'outcome_id' => $outcome_id,
142
+          'objective_id' => $objective_id,
143
+          'active' => $active,
144
+          'learning_objective' => $learning_objective
145
+        ),
146
+        array(
147
+          'outcome_id' => 'required|integer',
148
+          'objective_id' => 'required|integer',
149
+          'active' => 'required|integer|boolean',
150
+          'learning_objective' => 'required|min:1',
151
+        )
172 152
       );
173 153
 
174
-      if($validator->fails())
175
-      {
154
+      if ($validator->fails()) {
176 155
         /** Prepare error message */
177 156
         $message = '<p>Error(s) updating the Learning Objective: </p><ul>';
178 157
 
179
-        foreach ($validator->messages()->all('<li>:message</li>') as $validationError)
180
-        {
181
-            $message.=$validationError;
158
+        foreach ($validator->messages()->all('<li>:message</li>') as $validationError) {
159
+          $message .= $validationError;
182 160
         }
183 161
 
184
-        $message.='</ul>';
162
+        $message .= '</ul>';
185 163
 
186 164
         /** Send error message and old data */
187 165
         Session::flash('status', 'danger');
@@ -195,19 +173,17 @@ class ObjectivesController extends \BaseController {
195 173
           'outcome_id' => $outcome_id,
196 174
           'text' => $learning_objective,
197 175
           'active' => $active,
198
-      ));
176
+        ));
199 177
 
200 178
       /** Send success message */
201
-        Session::flash('status', 'success');
202
-        Session::flash('message', 'Learning Objective successfully updated.');
203
-        return Redirect::back();
204
-    }
205
-    catch(Exception $e)
206
-    {
207
-      	/** Send error message and old data */
208
-        Session::flash('status', 'danger');
209
-        Session::flash('message', 'An error ocurred trying to create a new Learning Objective. Please try again later.'.$e->getMessage());
210
-        return Redirect::back()->withInput();
179
+      Session::flash('status', 'success');
180
+      Session::flash('message', 'Learning Objective successfully updated.');
181
+      return Redirect::back();
182
+    } catch (Exception $e) {
183
+      /** Send error message and old data */
184
+      Session::flash('status', 'danger');
185
+      Session::flash('message', 'An error ocurred trying to create a new Learning Objective. Please try again later.' . $e->getMessage());
186
+      return Redirect::back()->withInput();
211 187
     }
212 188
   }
213 189
 
@@ -226,8 +202,7 @@ class ObjectivesController extends \BaseController {
226 202
       )
227 203
     );
228 204
 
229
-    if($validator->fails())
230
-    {
205
+    if ($validator->fails()) {
231 206
       return '';
232 207
     }
233 208
     $res = DB::table('objectives')->where('id', Input::get('objective_id'))->first();
@@ -237,16 +212,15 @@ class ObjectivesController extends \BaseController {
237 212
 
238 213
   public function fetchObjectiveForCriteria()
239 214
   {
240
-      $id = Input::get('id');
215
+    $id = Input::get('id');
241 216
 
242
-      $objective = Objective::find($id);
217
+    $objective = Objective::find($id);
243 218
 
244
-      $objective->program;
245
-      $objective->criteria;
219
+    //$objective->program;
220
+    //$objective->criteria;
246 221
 
247
-      return array
248
-      (
249
-          'objective' => $objective
250
-      );
222
+    return array(
223
+      'objective' => $objective
224
+    );
251 225
   }
252 226
 }

+ 35
- 11
app/controllers/OutcomesController.php Näytä tiedosto

@@ -553,15 +553,31 @@ class OutcomesController extends \BaseController
553 553
 
554 554
         $diferent_levels = DB::table('criterion_objective_outcome')
555 555
             ->join('criteria', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
556
-            ->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
557 556
             ->where('criterion_objective_outcome.outcome_id', $id)
558
-            ->distinct('criteria.number_of_scales')
559
-            ->select('criteria.number_of_scales as levels')
560
-            ->orderBy('criteria.number_of_scales', 'asc')
557
+            ->distinct('criteria.num_scales')
558
+            ->select('criteria.num_scales as levels')
559
+            ->orderBy('criteria.num_scales', 'asc')
561 560
             ->get();
562 561
 
563 562
         $criteria_array = array();
564 563
 
564
+        // switch para el query, dependiendo del usuario
565
+
566
+        $role = Auth::user()['role'];
567
+
568
+        switch ($role) {
569
+            case 1:
570
+                $program_ids = DB::table('programs')->lists('id');
571
+                break;
572
+            case 2:
573
+                $school_id = Auth::user()['school_id'];
574
+                $program_ids = DB::table('programs')->where('school_id', $school_id)->lists('id');
575
+                break;
576
+            case 3:
577
+                $program_ids = DB::table('program_user')->where('user_id', Auth::user()['id'])->lists('program_id');
578
+                break;
579
+        }
580
+
565 581
         $outcome->criteria = array();
566 582
         foreach ($diferent_levels as $level) {
567 583
             $level = $level->levels;
@@ -578,18 +594,25 @@ class OutcomesController extends \BaseController
578 594
             //                 ->get();
579 595
             $outcome_criterias = DB::table('criterion_objective_outcome')
580 596
                 ->join('criteria', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
581
-                ->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
597
+                ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
598
+                ->whereIn('program_criterion.program_id', $program_ids)
582 599
                 ->where('criterion_objective_outcome.outcome_id', $id)
583
-                ->where('criteria.number_of_scales', $level)
584
-                ->whereNull('criteria.deleted_at')
585
-                ->select('criteria.id', 'criteria.name')
600
+                ->where('criteria.num_scales', $level)
601
+                ->select('criteria.id', 'criteria.name', 'criteria.deleted_at')
586 602
                 ->orderBy('criteria.name', 'asc')
587 603
                 ->get();
588
-            $outcome_criterias = $outcome_criterias;
604
+            // $outcome_criterias = $outcome_criterias;
589 605
 
590 606
             foreach ($outcome_criterias as $criteria_id) {
607
+                $scales = DB::select("select * FROM scales INNER join `criterion_scale` on `criterion_scale`.`scale_id` = `scales`.`id` where criterion_scale.criterion_id ={$criteria_id->id} ORDER BY position");
608
+
609
+                $programs = DB::table('programs')
610
+                    ->join('program_criterion', 'program_criterion.program_id', '=', 'programs.id')
611
+                    ->where('criterion_id', $criteria_id->id)
612
+                    ->lists('programs.name');
613
+                Log::info($scales);
591 614
 
592
-                $scales =
615
+                /* $scales =
593 616
                     DB::select(
594 617
                         DB::raw("
595 618
                   SELECT *
@@ -611,7 +634,8 @@ class OutcomesController extends \BaseController
611 634
                   WHERE rn = 1
612 635
                   ORDER BY `a`.`position` ASC
613 636
                       ")
614
-                    );
637
+                    );*/
638
+                $criteria_id->programs = $programs;
615 639
                 // insertar la informacion de los criterios con N niveles en el arreglo de arreglos
616 640
                 $criteria_id->scales = $scales;
617 641
                 // $i++;

+ 15
- 15
app/controllers/RubricsController.php Näytä tiedosto

@@ -108,9 +108,9 @@ class RubricsController extends \BaseController
108 108
 
109 109
             $rubricId = $rubric->id;
110 110
             foreach ($criteria as $index => $criterion_id) {
111
-                DB::insert("insert into criterion_rubric (`rubric_id`,`criterion_id`) values ({$rubricId},{$criterion_id})");
111
+                DB::insert("insert into rubric_criterion (`rubric_id`,`criterion_id`) values ({$rubricId},{$criterion_id})");
112 112
                 DB::commit();
113
-                $rubric_criterion_id = DB::table('criterion_rubric')->where('rubric_id', '=', $rubricId)
113
+                $rubric_criterion_id = DB::table('rubric_criterion')->where('rubric_id', '=', $rubricId)
114 114
                     ->where('criterion_id', '=', $criterion_id)->first();
115 115
 
116 116
 
@@ -270,16 +270,16 @@ class RubricsController extends \BaseController
270 270
 
271 271
         $course->save();
272 272
         Log::info('entré6???');
273
-        DB::delete("delete from criterion_rubric where rubric_id ={$rubric->id}");
273
+        DB::delete("delete from rubric_criterion where rubric_id ={$rubric->id}");
274 274
         DB::delete("delete from activity_criterion where activity_id = {$activity->id}");
275 275
         foreach ($criteria as $index => $criterion_id) {
276 276
             if (
277 277
 
278
-                DB::insert("insert into criterion_rubric (`rubric_id`, `criterion_id`) values ({$rubric->id}, {$criterion_id}) ")
278
+                DB::insert("insert into rubric_criterion (`rubric_id`, `criterion_id`) values ({$rubric->id}, {$criterion_id}) ")
279 279
                 &&  DB::insert("insert into `activity_criterion` (`activity_id`,`criterion_id`, `weight`) values ({$activity->id}, {$criterion_id}, {$defaultWeight})")
280 280
             ) {
281 281
 
282
-                $rubric_criterion_id =  DB::table('criterion_rubric')
282
+                $rubric_criterion_id =  DB::table('rubric_criterion')
283 283
                     ->where('rubric_id', '=', $rubric->id)
284 284
                     ->where('criterion_id', '=', $criterion_id)
285 285
                     ->first();
@@ -360,13 +360,13 @@ class RubricsController extends \BaseController
360 360
         Log::info($activity->rubric[0]->id);
361 361
 
362 362
         $rubric = Rubric::where('id', '=', $activity->rubric[0]->id)->firstOrFail();
363
-        $criterion_rubric = DB::table('criteria')
364
-            ->join('criterion_rubric', 'criterion_rubric.criterion_id', '=', 'criteria.id')
365
-            ->where('criterion_rubric.rubric_id', '=', $activity->rubric[0]->id)
363
+        $rubric_criterion = DB::table('criteria')
364
+            ->join('rubric_criterion', 'rubric_criterion.criterion_id', '=', 'criteria.id')
365
+            ->where('rubric_criterion.rubric_id', '=', $activity->rubric[0]->id)
366 366
             ->get();
367
-        Log::info($criterion_rubric);
367
+        Log::info($rubric_criterion);
368 368
 
369
-        foreach ($criterion_rubric as $single_cr) {
369
+        foreach ($rubric_criterion as $single_cr) {
370 370
             $single_cr->scales = json_encode(DB::table('scales')
371 371
                 ->join('rubric_criteria_scale', 'rubric_criteria_scale.scale_id', '=', 'scales.id')
372 372
                 ->where('rubric_criteria_scale.rubric_criterion_id', '=', $single_cr->id)
@@ -378,10 +378,10 @@ class RubricsController extends \BaseController
378 378
         }
379 379
 
380 380
 
381
-        Log::info($criterion_rubric);
381
+        Log::info($rubric_criterion);
382 382
 
383 383
         $title = $activity->name . ': ' . $rubric->name;
384
-        return View::make('local.professors.viewrubric', compact('rubric', 'activity', 'criterion_rubric', 'title', 'course'));
384
+        return View::make('local.professors.viewrubric', compact('rubric', 'activity', 'rubric_criterion', 'title', 'course'));
385 385
     }
386 386
 
387 387
     /**
@@ -439,9 +439,9 @@ class RubricsController extends \BaseController
439 439
         Log::info($rubric);
440 440
 
441 441
         $rubric["criteria"] = DB::table("criteria")
442
-            ->join("criterion_rubric", 'criterion_rubric.criterion_id', '=', 'criteria.id')
443
-            ->where("criterion_rubric.id", '=', Input::get('rubric_criterion_id'))
444
-            ->select('name', 'criterion_rubric.notes')
442
+            ->join("rubric_criterion", 'rubric_criterion.criterion_id', '=', 'criteria.id')
443
+            ->where("rubric_criterion.id", '=', Input::get('rubric_criterion_id'))
444
+            ->select('name', 'rubric_criterion.notes')
445 445
             ->first();
446 446
         return json_encode($rubric);
447 447
 

+ 848
- 838
app/controllers/TransformativeActionsController.php
File diff suppressed because it is too large
Näytä tiedosto


+ 2
- 2
app/database/migrations/2021_06_01_000529_create_scales_table.php Näytä tiedosto

@@ -12,8 +12,8 @@ class CreateScalesTable extends Migration
12 12
 			$table->increments('id');
13 13
 
14 14
 			$table->string('description');
15
-			$table->integer('min_score')->unsigned();
16
-			$table->integer('max_score')->unsigned();
15
+			//$table->integer('min_score')->unsigned();
16
+			//$table->integer('max_score')->unsigned();
17 17
 			$table->timestamps();
18 18
 		});
19 19
 	}

+ 2
- 1
app/database/migrations/2021_06_01_235626_create_criteria_table.php Näytä tiedosto

@@ -15,7 +15,8 @@ class CreateCriteriaTable extends Migration
15 15
 			$table->integer('user_id')->unsigned()->nullable();
16 16
 			$table->text('copyright')->nullable();
17 17
 			$table->text('notes')->nullable();
18
-
18
+			$table->integer('num_scales');
19
+			$table->integer('max_score');
19 20
 			$table->timestamps();
20 21
 			$table->timestamp('deleted_at')->nullable();
21 22
 

+ 2
- 2
app/database/migrations/2021_06_02_000507_create_rubrics_table.php Näytä tiedosto

@@ -16,8 +16,8 @@ class CreateRubricsTable extends Migration
16 16
 			$table->integer('expected_points');
17 17
 			$table->integer('user_id')->unsigned();
18 18
 			$table->timestamps();
19
-			$table->integer('num_scales')->unsigned();
20
-			$table->integer('max_score')->unsigned();
19
+			//$table->integer('num_scales')->unsigned();
20
+			//$table->integer('max_score')->unsigned();
21 21
 		});
22 22
 
23 23
 		Schema::table('rubrics', function (Blueprint $table) {

+ 1
- 0
app/database/migrations/2021_06_03_001143_create_transformative_actions_table.php Näytä tiedosto

@@ -17,6 +17,7 @@ class CreateTransformativeActionsTable extends Migration
17 17
 
18 18
 			$table->increments('id');
19 19
 			$table->timestamps();
20
+			$table->string('type_of_TA');
20 21
 			$table->boolean('is_custom');
21 22
 			$table->integer('user_id')->unsigned()->nullable();
22 23
 			$table->integer('program_id')->unsigned()->nullable();

+ 3
- 3
app/database/migrations/2021_06_03_235944_create_courses_table.php Näytä tiedosto

@@ -16,9 +16,9 @@ class CreateCoursesTable extends Migration
16 16
 			$table->integer('program_id')->unsigned();
17 17
 			$table->integer('user_id')->unsigned();
18 18
 			$table->timestamps();
19
-			$table->text('criteria_achieved')->nullable();
20
-			$table->text('outcomes_achieved')->nullable();
21
-			$table->text('outcomes_attempted')->nullable();
19
+			//$table->text('criteria_achieved')->nullable();
20
+			//$table->text('outcomes_achieved')->nullable();
21
+			//$table->text('outcomes_attempted')->nullable();
22 22
 			$table->char('number', 4)->default('0000');
23 23
 		});
24 24
 

+ 8
- 8
app/database/migrations/2021_06_04_003757_create_activities_table.php Näytä tiedosto

@@ -15,19 +15,19 @@ class CreateActivitiesTable extends Migration
15 15
 			$table->integer('course_id')->unsigned()->nullable();
16 16
 
17 17
 			$table->timestamps();
18
-			$table->text('criteria_achieved')->nullable();
19
-			$table->text('criteria_weights')->nullable();
20
-			$table->text('outcomes_achieved')->nullable();
21
-			$table->text('outcomes_attempted')->nullable();
18
+			//$table->text('criteria_achieved')->nullable();
19
+			//$table->text('criteria_weights')->nullable();
20
+			//$table->text('outcomes_achieved')->nullable();
21
+			//$table->text('outcomes_attempted')->nullable();
22 22
 
23 23
 			$table->text('assessment_comments')->nullable();
24
-			$table->text('transforming_actions')->nullable();
25
-			$table->text('criteria_achieved_percentage')->nullable();
24
+			//$table->text('transforming_actions')->nullable();
25
+			//$table->text('criteria_achieved_percentage')->nullable();
26 26
 
27 27
 			$table->date('date');
28 28
 			$table->boolean('draft')->default(0);
29
-			$table->text('criteria_participant_count')->nullable();
30
-			$table->text('criteria_achiever_count')->nullable();
29
+			//$table->text('criteria_participant_count')->nullable();
30
+			//$table->text('criteria_achiever_count')->nullable();
31 31
 
32 32
 			DB::statement('SET FOREIGN_KEY_CHECKS=1;');
33 33
 		});

+ 1
- 1
app/database/migrations/2021_06_04_003810_create_activity_criterion_table.php Näytä tiedosto

@@ -33,7 +33,7 @@ class CreateActivityCriterionTable extends Migration
33 33
 			$table->text('assessment_comments')->nullable();
34 34
 
35 35
 
36
-			$table->decimal('weight', 3, 2)->default(1.0);
36
+			$table->decimal('weight', 6, 2)->default(1.0);
37 37
 
38 38
 			$table->timestamps();
39 39
 		});

+ 3
- 2
app/database/migrations/2021_06_05_235636_create_criterion_rubric.php Näytä tiedosto

@@ -8,7 +8,7 @@ class CreateCriterionRubric extends Migration
8 8
 
9 9
 	public function up()
10 10
 	{
11
-		Schema::create('criterion_rubric', function (Blueprint $table) {
11
+		Schema::create('rubric_criterion', function (Blueprint $table) {
12 12
 			$table->increments('id');
13 13
 			$table->integer('criterion_id')->unsigned();
14 14
 			$table->integer('rubric_id')->unsigned();
@@ -26,6 +26,7 @@ class CreateCriterionRubric extends Migration
26 26
 				->on('rubrics')
27 27
 				->onDelete('cascade')
28 28
 				->onUpdate('cascade');
29
+			$table->integer('position');
29 30
 		});
30 31
 	}
31 32
 
@@ -37,6 +38,6 @@ class CreateCriterionRubric extends Migration
37 38
 	 */
38 39
 	public function down()
39 40
 	{
40
-		Schema::drop('criterion_rubric');
41
+		Schema::drop('rubric_criterion');
41 42
 	}
42 43
 }

+ 1
- 0
app/database/migrations/2021_06_05_235749_create_objective_outcome_table.php Näytä tiedosto

@@ -27,6 +27,7 @@ class CreateObjectiveOutcomeTable extends Migration
27 27
 				->onDelete('cascade')
28 28
 				->onUpdate('cascade');
29 29
 			$table->timestamps();
30
+			$table->unique(array('objective_id', 'outcome_id'));
30 31
 		});
31 32
 	}
32 33
 

+ 7
- 2
app/database/migrations/2021_06_06_000025_create_criterion_objective_outcome_table.php Näytä tiedosto

@@ -11,7 +11,7 @@ class CreateCriterionObjectiveOutcomeTable extends Migration
11 11
 		Schema::create('criterion_objective_outcome', function (Blueprint $table) {
12 12
 			$table->increments('id');
13 13
 			$table->integer('criterion_id')->unsigned();
14
-			$table->integer('objective_id')->unsigned()->nullable();
14
+			$table->integer('objective_id')->unsigned();
15 15
 			$table->integer('outcome_id')->unsigned();
16 16
 			$table
17 17
 				->foreign('criterion_id')
@@ -19,7 +19,7 @@ class CreateCriterionObjectiveOutcomeTable extends Migration
19 19
 				->on('criteria')
20 20
 				->onDelete('cascade')
21 21
 				->onUpdate('cascade');
22
-			$table
22
+			/*$table
23 23
 				->foreign('objective_id')
24 24
 				->references('id')
25 25
 				->on('objectives')
@@ -30,6 +30,11 @@ class CreateCriterionObjectiveOutcomeTable extends Migration
30 30
 				->references('id')
31 31
 				->on('outcomes')
32 32
 				->onDelete('cascade')
33
+				->onUpdate('cascade');*/
34
+			$table->foreign(array('objective_id', 'outcome_id'))
35
+				->references(array('objective_id', 'outcome_id'))
36
+				->on('objective_outcome')
37
+				->onDelete('cascade')
33 38
 				->onUpdate('cascade');
34 39
 			$table->timestamps();
35 40
 		});

+ 0
- 38
app/database/migrations/2021_06_06_000518_create_rubric_criteria_scales_table.php Näytä tiedosto

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

app/database/migrations/2021_06_06_001211_create_transformative_objective_program_table.php → app/database/migrations/2021_06_06_001211_create_transformative_objective_course_table.php Näytä tiedosto

@@ -3,12 +3,12 @@
3 3
 use Illuminate\Database\Schema\Blueprint;
4 4
 use Illuminate\Database\Migrations\Migration;
5 5
 
6
-class CreateTransformativeObjectiveProgramTable extends Migration
6
+class CreateTransformativeObjectiveCourseTable extends Migration
7 7
 {
8 8
 
9 9
 	public function up()
10 10
 	{
11
-		Schema::create('transformative_objective_program', function (Blueprint $table) {
11
+		Schema::create('transformative_objective_course', function (Blueprint $table) {
12 12
 			$table->increments('id');
13 13
 			$table->timestamps();
14 14
 
@@ -26,12 +26,15 @@ class CreateTransformativeObjectiveProgramTable extends Migration
26 26
 				->onDelete('cascade')
27 27
 				->onUpdate('cascade');
28 28
 
29
-			$table->integer('program_id')->unsigned();
29
+			$table->string('course_code');
30
+			$table->string('course_number');
31
+
32
+			/*$table->integer('program_id')->unsigned();
30 33
 			$table->foreign('program_id')
31 34
 				->references('id')
32 35
 				->on('programs')
33 36
 				->onDelete('cascade')
34
-				->onUpdate('cascade');
37
+				->onUpdate('cascade');*/
35 38
 		});
36 39
 	}
37 40
 
@@ -42,6 +45,6 @@ class CreateTransformativeObjectiveProgramTable extends Migration
42 45
 	 */
43 46
 	public function down()
44 47
 	{
45
-		Schema::drop('transformative_objective_program');
48
+		Schema::drop('transformative_objective_course');
46 49
 	}
47 50
 }

+ 1
- 0
app/database/migrations/2021_06_07_001028_create_templates_criterion_table.php Näytä tiedosto

@@ -22,6 +22,7 @@ class CreateTemplatesCriterionTable extends Migration
22 22
 				->on('templates')
23 23
 				->onDelete('cascade')
24 24
 				->onUpdate('cascade');
25
+			$table->integer('position')->unsigned();
25 26
 		});
26 27
 	}
27 28
 

+ 0
- 38
app/database/migrations/2021_06_07_001036_create_templates_criterion_scale_table.php Näytä tiedosto

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

+ 3
- 3
app/database/migrations/2021_06_15_235856_create_annual_plan_transformative_table.php Näytä tiedosto

@@ -27,10 +27,10 @@ class CreateAnnualPlanTransformativeTable extends Migration
27 27
 				->on('annual_plans')
28 28
 				->onDelete('cascade')
29 29
 				->onUpdate('cascade');
30
-			$table->integer('typ_semester_objective_id')->unsigned();
31
-			$table->foreign('typ_semester_objective_id')
30
+			$table->integer('typ_semester_course_id')->unsigned();
31
+			$table->foreign('typ_semester_course_id')
32 32
 				->references('id')
33
-				->on('typ_semester_objectives')
33
+				->on('typ_semester_courses')
34 34
 				->onDelete('cascade')
35 35
 				->onUpdate('cascade');
36 36
 			$table->integer('proposing_coordinator_id')->unsigned();

+ 0
- 34
app/database/migrations/2021_06_22_150017_delete_min_max_scales.php Näytä tiedosto

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

+ 0
- 41
app/database/migrations/2021_06_22_150108_add_copyright_notes_rubric_criterion.php Näytä tiedosto

@@ -1,41 +0,0 @@
1
-<?php
2
-
3
-use Illuminate\Database\Schema\Blueprint;
4
-use Illuminate\Database\Migrations\Migration;
5
-use Illuminate\Support\Facades\Schema;
6
-
7
-class AddCopyrightNotesRubricCriterion extends Migration
8
-{
9
-
10
-	/**
11
-	 * Run the migrations.
12
-	 *
13
-	 * @return void
14
-	 */
15
-	public function up()
16
-	{
17
-		Schema::table('criterion_rubric', function (Blueprint $table) {
18
-			$table->text('copyright')->nullable();
19
-			$table->text('notes')->nullable();
20
-		});
21
-		Schema::table('template_criterion', function (Blueprint $table) {
22
-			$table->text('copyright')->nullable();
23
-			$table->text('notes')->nullable();
24
-		});
25
-	}
26
-
27
-	/**
28
-	 * Reverse the migrations.
29
-	 *
30
-	 * @return void
31
-	 */
32
-	public function down()
33
-	{
34
-		Schema::table('criterion_rubric', function (Blueprint $table) {
35
-			$table->dropColumn(array('copyright', 'notes'));
36
-		});
37
-		Schema::table('template_criterion', function (Blueprint $table) {
38
-			$table->dropColumn(array('copyright', 'notes'));
39
-		});
40
-	}
41
-}

+ 0
- 34
app/database/migrations/2021_06_22_150135_change_weight_float.php Näytä tiedosto

@@ -1,34 +0,0 @@
1
-<?php
2
-
3
-use Illuminate\Database\Schema\Blueprint;
4
-use Illuminate\Database\Migrations\Migration;
5
-
6
-class ChangeWeightFloat extends Migration
7
-{
8
-
9
-	/**
10
-	 * Run the migrations.
11
-	 *
12
-	 * @return void
13
-	 */
14
-	public function up()
15
-	{
16
-		Schema::table('activity_criterion', function (Blueprint $table) {
17
-
18
-			DB::statement("ALTER TABLE `activity_criterion` MODIFY COLUMN `weight` decimal(6,2)");
19
-		});
20
-	}
21
-
22
-	/**
23
-	 * Reverse the migrations.
24
-	 *
25
-	 * @return void
26
-	 */
27
-	public function down()
28
-	{
29
-		Schema::table('activity_criterion', function (Blueprint $table) {
30
-
31
-			DB::statement("ALTER TABLE `activity_criterion` MODIFY COLUMN `weight` decimal(3,2)");
32
-		});
33
-	}
34
-}

app/database/migrations/2021_07_09_150819_edit_rubric_criterion.php → app/database/migrations/2021_07_05_083455_create_titles.php Näytä tiedosto

@@ -3,7 +3,7 @@
3 3
 use Illuminate\Database\Schema\Blueprint;
4 4
 use Illuminate\Database\Migrations\Migration;
5 5
 
6
-class EditRubricCriterion extends Migration
6
+class CreateTitles extends Migration
7 7
 {
8 8
 
9 9
 	/**
@@ -13,8 +13,9 @@ class EditRubricCriterion extends Migration
13 13
 	 */
14 14
 	public function up()
15 15
 	{
16
-		Schema::table('criterion_rubric', function (Blueprint $table) {
17
-			$table->integer('position');
16
+		Schema::create('titles', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->string('text');
18 19
 		});
19 20
 	}
20 21
 
@@ -25,8 +26,6 @@ class EditRubricCriterion extends Migration
25 26
 	 */
26 27
 	public function down()
27 28
 	{
28
-		Schema::table('criterion_rubric', function (Blueprint $table) {
29
-			$table->dropColumn('position');
30
-		});
29
+		Schema::drop('titles');
31 30
 	}
32 31
 }

+ 0
- 43
app/database/migrations/2021_07_06_075249_fix_activities.php Näytä tiedosto

@@ -1,43 +0,0 @@
1
-<?php
2
-
3
-use Illuminate\Database\Schema\Blueprint;
4
-use Illuminate\Database\Migrations\Migration;
5
-
6
-class FixActivities 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->dropColumn(array(
18
-				'criteria_achieved',
19
-				'outcomes_attempted', 'outcomes_achieved',
20
-				'criteria_weights', 'criteria_achieved_percentage',
21
-				'criteria_participant_count', 'criteria_achiever_count'
22
-			));
23
-		});
24
-	}
25
-
26
-	/**
27
-	 * Reverse the migrations.
28
-	 *
29
-	 * @return void
30
-	 */
31
-	public function down()
32
-	{
33
-		Schema::table('activities', function (Blueprint $table) {
34
-			$table->text('criteria_achieved')->nullable();
35
-			$table->text('criteria_weights')->nullable();
36
-			$table->text('outcomes_achieved')->nullable();
37
-			$table->text('outcomes_attempted')->nullable();
38
-			$table->text('criteria_achieved_percentage')->nullable();
39
-			$table->text('criteria_participant_count')->nullable();
40
-			$table->text('criteria_achiever_count')->nullable();
41
-		});
42
-	}
43
-}

+ 6
- 1
app/database/migrations/2021_07_06_082232_rubric_titles.php Näytä tiedosto

@@ -15,7 +15,12 @@ class RubricTitles extends Migration
15 15
 	{
16 16
 		Schema::create('rubric_title', function (Blueprint $table) {
17 17
 			$table->increments('id');
18
-			$table->string('title');
18
+			$table->integer('title_id')->unsigned();
19
+			$table->foreign('title_id')
20
+				->references('id')
21
+				->on('titles')
22
+				->onDelete('cascade')
23
+				->onUpdate('cascade');
19 24
 			$table->integer('position');
20 25
 			$table->integer('rubric_id')->unsigned();
21 26
 			$table->foreign('rubric_id')

+ 6
- 1
app/database/migrations/2021_07_06_085513_template_titles.php Näytä tiedosto

@@ -15,7 +15,12 @@ class TemplateTitles extends Migration
15 15
 	{
16 16
 		Schema::create('template_title', function (Blueprint $table) {
17 17
 			$table->increments('id');
18
-			$table->string('title');
18
+			$table->integer('title_id')->unsigned();
19
+			$table->foreign('title_id')
20
+				->references('id')
21
+				->on('titles')
22
+				->onDelete('cascade')
23
+				->onUpdate('cascade');
19 24
 			$table->integer('position');
20 25
 			$table->integer('template_id')->unsigned();
21 26
 			$table->foreign('template_id')

+ 0
- 33
app/database/migrations/2021_07_08_093000_add_max_num_to_criteria.php Näytä tiedosto

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

+ 0
- 32
app/database/migrations/2021_07_09_150656_edit_template_criterion.php Näytä tiedosto

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

app/database/migrations/2021_07_06_130407_create_transformative_objective_activity.php → app/database/migrations/2021_07_22_092532_create_transformative_activity_criterion.php Näytä tiedosto

@@ -3,7 +3,7 @@
3 3
 use Illuminate\Database\Schema\Blueprint;
4 4
 use Illuminate\Database\Migrations\Migration;
5 5
 
6
-class CreateTransformativeObjectiveActivity extends Migration
6
+class CreateTransformativeActivityCriterion extends Migration
7 7
 {
8 8
 
9 9
 	/**
@@ -13,24 +13,20 @@ class CreateTransformativeObjectiveActivity extends Migration
13 13
 	 */
14 14
 	public function up()
15 15
 	{
16
-		Schema::create('transformative_objective_activity', function (Blueprint $table) {
16
+		Schema::create('transformative_activity_criterion', function (Blueprint $table) {
17 17
 			$table->increments('id');
18 18
 			$table->integer('trans_action_id')->unsigned();
19
-			$table->integer('activity_id')->unsigned();
20
-			$table->integer('objective_id')->unsigned();
21
-			$table->foreign('objective_id')
22
-				->references('id')
23
-				->on('objectives')
24
-				->onDelete('cascade')
25
-				->onUpdate('cascade');
19
+			$table->integer('activity_criterion_id')->unsigned();
20
+
21
+
26 22
 			$table->foreign('trans_action_id')
27 23
 				->references('id')
28 24
 				->on('transformative_actions')
29 25
 				->onDelete('cascade')
30 26
 				->onUpdate('cascade');
31
-			$table->foreign('activity_id')
27
+			$table->foreign('activity_criterion_id')
32 28
 				->references('id')
33
-				->on('activities')
29
+				->on('activity_criterion')
34 30
 				->onDelete('cascade')
35 31
 				->onUpdate('cascade');
36 32
 		});
@@ -43,6 +39,6 @@ class CreateTransformativeObjectiveActivity extends Migration
43 39
 	 */
44 40
 	public function down()
45 41
 	{
46
-		Schema::drop('transformative_objective_activity');
42
+		Schema::drop('transformative_activity_criterion');
47 43
 	}
48 44
 }

+ 2
- 2
app/database/old_migrations/2020_04_22_095649_create_new_criterion_rubric_table.php Näytä tiedosto

@@ -13,7 +13,7 @@ class CreateNewCriterionRubricTable extends Migration
13 13
 	 */
14 14
 	public function up()
15 15
 	{
16
-		Schema::create('criterion_rubric', function (Blueprint $table) {
16
+		Schema::create('rubric_criterion', function (Blueprint $table) {
17 17
 			$table->increments('id');
18 18
 			$table->integer('criterion_id')->unsigned();
19 19
 			$table->integer('rubric_id')->unsigned();
@@ -42,6 +42,6 @@ class CreateNewCriterionRubricTable extends Migration
42 42
 	 */
43 43
 	public function down()
44 44
 	{
45
-		Schema::drop('criterion_rubric');
45
+		Schema::drop('rubric_criterion');
46 46
 	}
47 47
 }

+ 2
- 2
app/database/old_migrations/2021_03_29_151507_create_transformative_objective_program.php Näytä tiedosto

@@ -13,7 +13,7 @@ class CreateTransformativeObjectiveProgram extends Migration
13 13
 	 */
14 14
 	public function up()
15 15
 	{
16
-		Schema::create('transformative_objective_program', function (Blueprint $table) {
16
+		Schema::create('transformative_objective_course', function (Blueprint $table) {
17 17
 			$table->increments('id');
18 18
 			$table->timestamps();
19 19
 
@@ -47,6 +47,6 @@ class CreateTransformativeObjectiveProgram extends Migration
47 47
 	 */
48 48
 	public function down()
49 49
 	{
50
-		Schema::drop('transformative_objective_program');
50
+		Schema::drop('transformative_objective_course');
51 51
 	}
52 52
 }

+ 1
- 1
app/database/old_migrations/2021_05_20_184230_create_rubric_scales.php Näytä tiedosto

@@ -25,7 +25,7 @@ class CreateRubricScales extends Migration
25 25
 				->onUpdate('cascade');
26 26
 			$table->foreign('rubric_criterion_id')
27 27
 				->references('id')
28
-				->on('criterion_rubric')
28
+				->on('rubric_criterion')
29 29
 				->onDelete('cascade')
30 30
 				->onUpdate('cascade');
31 31
 			$table->integer('position');

+ 5
- 5
app/database/seeds/FillNewAssessmentActivityCriterion.php Näytä tiedosto

@@ -10,10 +10,10 @@ class FillNewAssessmentActivityCriterion extends Seeder
10 10
 		$activities = DB::table('activities')
11 11
 			->join('rubric_activity', 'activities.id', '=', 'rubric_activity.activity_id')
12 12
 			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
13
-			->join('criterion_rubric', 'rubrics.id', '=', 'criterion_rubric.rubric_id')
14
-			->select('activities.*', 'rubrics.expected_percentage', 'rubrics.expected_points', 'criterion_rubric.criterion_id')
13
+			->join('rubric_criterion', 'rubrics.id', '=', 'rubric_criterion.rubric_id')
14
+			->select('activities.*', 'rubrics.expected_percentage', 'rubrics.expected_points', 'rubric_criterion.criterion_id')
15 15
 			->orderBy('activities.id')
16
-			->orderBy('criterion_rubric.criterion_id')
16
+			->orderBy('rubric_criterion.criterion_id')
17 17
 			->get();
18 18
 		//   DB::enableQueryLog();
19 19
 		// 		dd(DB::getQueryLog());
@@ -83,9 +83,9 @@ class FillNewAssessmentActivityCriterion extends Seeder
83 83
 					// 					var_dump($criterion_id);
84 84
 					var_dump($assessment);
85 85
 					// 					$activities=DB::table('activities')->where('id', $activity_id)->first();
86
-					// 					$criterion_rubric=DB::table('criterion_rubric')->where('criterion_id', $criterion_id)->first();
86
+					// 					$rubric_criterion=DB::table('rubric_criterion')->where('criterion_id', $criterion_id)->first();
87 87
 					// 					var_dump($activities);
88
-					// 					var_dump($criterion_rubric);
88
+					// 					var_dump($rubric_criterion);
89 89
 					// 					exit();
90 90
 					$activity_criterion_id = DB::table('activity_criterion')->insertGetId(
91 91
 						array(

+ 2
- 2
app/database/seeds/FillNewCriterionRubric.php Näytä tiedosto

@@ -59,9 +59,9 @@ class FillNewCriterionRubric extends Seeder
59 59
 					if (empty($existe2)) {
60 60
 						DB::table('criteria')->insert($criterion);
61 61
 					}
62
-					$existe3 = (array)DB::table('criterion_rubric')->where('criterion_id', $criterion["id"])->where('rubric_id', $rubric->id)->first();
62
+					$existe3 = (array)DB::table('rubric_criterion')->where('criterion_id', $criterion["id"])->where('rubric_id', $rubric->id)->first();
63 63
 					if (empty($existe3)) {
64
-						DB::table('criterion_rubric')->insert(
64
+						DB::table('rubric_criterion')->insert(
65 65
 							array('criterion_id' => $dato["id"], 'rubric_id' => $rubric->id)
66 66
 						);
67 67
 					}

+ 4
- 2
app/models/Course.php Näytä tiedosto

@@ -33,12 +33,14 @@ class Course extends Eloquent
33 33
 
34 34
   public function assessedActivities()
35 35
   {
36
-    return $this->hasMany('Activity')->whereNotNull('activities.outcomes_attempted')->orderBy('date', 'asc');
36
+    // return $this->hasMany('Activity')->whereNotNull('activities.outcomes_attempted')->orderBy('date', 'asc');
37
+    return $this->hasMany('Activity')->where('activities.draft', 0)->orderBy('date', 'asc');
37 38
   }
38 39
 
39 40
   public function publishedActivities()
40 41
   {
41
-    return $this->hasMany('Activity')->whereNotNull('activities.outcomes_attempted')->where('activities.draft', 0)->orderBy('date', 'asc');
42
+    //return $this->hasMany('Activity')->whereNotNull('activities.outcomes_attempted')->where('activities.draft', 0)->orderBy('date', 'asc');
43
+    return $this->hasMany('Activity')->where('activities.draft', 0)->orderBy('date', 'asc');
42 44
   }
43 45
 
44 46
   public function outcomes_attempted()

+ 44
- 46
app/models/Criterion.php Näytä tiedosto

@@ -7,8 +7,8 @@ class Criterion extends Eloquent
7 7
 	use SoftDeletingTrait;
8 8
 	protected $dates = ['deleted_at'];
9 9
 
10
-//     protected $table = 'new_criteria';
11
-    protected $table = 'criteria';
10
+	//     protected $table = 'new_criteria';
11
+	protected $table = 'criteria';
12 12
 
13 13
 	public function outcomes()
14 14
 	{
@@ -23,11 +23,11 @@ class Criterion extends Eloquent
23 23
 		return $this->belongsToMany('Objective');
24 24
 	}
25 25
 
26
-    public function rubrics()
27
-    {
28
-//         return $this->belongsToMany('Rubric', 'new_criterion_rubric');
29
-        return $this->belongsToMany('Rubric', 'criterion_rubric');
30
-    }
26
+	public function rubrics()
27
+	{
28
+		//         return $this->belongsToMany('Rubric', 'new_rubric_criterion');
29
+		return $this->belongsToMany('Rubric', 'rubric_criterion');
30
+	}
31 31
 
32 32
 	/**
33 33
 	 * Return the program that the criterion belongs to
@@ -63,18 +63,17 @@ class Criterion extends Eloquent
63 63
 			->select('activity_criterion.id')
64 64
 			->distinct()
65 65
 			->get();
66
-			
67
-		foreach($activities_criterions as $activity_criterion)
68
-		{
69
-		
70
-// 			 $students_attempted+=DB::table('new_assessments')
71
-// 				->join('activity_criterion', 'new_assessments.activity_criterion_id', '=', 'activity_criterion.id')
72
-// 				->where('activity_criterion.id',$activity_criterion->id)
73
-// 				->count();
74
-		
75
-			 $students_attempted+=DB::table('assessments')
66
+
67
+		foreach ($activities_criterions as $activity_criterion) {
68
+
69
+			// 			 $students_attempted+=DB::table('new_assessments')
70
+			// 				->join('activity_criterion', 'new_assessments.activity_criterion_id', '=', 'activity_criterion.id')
71
+			// 				->where('activity_criterion.id',$activity_criterion->id)
72
+			// 				->count();
73
+
74
+			$students_attempted += DB::table('assessments')
76 75
 				->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
77
-				->where('activity_criterion.id',$activity_criterion->id)
76
+				->where('activity_criterion.id', $activity_criterion->id)
78 77
 				->count();
79 78
 		}
80 79
 		return $students_attempted;
@@ -82,41 +81,40 @@ class Criterion extends Eloquent
82 81
 
83 82
 	public static function students_achieved($criterion_id, $activity_id)
84 83
 	{
85
-		$students_achieved=0;
86
-// 		$activities_criterions=DB::table('activity_criterion')
87
-// 			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
88
-// 			->join('courses', 'activities.course_id', '=', 'courses.id')
89
-// 			->where('activities.id','=',$activity_id)
90
-// 			->where('activity_criterion.criterion_id','=',$criterion_id)
91
-// 			->select('activity_criterion.id','expected_student_score')
92
-// 			->distinct()
93
-// 			->get();
94
-
95
-		$activities_criterions=DB::table('activity_criterion')
84
+		$students_achieved = 0;
85
+		// 		$activities_criterions=DB::table('activity_criterion')
86
+		// 			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
87
+		// 			->join('courses', 'activities.course_id', '=', 'courses.id')
88
+		// 			->where('activities.id','=',$activity_id)
89
+		// 			->where('activity_criterion.criterion_id','=',$criterion_id)
90
+		// 			->select('activity_criterion.id','expected_student_score')
91
+		// 			->distinct()
92
+		// 			->get();
93
+
94
+		$activities_criterions = DB::table('activity_criterion')
96 95
 			->join('activities', 'activity_criterion.activity_id', '=', 'activities.id')
97 96
 			->join('courses', 'activities.course_id', '=', 'courses.id')
98 97
 			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
99 98
 			->join('rubrics', 'rubric_activity.rubric_id', '=', 'rubrics.id')
100
-			->where('activities.id','=',$activity_id)
101
-			->where('activity_criterion.criterion_id','=',$criterion_id)
102
-			->select('activity_criterion.id','expected_points')
99
+			->where('activities.id', '=', $activity_id)
100
+			->where('activity_criterion.criterion_id', '=', $criterion_id)
101
+			->select('activity_criterion.id', 'expected_points')
103 102
 			->distinct()
104 103
 			->get();
105
-			
106
-		foreach($activities_criterions as $activity_criterion)
107
-		{
108
-		
109
-// 			$expected_student_score=DB::table('new_criteria')->where('id',$criterion_id)->select('expected_student_score')->get();
110
-// 			 $students_achieved+=DB::table('new_assessments')
111
-// 				->join('activity_criterion', 'new_assessments.activity_criterion_id', '=', 'activity_criterion.id')
112
-// 				->where('activity_criterion.id',$activity_criterion->id)
113
-// 				->where('new_assessments.score','>=',$activity_criterion->expected_student_score)
114
-// 				->count();
115
-
116
-			 $students_achieved+=DB::table('assessments')
104
+
105
+		foreach ($activities_criterions as $activity_criterion) {
106
+
107
+			// 			$expected_student_score=DB::table('new_criteria')->where('id',$criterion_id)->select('expected_student_score')->get();
108
+			// 			 $students_achieved+=DB::table('new_assessments')
109
+			// 				->join('activity_criterion', 'new_assessments.activity_criterion_id', '=', 'activity_criterion.id')
110
+			// 				->where('activity_criterion.id',$activity_criterion->id)
111
+			// 				->where('new_assessments.score','>=',$activity_criterion->expected_student_score)
112
+			// 				->count();
113
+
114
+			$students_achieved += DB::table('assessments')
117 115
 				->join('activity_criterion', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
118
-				->where('activity_criterion.id',$activity_criterion->id)
119
-				->where('assessments.score','>=',$activity_criterion->expected_points)
116
+				->where('activity_criterion.id', $activity_criterion->id)
117
+				->where('assessments.score', '>=', $activity_criterion->expected_points)
120 118
 				->count();
121 119
 		}
122 120
 		return $students_achieved;

+ 1
- 1
app/models/Objective.php Näytä tiedosto

@@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\SoftDeletingTrait;
5 5
 class Objective extends Eloquent
6 6
 {
7 7
     use SoftDeletingTrait;
8
-    protected $fillable = array('text', 'outcome_id', 'program_id', 'active');
8
+    protected $fillable = array('text', 'outcome_id',  'active');
9 9
     protected $table = 'objectives';
10 10
 
11 11
     /**

+ 5
- 0
app/routes.php Näytä tiedosto

@@ -166,6 +166,11 @@ Route::group(array('before' => 'auth|has_access'), function () {
166 166
     /**
167 167
      * Shared Routes
168 168
      */
169
+
170
+    Route::post('changeStatusOfCriterion', array(
171
+        'as' => 'changeStatusOfCriterion',
172
+        'uses' => 'CriteriaController@changeStatus'
173
+    ));
169 174
     Route::post('createThreeYearCycle', array(
170 175
         'as' => 'createThreeYearCycle',
171 176
         'uses' => 'ThreeYearPlanController@create'

+ 356
- 4
app/views/global/view-learning-outcomes-criteria.blade.php
File diff suppressed because it is too large
Näytä tiedosto


+ 0
- 1044
app/views/local/managers/admins/new_criteria.blade.php
File diff suppressed because it is too large
Näytä tiedosto


+ 1275
- 0
app/views/local/managers/pCoords/new_criteria.blade.php
File diff suppressed because it is too large
Näytä tiedosto


+ 45
- 20
app/views/local/managers/shared/rubrics.blade.php Näytä tiedosto

@@ -195,12 +195,19 @@
195 195
             <form>
196 196
                 <div class="form-group">
197 197
                     <label>Select a Learning Outcome</label>
198
-                    <select id="select-outcome" class="form-control selectpicker">
198
+                    <select id="select-outcome" class="form-control selectpicker" onchange="fetchObjective(this)">
199 199
                         @foreach ($outcomes as $outcome)
200 200
                         <option data-outcome-id="{{ $outcome->id }}">{{ $outcome->name }}</option>
201 201
                         @endforeach
202 202
                     </select>
203 203
                 </div>
204
+                <div class="form-group">
205
+                    <label>Select an Objective</label>
206
+                    <select id="select-objective" class="form-control selectpicker" onchange="fetchCriteria($('#select-outcome'), this)">
207
+                        
208
+                    </select>
209
+                </div>
210
+
204 211
                     <div class="form-group">
205 212
                         <label>Select the Maximum Score</label>
206 213
                     <select id="max_score" class="form-control selectpicker">
@@ -310,8 +317,28 @@
310 317
 // Functions
311 318
 // --------------------------------------------------------------------------
312 319
 
320
+function fetchObjective(outcome){
321
+    $.post(
322
+        "{{URL::route('fetchObjectivesForSelect')}}",
323
+        {
324
+            outcomeID:$(outcome).find(':selected').data('outcome-id'),
325
+        },
326
+        function(data){
327
+            options = '';
328
+            for(objective_index in data){
329
+                options += '<option value = "'+data[objective_index].objective_id+'">'+data[objective_index].text+'</option>';
330
+
331
+            }
332
+            $('#select-objective').html(options);
333
+            $('#select-objective').selectpicker('refresh');
334
+            fetchCriteria($('#select-outcome'), $('#select-objective'));
335
+
336
+        }, 'json',
337
+    );
338
+
339
+}
313 340
 // Fetch criteria associated to a specific learning outcome
314
-function fetchCriteria(outcome)
341
+function fetchCriteria(outcome, objective)
315 342
 {
316 343
     $.post
317 344
     (
@@ -428,7 +455,7 @@ function addCriterion()
428 455
 
429 456
             if(notes)
430 457
             {
431
-                str+='<span><em data-toggle="tooltip" data-placement="top" title="'+notes+'">'+name+'</em></span><sup></sup>'+subcriteria+'</td>';
458
+                str+='<span><em data-toggle="tooltip" data-placement="top" title="'+notes+'">'+data.criterion.name+'</em></span><sup></sup>'+subcriteria+'</td>';
432 459
             }
433 460
             else
434 461
             {
@@ -446,17 +473,15 @@ function addCriterion()
446 473
                 str+='<td class="editable" data-type="textarea"></td>';
447 474
             }
448 475
         }
449
-        if(copyright== null) copyright= '';
450
-        if(notes == null)notes ='';
451
-        str += '<td class = "editable nullable" data-type = "textarea">'+copyright+'</td>';
452
-        str+= '<td class = "editable nullable" data-type = "textarea">'+notes+'</td>';
476
+        str+= '<td>'+data.outcomes+'</td>'
477
+        
453 478
 
454 479
             str +='<th><span class="glyphicon glyphicon-remove icon-btn" aria-hidden="true"></span></th></tr>';
455 480
 
456 481
             $('table tbody').append(str);
457 482
 
458 483
             // Build copyright list
459
-            buildOutcomeList();
484
+            buildCopyrightList();
460 485
 
461 486
             // Enable X-Edtable on this new row
462 487
             $('.editable').editable({
@@ -506,7 +531,7 @@ function fetchCriterion(criterion)
506 531
 }
507 532
 
508 533
 // Build list from copyright info in rubric
509
-function buildOutcomeList()
534
+function buildCopyrightList()
510 535
 {
511 536
     // Empty the copyright list
512 537
     $('#copyright-list').empty();
@@ -515,15 +540,15 @@ function buildOutcomeList()
515 540
     {
516 541
         var criterion = $(this);
517 542
         // If there's copyright info
518
-        if(criterion.data('outcomes')!=null){
519
-            var outcomes = criterion.data('outcomes');
543
+        if(criterion.data('copyright')!=null){
544
+            var copyright = criterion.data('copyright');
520 545
             if($('#copyright-list li').length>0)
521 546
             {
522 547
                 var found = false;
523 548
                 $('#copyright-list li').each(function()
524 549
                 {
525 550
                     // If found, give the string its number
526
-                    if(outcomes==$(this).find('span').text())
551
+                    if(copyright==$(this).find('span').text())
527 552
                     {
528 553
 
529 554
                         copyrightNumber = Number.parseInt($(this).find('sup').text());
@@ -548,13 +573,13 @@ function buildOutcomeList()
548 573
                     console.log(criterion.children('td:nth-child(2)').find('sup').length);
549 574
 
550 575
                     criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
551
-                    $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+outcomes+'<span></li>');
576
+                    $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
552 577
                 }
553 578
             }
554 579
             else
555 580
             {
556 581
                 criterion.children('td:nth-child(2)').find('sup').text('1');
557
-                $('#copyright-list').append('<li><sup>1 </sup><span>'+outcomes+'<span></li>');
582
+                $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
558 583
             }
559 584
         }
560 585
     });
@@ -825,7 +850,7 @@ function loadTemplate()
825 850
                 $('table tbody').append(str);
826 851
 
827 852
                 // Build copyright list
828
-                buildOutcomeList();
853
+                buildCopyrightList();
829 854
 
830 855
                 // Enable X-Edtable on this new row
831 856
                 $('.editable').editable({
@@ -850,7 +875,7 @@ function loadTemplate()
850 875
             });
851 876
 
852 877
             // Build Copyright List
853
-            buildOutcomeList();
878
+            buildCopyrightList();
854 879
 
855 880
             var selected = $('#select-template').find(':selected');
856 881
         var programs = {{ json_encode(Auth::user()->programs->lists('id')) }};
@@ -1033,7 +1058,7 @@ function changeTable(){
1033 1058
                 counter++;
1034 1059
             }
1035 1060
             }
1036
-            newScaleHeaders += '<th>Copyright</th><th>Notes</th><th></th>';
1061
+            newScaleHeaders += '<th>Outcomes</th><th></th>';
1037 1062
             
1038 1063
             $("#criterion-header").html(newScaleHeaders);
1039 1064
             $('#allCriteria').html(' ');
@@ -1079,11 +1104,11 @@ $('#number_of_scales').on('change', function(){
1079 1104
     changeTable();
1080 1105
 })
1081 1106
 // When a learning outcome changes, update its criteria
1082
-$('#select-outcome, input[name=criteria-filter]').on('change', function()
1107
+/*$('#select-outcome, input[name=criteria-filter]').on('change', function()
1083 1108
 {
1084 1109
     fetchCriteria($('#select-outcome'));
1085 1110
 });
1086
-
1111
+*/
1087 1112
 // When the add button is clicked
1088 1113
 $('#button-add-criterion').on('click', function(e)
1089 1114
 {
@@ -1267,7 +1292,7 @@ $('table').on('click', 'span.glyphicon-remove', function(e)
1267 1292
         $('#rubric-container').hide();
1268 1293
     }
1269 1294
 
1270
-    buildOutcomeList();
1295
+    buildCopyrightList();
1271 1296
 });
1272 1297
 
1273 1298
 // When print button is clicked, redirect to print page

+ 5
- 5
app/views/local/professors/assessment.blade.php Näytä tiedosto

@@ -103,7 +103,7 @@
103 103
                 <tr>
104 104
                     <th>
105 105
                     </th>
106
-                    @foreach ($criterion_rubric as $index => $criterion)
106
+                    @foreach ($rubric_criterion as $index => $criterion)
107 107
                     <th  data-criterion-id="{{{ $criterion->criterion_id }}}" ><div class="th-box">
108 108
                         
109 109
                         Weight<input class="form-control" id="weight-{{$index}}" name='weight[]' type="text"  value="{{$criterion->weight}}" data-activity-criterion-id="{{$criterion->activity_criterion_id}}">
@@ -116,7 +116,7 @@
116 116
                                 Student
117 117
                             </div>
118 118
                         </th>
119
-                        @foreach ($criterion_rubric as $criterion)
119
+                        @foreach ($rubric_criterion as $criterion)
120 120
                             <th class="criterion-field" data-activity-criterion-id = "{{$criterion->activity_criterion_id}}"data-rubric-criterion-id = "{{$criterion->rubric_criterion_id}}" data-criterion-id="{{{ $criterion->criterion_id }}}" ><div class="th-box">{{ $criterion->name}}</div></th>
121 121
                         @endforeach
122 122
                         <th>Student Percentage</th>
@@ -137,7 +137,7 @@
137 137
                         </td>
138 138
 
139 139
                         <!-- For each criterion in the rubric, there's a score field -->
140
-                        @for ($i = 0; $i<sizeof($criterion_rubric); $i++)
140
+                        @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
141 141
                             <td class="score-field">
142 142
                                 <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}">
143 143
                                 <!-- Option from 0-8 -->
@@ -170,7 +170,7 @@
170 170
                 @foreach ($students as $student)
171 171
                     <tr class="student-row">
172 172
                         <td class="student-field" data-student-id={{ $student->id }}>{{{ $student->name }}}</td>
173
-                        @for ($i = 0; $i<sizeof($criterion_rubric); $i++)
173
+                        @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
174 174
                             <td class="score-field" data-weight = '1'>
175 175
                                 <select name="" id="" class="form-control" data-toggle="tooltip" data-placement="right" title="{{{ $student->name }}}">
176 176
                                     @for($j=0; $j<=$rubric->max_score; $j++)
@@ -192,7 +192,7 @@
192 192
                     <td>
193 193
                         <strong>Passed Criteria Percentage </strong>
194 194
                     </td>
195
-                    @for ($i = 0; $i<sizeof($criterion_rubric); $i++)
195
+                    @for ($i = 0; $i<sizeof($rubric_criterion); $i++)
196 196
                         <td class="total"><strong><span class="total-value"></span><span class="percent-sign">%</span></strong>
197 197
                         </td>
198 198
                     @endfor

+ 1
- 1
app/views/local/professors/viewrubric.blade.php Näytä tiedosto

@@ -39,7 +39,7 @@
39 39
           </tr>
40 40
         </thead>
41 41
         <tbody>
42
-        @foreach($criterion_rubric as $index => $criterion)
42
+        @foreach($rubric_criterion as $index => $criterion)
43 43
           <tr data-criterion-copyright="{{ $criterion->copyright }}" data-criterion-notes="{{ $criterion->notes }}">
44 44
             <td>{{ $index + 1 }}.</td>
45 45
             @if(isset($criterion->notes))