ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Survey\Participants\StatusManager Class Reference

Participant status manager. More...

+ Collaboration diagram for ILIAS\Survey\Participants\StatusManager:

Public Member Functions

 __construct (InternalDomainService $domain_service, InternalRepoService $repo_service, \ilObjSurvey $survey, int $user_id)
 
 canAddItselfAsAppraisee ()
 Checks if a user can add himself as an appraisee. More...
 
 cantStartAgain ()
 This will return true, if a survey without appraisees is finished Note: Code will be gathered from session. More...
 
 canViewUserResults ()
 Can the current user see the own results. More...
 
 canMailUserResults ()
 Can the current user mail the confirmation. More...
 
 mustEnterCode (string $code="")
 Check if user must enter code to start (and currently is able to start) More...
 
 isExternalRater ()
 
 isAppraisee ()
 

Protected Attributes

ILIAS Survey Execution RunManager $run_manager
 
InternalDomainService $domain_service
 
ilObjSurvey $survey
 
int $user_id
 
ILIAS Survey Access AccessManager $access
 
ILIAS Survey Mode FeatureConfig $feature_config
 
InternalRepoService $repo_service
 

Detailed Description

Participant status manager.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Participants\StatusManager::__construct ( InternalDomainService  $domain_service,
InternalRepoService  $repo_service,
\ilObjSurvey  $survey,
int  $user_id 
)

Definition at line 41 of file class.StatusManager.php.

References ILIAS\Survey\Participants\StatusManager\$domain_service, ILIAS\Survey\Participants\StatusManager\$repo_service, ILIAS\Survey\Participants\StatusManager\$survey, ILIAS\Survey\Participants\StatusManager\$user_id, ILIAS\Repository\access(), ILIAS\Survey\InternalDomainService\execution(), ilObjSurvey\getMode(), and ilObject\getRefId().

46  {
47  $this->domain_service = $domain_service;
48  $this->repo_service = $repo_service;
49  $this->access = $this->domain_service->access($survey->getRefId(), $user_id);
50  //$this->anonymous_session_repo = $this->
51  $this->feature_config = $this->domain_service->modeFeatureConfig($survey->getMode());
52  $this->survey = $survey;
53  $this->user_id = $user_id;
54  $this->run_manager = $domain_service->execution()->run($survey, $user_id);
55  }
+ Here is the call graph for this function:

Member Function Documentation

◆ canAddItselfAsAppraisee()

ILIAS\Survey\Participants\StatusManager::canAddItselfAsAppraisee ( )

Checks if a user can add himself as an appraisee.

Definition at line 60 of file class.StatusManager.php.

References ILIAS\Survey\Participants\StatusManager\$access, ILIAS\Survey\Participants\StatusManager\$feature_config, ILIAS\Survey\Participants\StatusManager\$survey, ILIAS\Survey\Participants\StatusManager\$user_id, and ANONYMOUS_USER_ID.

60  : bool
61  {
66 
67  if ($access->canRead() &&
68  $feature_config->usesAppraisees() &&
72  return true;
73  }
74  return false;
75  }
isAppraisee(int $a_user_id)
const ANONYMOUS_USER_ID
Definition: constants.php:27
ILIAS Survey Mode FeatureConfig $feature_config
ILIAS Survey Access AccessManager $access

◆ canMailUserResults()

ILIAS\Survey\Participants\StatusManager::canMailUserResults ( )

Can the current user mail the confirmation.

Returns
bool

Definition at line 118 of file class.StatusManager.php.

References ANONYMOUS_USER_ID, and ILIAS\Survey\Participants\StatusManager\cantStartAgain().

118  : bool
119  {
120  if ($this->cantStartAgain() &&
121  $this->user_id !== ANONYMOUS_USER_ID &&
122  $this->survey->hasMailConfirmation()) {
123  return true;
124  }
125  return false;
126  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
cantStartAgain()
This will return true, if a survey without appraisees is finished Note: Code will be gathered from se...
+ Here is the call graph for this function:

◆ cantStartAgain()

ILIAS\Survey\Participants\StatusManager::cantStartAgain ( )

This will return true, if a survey without appraisees is finished Note: Code will be gathered from session.

Returns
bool

Definition at line 82 of file class.StatusManager.php.

References ILIAS\Survey\Participants\StatusManager\$feature_config.

Referenced by ILIAS\Survey\Participants\StatusManager\canMailUserResults(), and ILIAS\Survey\Participants\StatusManager\canViewUserResults().

82  : bool
83  {
85 
86  if ($feature_config->usesAppraisees()) {
87  return false;
88  }
89 
90  if ($this->run_manager->hasStarted() && $this->run_manager->hasFinished()) {
91  // check for
92  // !(!$this->object->isAccessibleWithoutCode() && !$anonymous_code && $ilUser->getId() == ANONYMOUS_USER_ID)
93  // removed
94  // not code accessible an no anonymous code and anonymous user (see #0020333)
95  return true;
96  }
97  return false;
98  }
ILIAS Survey Mode FeatureConfig $feature_config
+ Here is the caller graph for this function:

◆ canViewUserResults()

ILIAS\Survey\Participants\StatusManager::canViewUserResults ( )

Can the current user see the own results.

Returns
bool

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

References ANONYMOUS_USER_ID, and ILIAS\Survey\Participants\StatusManager\cantStartAgain().

104  : bool
105  {
106  if ($this->cantStartAgain() &&
107  $this->user_id !== ANONYMOUS_USER_ID &&
108  $this->survey->hasViewOwnResults()) {
109  return true;
110  }
111  return false;
112  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
cantStartAgain()
This will return true, if a survey without appraisees is finished Note: Code will be gathered from se...
+ Here is the call graph for this function:

◆ isAppraisee()

ILIAS\Survey\Participants\StatusManager::isAppraisee ( )

Definition at line 174 of file class.StatusManager.php.

References ILIAS\Survey\Participants\StatusManager\$feature_config, and ILIAS\Survey\Participants\StatusManager\$survey.

Referenced by ILIAS\Survey\Participants\StatusManager\mustEnterCode().

174  : bool
175  {
178  if ($feature_config->usesAppraisees() &&
179  $survey->isAppraisee($this->user_id)) {
180  return true;
181  }
182  return false;
183  }
isAppraisee(int $a_user_id)
ILIAS Survey Mode FeatureConfig $feature_config
+ Here is the caller graph for this function:

◆ isExternalRater()

ILIAS\Survey\Participants\StatusManager::isExternalRater ( )

Definition at line 144 of file class.StatusManager.php.

References ILIAS\Survey\Participants\StatusManager\$feature_config, and ILIAS\Survey\Participants\StatusManager\$survey.

144  : bool
145  {
148  $anon_session = $this->repo_service->execution()->runSession();
149  if ($feature_config->usesAppraisees() &&
150  $anon_session->issetCode($survey->getId())) {
151  if (!$anon_session->isExternalRaterValidated($survey->getRefId())) {
152  $code = $anon_session->getCode($survey->getId());
153  $code_manager = $this->domain_service->code($survey, 0);
154  $feature_config = $this->domain_service->modeFeatureConfig($survey->getMode());
155  $access_manager = $this->domain_service->access($survey->getRefId(), 0);
156 
157  if ($code_manager->exists($code)) {
158  $anonymous_id = $survey->getAnonymousIdByCode($code);
159  if ($anonymous_id) {
160  if (count($survey->getAppraiseesToRate(null, $anonymous_id))) {
161  $anon_session->setExternalRaterValidation($survey->getRefId(), true);
162  return true;
163  }
164  }
165  }
166  $anon_session->setExternalRaterValidation($survey->getRefId(), false);
167  return false;
168  }
169  return true;
170  }
171  return false;
172  }
ILIAS Survey Mode FeatureConfig $feature_config
getAppraiseesToRate(?int $a_user_id, int $a_anonymous_id=null)
getAnonymousIdByCode(string $a_code)

◆ mustEnterCode()

ILIAS\Survey\Participants\StatusManager::mustEnterCode ( string  $code = "")

Check if user must enter code to start (and currently is able to start)

Definition at line 131 of file class.StatusManager.php.

References ILIAS\Repository\access(), and ILIAS\Survey\Participants\StatusManager\isAppraisee().

131  : bool
132  {
133  if ($this->access->canStartSurvey()) {
134  // code is mandatory and not given yet
135  if (!$this->isAppraisee() &&
136  $code === "" &&
137  !$this->survey->isAccessibleWithoutCode()) {
138  return true;
139  }
140  }
141  return false;
142  }
+ Here is the call graph for this function:

Field Documentation

◆ $access

ILIAS Survey Access AccessManager ILIAS\Survey\Participants\StatusManager::$access
protected

◆ $domain_service

InternalDomainService ILIAS\Survey\Participants\StatusManager::$domain_service
protected

◆ $feature_config

◆ $repo_service

InternalRepoService ILIAS\Survey\Participants\StatusManager::$repo_service
protected

◆ $run_manager

ILIAS Survey Execution RunManager ILIAS\Survey\Participants\StatusManager::$run_manager
protected

Definition at line 33 of file class.StatusManager.php.

◆ $survey

◆ $user_id

int ILIAS\Survey\Participants\StatusManager::$user_id
protected

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