Nessuna descrizione

Activity.php 835B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. class Activity extends Eloquent
  3. {
  4. public function section()
  5. {
  6. return $this->belongsTo('Section');
  7. }
  8. public function rubric()
  9. {
  10. return $this->belongsTo('Rubric');
  11. }
  12. public function course()
  13. {
  14. return $this->belongsTo('Course');
  15. }
  16. public function assessed_students()
  17. {
  18. return $this->belongsToMany('Student', 'assessments')->withPivot('scores', 'percentage')->withTimestamps();
  19. }
  20. // cap_array
  21. public function getCapArrayAttribute($value)
  22. {
  23. return json_decode($this->criteria_achieved_percentage, true);
  24. }
  25. // o_ach_array
  26. public function getOAchArrayAttribute($value)
  27. {
  28. return json_decode($this->outcomes_achieved, true);
  29. }
  30. // o_att_array
  31. public function getOAttArrayAttribute($value)
  32. {
  33. return json_decode($this->outcomes_attempted, true);
  34. }
  35. }