ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestParticipantAccessFilter Class Reference
+ Collaboration diagram for ilTestParticipantAccessFilter:

Public Member Functions

 getRefId ()
 
 setRefId ($refId)
 
 getFilter ()
 
 setFilter ($filter)
 
 filterCallback ($userIds)
 
 manageParticipantsUserFilter ($userIds)
 
 scoreParticipantsUserFilter ($userIds)
 
 accessResultsUserFilter ($userIds)
 
 accessStatisticsUserFilter ($userIds)
 

Static Public Member Functions

static getManageParticipantsUserFilter ($refId)
 
static getScoreParticipantsUserFilter ($refId)
 
static getAccessResultsUserFilter ($refId)
 
static getAccessStatisticsUserFilter ($refId)
 

Data Fields

const FILTER_MANAGE_PARTICIPANTS = 'manageParticipantsUserFilter'
 
const FILTER_SCORE_PARTICIPANTS = 'scoreParticipantsUserFilter'
 
const FILTER_ACCESS_RESULTS = 'accessResultsUserFilter'
 
const FILTER_ACCESS_STATISTICS = 'accessStatisticsUserFilter'
 
const CALLBACK_METHOD = 'filterCallback'
 

Protected Attributes

 $refId
 
 $filter
 

Detailed Description

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

Member Function Documentation

◆ accessResultsUserFilter()

ilTestParticipantAccessFilter::accessResultsUserFilter (   $userIds)
Parameters
int[]$userIds
Returns
int[]

Definition at line 130 of file class.ilTestParticipantAccessFilter.php.

References $DIC, getRefId(), and ilOrgUnitOperation\OP_ACCESS_RESULTS.

Referenced by accessStatisticsUserFilter(), and filterCallback().

131  {
132  global $DIC; /* @var ILIAS\DI\Container $DIC */
133 
134  $userIds = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
135  'write',
137  $this->getRefId(),
138  $userIds
139  );
140 
141  return $userIds;
142  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accessStatisticsUserFilter()

ilTestParticipantAccessFilter::accessStatisticsUserFilter (   $userIds)
Parameters
int[]$userIds
Returns
int[]

Definition at line 148 of file class.ilTestParticipantAccessFilter.php.

References $DIC, accessResultsUserFilter(), and getRefId().

Referenced by filterCallback().

149  {
150  global $DIC; /* @var ILIAS\DI\Container $DIC */
151 
152  if ($DIC->access()->checkAccess('tst_statistics', '', $this->getRefId())) {
153  return $userIds;
154  }
155 
156  return $this->accessResultsUserFilter($userIds);
157  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterCallback()

ilTestParticipantAccessFilter::filterCallback (   $userIds)
Parameters
int[]$userIds
Returns
int[]

Definition at line 70 of file class.ilTestParticipantAccessFilter.php.

References accessResultsUserFilter(), accessStatisticsUserFilter(), getFilter(), manageParticipantsUserFilter(), and scoreParticipantsUserFilter().

71  {
72  switch ($this->getFilter()) {
73  case self::FILTER_MANAGE_PARTICIPANTS:
74  return $this->manageParticipantsUserFilter($userIds);
75 
76  case self::FILTER_SCORE_PARTICIPANTS:
77  return $this->scoreParticipantsUserFilter($userIds);
78 
79  case self::FILTER_ACCESS_RESULTS:
80  return $this->accessResultsUserFilter($userIds);
81 
82  case self::FILTER_ACCESS_STATISTICS:
83  return $this->accessStatisticsUserFilter($userIds);
84  }
85 
86  require_once 'Modules/Test/exceptions/class.ilTestException.php';
87  throw new ilTestException('invalid user access filter mode chosen: ' . $this->getFilter());
88  }
Base Exception for all Exceptions relating to Modules/Test.
+ Here is the call graph for this function:

◆ getAccessResultsUserFilter()

static ilTestParticipantAccessFilter::getAccessResultsUserFilter (   $refId)
static
Parameters
integer$refId
Returns
callable

Definition at line 187 of file class.ilTestParticipantAccessFilter.php.

References $filter, and $refId.

Referenced by ilTestAccess\checkResultsAccessForActiveId(), ilParticipantsTestResultsGUI\createUserResults(), ilSoapTestAdministration\getTestResults(), and ilParticipantsTestResultsGUI\showParticipantsCmd().

188  {
189  $filter = new self();
190  $filter->setFilter(self::FILTER_ACCESS_RESULTS);
191  $filter->setRefId($refId);
192  return [$filter, self::CALLBACK_METHOD];
193  }
+ Here is the caller graph for this function:

◆ getAccessStatisticsUserFilter()

static ilTestParticipantAccessFilter::getAccessStatisticsUserFilter (   $refId)
static
Parameters
integer$refId
Returns
callable

Definition at line 199 of file class.ilTestParticipantAccessFilter.php.

References $filter, and $refId.

Referenced by ilObjTest\buildStatisticsAccessFilteredParticipantList(), ilTestAccess\checkStatisticsAccessForActiveId(), ilAssFileUploadUploadsExporter\getParticipantData(), and ilTestEvaluationGUI\outEvaluation().

200  {
201  $filter = new self();
202  $filter->setFilter(self::FILTER_ACCESS_STATISTICS);
203  $filter->setRefId($refId);
204  return [$filter, self::CALLBACK_METHOD];
205  }
+ Here is the caller graph for this function:

◆ getFilter()

ilTestParticipantAccessFilter::getFilter ( )
Returns
string

Definition at line 53 of file class.ilTestParticipantAccessFilter.php.

References $filter.

Referenced by filterCallback().

+ Here is the caller graph for this function:

◆ getManageParticipantsUserFilter()

◆ getRefId()

ilTestParticipantAccessFilter::getRefId ( )
Returns
int

Definition at line 37 of file class.ilTestParticipantAccessFilter.php.

References $refId.

Referenced by accessResultsUserFilter(), accessStatisticsUserFilter(), manageParticipantsUserFilter(), and scoreParticipantsUserFilter().

+ Here is the caller graph for this function:

◆ getScoreParticipantsUserFilter()

static ilTestParticipantAccessFilter::getScoreParticipantsUserFilter (   $refId)
static
Parameters
integer$refId
Returns
callable

Definition at line 175 of file class.ilTestParticipantAccessFilter.php.

References $filter, and $refId.

Referenced by ilTestScoringGUI\buildManScoringParticipantsTable(), ilTestAccess\checkScoreParticipantsAccessForActiveId(), ilTestScoringByQuestionsGUI\getActiveSubTabId(), and ilTestScoringByQuestionsGUI\saveManScoringByQuestion().

176  {
177  $filter = new self();
178  $filter->setFilter(self::FILTER_SCORE_PARTICIPANTS);
179  $filter->setRefId($refId);
180  return [$filter, self::CALLBACK_METHOD];
181  }
+ Here is the caller graph for this function:

◆ manageParticipantsUserFilter()

ilTestParticipantAccessFilter::manageParticipantsUserFilter (   $userIds)
Parameters
int[]$userIds
Returns
int[]

Definition at line 94 of file class.ilTestParticipantAccessFilter.php.

References $DIC, getRefId(), and ilOrgUnitOperation\OP_MANAGE_PARTICIPANTS.

Referenced by filterCallback().

95  {
96  global $DIC; /* @var ILIAS\DI\Container $DIC */
97 
98  $userIds = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
99  'write',
101  $this->getRefId(),
102  $userIds
103  );
104 
105  return $userIds;
106  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scoreParticipantsUserFilter()

ilTestParticipantAccessFilter::scoreParticipantsUserFilter (   $userIds)
Parameters
int[]$userIds
Returns
int[]

Definition at line 112 of file class.ilTestParticipantAccessFilter.php.

References $DIC, getRefId(), and ilOrgUnitOperation\OP_SCORE_PARTICIPANTS.

Referenced by filterCallback().

113  {
114  global $DIC; /* @var ILIAS\DI\Container $DIC */
115 
116  $userIds = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
117  'write',
119  $this->getRefId(),
120  $userIds
121  );
122 
123  return $userIds;
124  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilter()

ilTestParticipantAccessFilter::setFilter (   $filter)
Parameters
string$filter

Definition at line 61 of file class.ilTestParticipantAccessFilter.php.

References $filter.

◆ setRefId()

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

Definition at line 45 of file class.ilTestParticipantAccessFilter.php.

References $refId.

Field Documentation

◆ $filter

◆ $refId

◆ CALLBACK_METHOD

const ilTestParticipantAccessFilter::CALLBACK_METHOD = 'filterCallback'

Definition at line 22 of file class.ilTestParticipantAccessFilter.php.

◆ FILTER_ACCESS_RESULTS

const ilTestParticipantAccessFilter::FILTER_ACCESS_RESULTS = 'accessResultsUserFilter'

Definition at line 19 of file class.ilTestParticipantAccessFilter.php.

◆ FILTER_ACCESS_STATISTICS

const ilTestParticipantAccessFilter::FILTER_ACCESS_STATISTICS = 'accessStatisticsUserFilter'

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

◆ FILTER_MANAGE_PARTICIPANTS

const ilTestParticipantAccessFilter::FILTER_MANAGE_PARTICIPANTS = 'manageParticipantsUserFilter'

Definition at line 17 of file class.ilTestParticipantAccessFilter.php.

◆ FILTER_SCORE_PARTICIPANTS

const ilTestParticipantAccessFilter::FILTER_SCORE_PARTICIPANTS = 'scoreParticipantsUserFilter'

Definition at line 18 of file class.ilTestParticipantAccessFilter.php.


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