ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestParticipantAccessFilter Class Reference
+ Collaboration diagram for ilTestParticipantAccessFilter:

Public Member Functions

 getRefId ()
 
 setRefId ($refId)
 
 getFilter ()
 
 setFilter ($filter)
 
 filterCallback ($userIds)
 
 manageParticipantsUserFilter ($userIds)
 
 scoreParticipantsUserFilter ($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 27 of file class.ilTestParticipantAccessFilter.php.

Member Function Documentation

◆ accessStatisticsUserFilter()

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

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

References $DIC, and getRefId().

Referenced by filterCallback().

169  : array
170  {
171  global $DIC; /* @var ILIAS\DI\Container $DIC */
172 
173  if ($DIC->access()->checkAccess('tst_statistics', '', $this->getRefId())) {
174  return $userIds;
175  }
176 
177  return $this->accessResultsUserFilter($userIds);
178  }
global $DIC
Definition: feed.php:28
+ 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 82 of file class.ilTestParticipantAccessFilter.php.

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

82  : array
83  {
84  switch ($this->getFilter()) {
85  case self::FILTER_MANAGE_PARTICIPANTS:
86  return $this->manageParticipantsUserFilter($userIds);
87 
88  case self::FILTER_SCORE_PARTICIPANTS:
89  return $this->scoreParticipantsUserFilter($userIds);
90 
91  case self::FILTER_ACCESS_RESULTS:
92  return $this->accessResultsUserFilter($userIds);
93 
94  case self::FILTER_ACCESS_STATISTICS:
95  return $this->accessStatisticsUserFilter($userIds);
96  }
97 
98  require_once 'Modules/Test/exceptions/class.ilTestException.php';
99  throw new ilTestException('invalid user access filter mode chosen: ' . $this->getFilter());
100  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getAccessResultsUserFilter()

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

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

References $filter, and $refId.

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

209  {
210  $filter = new self();
211  $filter->setFilter(self::FILTER_ACCESS_RESULTS);
212  $filter->setRefId($refId);
213  return [$filter, self::CALLBACK_METHOD];
214  }
+ Here is the caller graph for this function:

◆ getAccessStatisticsUserFilter()

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

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

References $filter, and $refId.

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

221  {
222  $filter = new self();
223  $filter->setFilter(self::FILTER_ACCESS_STATISTICS);
224  $filter->setRefId($refId);
225  return [$filter, self::CALLBACK_METHOD];
226  }
+ Here is the caller graph for this function:

◆ getFilter()

ilTestParticipantAccessFilter::getFilter ( )
Returns
string

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

References $filter.

Referenced by filterCallback().

65  : string
66  {
67  return $this->filter;
68  }
+ Here is the caller graph for this function:

◆ getManageParticipantsUserFilter()

static ilTestParticipantAccessFilter::getManageParticipantsUserFilter (   $refId)
static

◆ getRefId()

ilTestParticipantAccessFilter::getRefId ( )
Returns
int

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

References $refId.

Referenced by 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 196 of file class.ilTestParticipantAccessFilter.php.

References $filter, and $refId.

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

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

◆ manageParticipantsUserFilter()

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

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

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

Referenced by filterCallback().

106  : array
107  {
108  global $DIC; /* @var ILIAS\DI\Container $DIC */
109 
110  $userIds = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
111  'write',
113  $this->getRefId(),
114  $userIds
115  );
116 
117  return $userIds;
118  }
global $DIC
Definition: feed.php:28
+ 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 124 of file class.ilTestParticipantAccessFilter.php.

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

Referenced by filterCallback().

124  : array
125  {
126  global $DIC; /* @var ILIAS\DI\Container $DIC */
127 
128  $userIds = $DIC->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
129  'write',
131  $this->getRefId(),
132  $userIds
133  );
134 
135  return $userIds;
136  }
global $DIC
Definition: feed.php:28
+ 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 73 of file class.ilTestParticipantAccessFilter.php.

References $filter, and ILIAS\UI\examples\Symbol\Glyph\Filter\filter().

+ Here is the call graph for this function:

◆ setRefId()

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

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

References $refId.

Field Documentation

◆ $filter

◆ $refId

◆ CALLBACK_METHOD

const ilTestParticipantAccessFilter::CALLBACK_METHOD = 'filterCallback'

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

◆ FILTER_ACCESS_RESULTS

const ilTestParticipantAccessFilter::FILTER_ACCESS_RESULTS = 'accessResultsUserFilter'

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

◆ FILTER_ACCESS_STATISTICS

const ilTestParticipantAccessFilter::FILTER_ACCESS_STATISTICS = 'accessStatisticsUserFilter'

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

◆ FILTER_MANAGE_PARTICIPANTS

const ilTestParticipantAccessFilter::FILTER_MANAGE_PARTICIPANTS = 'manageParticipantsUserFilter'

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

◆ FILTER_SCORE_PARTICIPANTS

const ilTestParticipantAccessFilter::FILTER_SCORE_PARTICIPANTS = 'scoreParticipantsUserFilter'

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


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