ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

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: saml.php:7
+ 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 166 of file class.ilTestAccess.php.

References $DIC, getTestId(), and ilTestParticipantData\setActiveIdsFilter().

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

167  {
168  global $DIC; /* @var ILIAS\DI\Container $DIC */
169 
170  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
171  $participantData->setActiveIdsFilter(array($activeId));
172  $participantData->setParticipantAccessFilter($accessFilter);
173  $participantData->load($this->getTestId());
174 
175  return in_array($activeId, $participantData->getActiveIds());
176  }
global $DIC
Definition: saml.php:7
+ 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.

References getAccess(), and getRefId().

97  {
98  return $this->getAccess()->checkAccess('write', '', $this->getRefId());
99  }
+ Here is the call graph for this function:

◆ checkManageParticipantsAccess()

ilTestAccess::checkManageParticipantsAccess ( )
Returns
bool

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

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

121  {
122  if ($this->getAccess()->checkAccess('write', '', $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  }
+ Here is the call graph for this function:

◆ checkParticipantsResultsAccess()

ilTestAccess::checkParticipantsResultsAccess ( )
Returns
bool

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

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

Referenced by checkStatisticsAccess().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkResultsAccessForActiveId()

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

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

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

183  {
185  return $this->checkAccessForActiveId($accessFilter, $activeId);
186  }
checkAccessForActiveId($accessFilter, $activeId)
+ Here is the call graph for this function:

◆ checkScoreParticipantsAccess()

ilTestAccess::checkScoreParticipantsAccess ( )
Returns
bool

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

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

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  }
+ Here is the call graph for this function:

◆ checkScoreParticipantsAccessForActiveId()

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

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

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

193  {
195  return $this->checkAccessForActiveId($accessFilter, $activeId);
196  }
checkAccessForActiveId($accessFilter, $activeId)
+ Here is the call graph for this function:

◆ checkStatisticsAccess()

ilTestAccess::checkStatisticsAccess ( )
Returns
bool

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

References checkParticipantsResultsAccess(), getAccess(), and getRefId().

153  {
154  if ($this->getAccess()->checkAccess('tst_statistics', '', $this->getRefId())) {
155  return true;
156  }
157 
158  return $this->checkParticipantsResultsAccess();
159  }
+ Here is the call graph for this function:

◆ checkStatisticsAccessForActiveId()

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

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

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

203  {
205  return $this->checkAccessForActiveId($accessFilter, $activeId);
206  }
checkAccessForActiveId($accessFilter, $activeId)
+ Here is the call graph for this function:

◆ getAccess()

ilTestAccess::getAccess ( )
Returns
ilAccessHandler

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

References $access.

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

49  {
50  return $this->access;
51  }
+ Here is the caller graph for this function:

◆ getRefId()

◆ getTestId()

ilTestAccess::getTestId ( )
Returns
int

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

References $testId.

Referenced by checkAccessForActiveId().

81  {
82  return $this->testId;
83  }
+ Here is the caller graph for this function:

◆ setAccess()

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

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

References $access.

Referenced by __construct().

57  {
58  $this->access = $access;
59  }
+ Here is the caller graph for this function:

◆ setRefId()

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

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

References $refId.

Referenced by __construct().

73  {
74  $this->refId = $refId;
75  }
+ Here is the caller graph for this function:

◆ setTestId()

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

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

References $testId.

Referenced by __construct().

89  {
90  $this->testId = $testId;
91  }
+ 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: