123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
-
- class Activity extends Eloquent
- {
-
- public function section()
- {
- return $this->belongsTo('Section');
- }
-
- public function rubric()
- {
- // return $this->belongsTo('Rubric');
- return $this->belongsToMany('Rubric','new_rubric_activity');
- }
-
- public function course()
- {
- return $this->belongsTo('Course');
- }
-
- public function assessed_students()
- {
- return $this->belongsToMany('Student', 'assessments')->withPivot('scores', 'percentage')->withTimestamps();
- }
-
- // cap_array
- public function getCapArrayAttribute($value)
- {
- return json_decode($this->criteria_achieved_percentage, true);
- }
-
- // o_ach_array
- public function getOAchArrayAttribute($value)
- {
- return json_decode($this->outcomes_achieved, true);
- }
-
- // o_att_array
- public function getOAttArrayAttribute($value)
- {
- return json_decode($this->outcomes_attempted, true);
- }
-
- }
|