public function __construct($obj, $eschool)
 {
     parent::__construct($obj, $eschool);
     $this->mdl_enrol = $this->app->selectFromMdlTable('enrol', 'id', $this->obj->enrolid, true);
     $this->course = $this->app->getCourse($this->mdl_enrol->courseid);
     $mdl_user_obj = $this->app->selectFromMdlTable('user', 'id', $this->obj->userid, true);
     $mdl_user = new GcrMdlUser($mdl_user_obj, $this->app);
     $this->user = $mdl_user->getUserOnInstitution();
     $short_name = $this->app->getShortName();
     $sql = 'select * from ' . $short_name . '.mdl_grade_items gi, ' . $short_name . '.mdl_grade_grades gg where gg.userid = ? ' . 'and gi.courseid = ? and gi.itemtype = ? and gg.itemid = gi.id order by gg.timecreated';
     $this->grade_data = $this->app->gcQuery($sql, array($mdl_user->getObject()->id, $this->course->getObject()->id, 'course'), true);
 }
 public function __construct($obj, $eschool)
 {
     parent::__construct($obj, $eschool);
     $this->role_manager = new GcrUserRoleManager($this);
 }