ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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...
 
 canMailUserResults ()
 Can the current user see the own results. 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.

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 }

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().

+ 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.

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

References ILIAS\Survey\Participants\StatusManager\$access, ILIAS\Survey\Participants\StatusManager\$feature_config, ILIAS\Survey\Participants\StatusManager\$survey, ILIAS\Survey\Participants\StatusManager\$user_id, ANONYMOUS_USER_ID, ilObjSurvey\get360SelfAppraisee(), and ilObjSurvey\isAppraisee().

+ Here is the call graph for this function:

◆ canMailUserResults()

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

Can the current user see the own results.

Returns
bool Can the current user mail the confirmation
bool

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

119 : bool
120 {
121 if ($this->cantStartAgain() &&
122 $this->user_id !== ANONYMOUS_USER_ID &&
123 $this->survey->hasMailConfirmation()) {
124 return true;
125 }
126 return false;
127 }
cantStartAgain()
This will return true, if a survey without appraisees is finished Note: Code will be gathered from se...

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

+ 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.

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 }

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

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

+ Here is the caller graph for this function:

◆ isAppraisee()

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

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

175 : bool
176 {
179 if ($feature_config->usesAppraisees() &&
180 $survey->isAppraisee($this->user_id)) {
181 return true;
182 }
183 return false;
184 }

References ILIAS\Survey\Participants\StatusManager\$feature_config, ILIAS\Survey\Participants\StatusManager\$survey, and ilObjSurvey\isAppraisee().

Referenced by ILIAS\Survey\Execution\LaunchGUI\determineMainLink(), and ILIAS\Survey\Participants\StatusManager\mustEnterCode().

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

◆ isExternalRater()

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

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

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

References ILIAS\Survey\Participants\StatusManager\$feature_config, ILIAS\Survey\Participants\StatusManager\$survey, ilObjSurvey\getAnonymousIdByCode(), ilObjSurvey\getAppraiseesToRate(), ilObject\getId(), ilObjSurvey\getMode(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ 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 132 of file class.StatusManager.php.

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

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

+ 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: