ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTestAccess Class Reference
+ Collaboration diagram for ilTestAccess:

Public Member Functions

 __construct ($refId, $testId)
 
 getAccess ()
 
 setAccess ($access)
 
 getRefId ()
 
 setRefId ($refId)
 
 getTestId ()
 
 setTestId ($testId)
 
 checkCorrectionsAccess ()
 
 checkScoreParticipantsAccess ()
 
 checkManageParticipantsAccess ()
 
 checkParticipantsResultsAccess ()
 
 checkStatisticsAccess ()
 
 checkResultsAccessForActiveId ($activeId)
 
 checkScoreParticipantsAccessForActiveId ($activeId)
 
 checkStatisticsAccessForActiveId ($activeId)
 

Protected Member Functions

 checkAccessForActiveId ($accessFilter, $activeId)
 

Protected Attributes

 $access
 
 $refId
 
 $testId
 

Detailed Description

Definition at line 15 of file class.ilTestAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestAccess::__construct (   $refId,
  $testId 
)
Parameters
integer$refId
integer$testId

Definition at line 36 of file class.ilTestAccess.php.

37 {
38 global $DIC; /* @var ILIAS\DI\Container $DIC */
39 $this->setAccess($DIC->access());
40
41 $this->setRefId($refId);
42 $this->setTestId($testId);
43 }
global $DIC
Definition: goto.php:24

References $DIC, $refId, $testId, setAccess(), setRefId(), and setTestId().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkAccessForActiveId()

ilTestAccess::checkAccessForActiveId (   $accessFilter,
  $activeId 
)
protected
Parameters
callable$participantAccessFilter
integer$activeId
Returns
bool

Definition at line 165 of file class.ilTestAccess.php.

166 {
167 global $DIC; /* @var ILIAS\DI\Container $DIC */
168
169 $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
170 $participantData->setActiveIdsFilter(array($activeId));
171 $participantData->setParticipantAccessFilter($accessFilter);
172 $participantData->load($this->getTestId());
173
174 return in_array($activeId, $participantData->getActiveIds());
175 }

References $DIC, and getTestId().

Referenced by checkResultsAccessForActiveId(), checkScoreParticipantsAccessForActiveId(), and checkStatisticsAccessForActiveId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCorrectionsAccess()

ilTestAccess::checkCorrectionsAccess ( )
Returns
bool

Definition at line 96 of file class.ilTestAccess.php.

97 {
98 return $this->getAccess()->checkAccess('write', '', $this->getRefId());
99 }

References getAccess(), and getRefId().

+ Here is the call graph for this function:

◆ checkManageParticipantsAccess()

ilTestAccess::checkManageParticipantsAccess ( )
Returns
bool

Definition at line 120 of file class.ilTestAccess.php.

121 {
122 if ($this->getAccess()->checkAccess('tst_results', '', $this->getRefId())) {
123 return true;
124 }
125
126 if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_MANAGE_PARTICIPANTS, $this->getRefId())) {
127 return true;
128 }
129
130 return false;
131 }

References getAccess(), getRefId(), and ilOrgUnitOperation\OP_MANAGE_PARTICIPANTS.

+ Here is the call graph for this function:

◆ checkParticipantsResultsAccess()

ilTestAccess::checkParticipantsResultsAccess ( )
Returns
bool

Definition at line 136 of file class.ilTestAccess.php.

137 {
138 if ($this->getAccess()->checkAccess('tst_results', '', $this->getRefId())) {
139 return true;
140 }
141
142 if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_ACCESS_RESULTS, $this->getRefId())) {
143 return true;
144 }
145
146 return false;
147 }

References getAccess(), getRefId(), and ilOrgUnitOperation\OP_ACCESS_RESULTS.

+ Here is the call graph for this function:

◆ checkResultsAccessForActiveId()

ilTestAccess::checkResultsAccessForActiveId (   $activeId)
Parameters
integer$activeId
Returns
bool

Definition at line 181 of file class.ilTestAccess.php.

182 {
184 return $this->checkAccessForActiveId($accessFilter, $activeId);
185 }
checkAccessForActiveId($accessFilter, $activeId)

References checkAccessForActiveId(), ilTestParticipantAccessFilter\getAccessResultsUserFilter(), and getRefId().

+ Here is the call graph for this function:

◆ checkScoreParticipantsAccess()

ilTestAccess::checkScoreParticipantsAccess ( )
Returns
bool

Definition at line 104 of file class.ilTestAccess.php.

105 {
106 if ($this->getAccess()->checkAccess('write', '', $this->getRefId())) {
107 return true;
108 }
109
110 if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_SCORE_PARTICIPANTS, $this->getRefId())) {
111 return true;
112 }
113
114 return false;
115 }

References getAccess(), getRefId(), and ilOrgUnitOperation\OP_SCORE_PARTICIPANTS.

+ Here is the call graph for this function:

◆ checkScoreParticipantsAccessForActiveId()

ilTestAccess::checkScoreParticipantsAccessForActiveId (   $activeId)
Parameters
integer$activeId
Returns
bool

Definition at line 191 of file class.ilTestAccess.php.

192 {
194 return $this->checkAccessForActiveId($accessFilter, $activeId);
195 }

References checkAccessForActiveId(), getRefId(), and ilTestParticipantAccessFilter\getScoreParticipantsUserFilter().

+ Here is the call graph for this function:

◆ checkStatisticsAccess()

ilTestAccess::checkStatisticsAccess ( )
Returns
bool

Definition at line 152 of file class.ilTestAccess.php.

153 {
154 if ($this->getAccess()->checkAccess('tst_statistics', '', $this->getRefId())) {
155 return true;
156 }
157 return false;
158 }

References getAccess(), and getRefId().

+ Here is the call graph for this function:

◆ checkStatisticsAccessForActiveId()

ilTestAccess::checkStatisticsAccessForActiveId (   $activeId)
Parameters
integer$activeId
Returns
bool

Definition at line 201 of file class.ilTestAccess.php.

202 {
204 return $this->checkAccessForActiveId($accessFilter, $activeId);
205 }

References checkAccessForActiveId(), ilTestParticipantAccessFilter\getAccessStatisticsUserFilter(), and getRefId().

+ Here is the call graph for this function:

◆ getAccess()

ilTestAccess::getAccess ( )
Returns
ilAccessHandler

Definition at line 48 of file class.ilTestAccess.php.

49 {
50 return $this->access;
51 }

References $access.

Referenced by checkCorrectionsAccess(), checkManageParticipantsAccess(), checkParticipantsResultsAccess(), checkScoreParticipantsAccess(), and checkStatisticsAccess().

+ Here is the caller graph for this function:

◆ getRefId()

◆ getTestId()

ilTestAccess::getTestId ( )
Returns
int

Definition at line 80 of file class.ilTestAccess.php.

81 {
82 return $this->testId;
83 }

References $testId.

Referenced by checkAccessForActiveId().

+ Here is the caller graph for this function:

◆ setAccess()

ilTestAccess::setAccess (   $access)
Parameters
ilAccessHandler$access

Definition at line 56 of file class.ilTestAccess.php.

57 {
58 $this->access = $access;
59 }

References $access.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setRefId()

ilTestAccess::setRefId (   $refId)
Parameters
int$refId

Definition at line 72 of file class.ilTestAccess.php.

73 {
74 $this->refId = $refId;
75 }

References $refId.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setTestId()

ilTestAccess::setTestId (   $testId)
Parameters
int$testId

Definition at line 88 of file class.ilTestAccess.php.

89 {
90 $this->testId = $testId;
91 }

References $testId.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilTestAccess::$access
protected

Definition at line 20 of file class.ilTestAccess.php.

Referenced by getAccess(), and setAccess().

◆ $refId

ilTestAccess::$refId
protected

Definition at line 25 of file class.ilTestAccess.php.

Referenced by __construct(), getRefId(), and setRefId().

◆ $testId

ilTestAccess::$testId
protected

Definition at line 30 of file class.ilTestAccess.php.

Referenced by __construct(), getTestId(), and setTestId().


The documentation for this class was generated from the following file: