Ejemplo n.º 1
0
 /**
  * @param attcontrol $att
  * @param bool $isexport
  */
 public function __construct(attcontrol $att, $isexport = false)
 {
     global $CFG;
     $this->perm = $att->perm;
     $this->pageparams = $att->pageparams;
     //Populate pagination parameters
     if (!$isexport) {
         $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_students_count($this->pageparams->get_current_sesstype());
     }
     if ($isexport) {
         $this->sessions = $att->get_sessions();
         $this->users = $att->get_course_report();
     } else {
         $this->sessions = $att->get_sessions();
         $this->users = $att->get_course_report($this->offset, $this->perpage);
     }
     $this->groups = groups_get_all_groups($att->course->id);
     $this->statuses = $att->get_statuses();
     $this->att = $att;
 }