/** * Prepare info about attcontrol sessions taking into account view parameters. * * @param attcontrol $att instance */ public function __construct(attcontrol $att) { $this->perm = $att->perm; $this->id = required_param('id', PARAM_INT); //Populate pagination parameters $this->page = optional_param('page', 0, PARAM_INT); $this->perpage = get_user_preferences('attcontrol_perpage', 10); $this->offset = $this->page * $this->perpage; $this->total = $att->get_filtered_sessions_count($this->offset, $this->perpage); $this->sessions = $att->get_filtered_sessions($this->offset, $this->perpage); $this->groups = groups_get_all_groups($att->course->id); $this->att = $att; }