Beispiel #1
0
 public function __construct(attforblock $att)
 {
     global $CFG;
     $this->perm = $att->perm;
     $this->pageparams = $att->pageparams;
     $this->users = $att->get_users($att->pageparams->group);
     $this->groups = groups_get_all_groups($att->course->id);
     $this->sessions = $att->get_filtered_sessions();
     $this->statuses = $att->get_statuses();
     $this->allstatuses = $att->get_statuses(false);
     $this->gradable = $att->grade > 0;
     if (!($this->decimalpoints = grade_get_setting($att->course->id, 'decimalpoints'))) {
         $this->decimalpoints = $CFG->grade_decimalpoints;
     }
     foreach ($this->users as $user) {
         $this->usersgroups[$user->id] = groups_get_all_groups($att->course->id, $user->id);
         $this->sessionslog[$user->id] = $att->get_user_filtered_sessions_log($user->id);
         $this->usersstats[$user->id] = $att->get_user_statuses_stat($user->id);
         if ($this->gradable) {
             $this->grades[$user->id] = $att->get_user_grade($user->id);
             $this->maxgrades[$user->id] = $att->get_user_max_grade($user->id);
         }
     }
     $this->att = $att;
 }