3 declare(strict_types=1);
    36     protected \ilLanguage 
$lng;
    54         $this->repo = $repo_service->
execution()->run();
    62         $this->session_repo = $repo_service->
execution()->runSession();
    63         $this->code_manager = $domain_service->
code($survey, $current_user_id);
    64         $this->
lng = $domain_service->lng();
    69         return !$this->survey->isAccessibleWithoutCode();
    99         if ($this->feature_config->usesAppraisees() && $this->appraisee_id === 0) {
   100             throw new \ilSurveyException(
"No appraisee specified");
   103         if (!$this->feature_config->usesAppraisees() && $this->appraisee_id > 0) {
   106                 throw new \ilSurveyException(
"Appraisee ID given, but appraisees not supported");
   149         $code_manager = $this->domain_service->code($this->survey, $this->current_user_id);
   151         if ($code_manager->exists($code)) {
   154                 $this->current_user_id,
   175         return $this->repo->getRunsForUser($this->survey->getSurveyId(), 
$user_id, $code);
   180         $run = $this->repo->getById($run_id);
   181         if (!is_null($run) && $run->getSurveyId() !== $this->survey->getSurveyId()) {
   182             throw new \ilSurveyException(
"Run survey id mismatch.");
   191         int $appraisee_id = 0
   193         $appraisee_id = ($appraisee_id > 0)
   195             : $this->appraisee_id;
   200         if ($survey->getAnonymize() && $code === 
'') {
   207         string $requested_code = 
""   215         $anonymous_code = $requested_code;
   216         if ($anonymous_code !== 
"") {
   219                 $anonymous_code = 
"";
   224                 $this->code_manager->bindUser($anonymous_code, 
$user_id);
   225                 $session_repo->
setCode($survey->getId(), $anonymous_code);
   229         if (!$anonymous_code) {
   230             $anonymous_code = $session_repo->
getCode($survey->getId());
   231             if ($anonymous_code) {
   238         if ($survey->getAnonymize() && !$anonymous_code) {
   239             $anonymous_code = $survey->findCodeForUser(
$user_id);
   243         $execution_status = $survey->getUserSurveyExecutionStatus($anonymous_code);
   244         if ($execution_status) {
   245             $anonymous_code = (string) $execution_status[
"code"];
   246             $execution_status = $execution_status[
"runs"];
   250         if (!$survey->isAccessibleWithoutCode() &&
   253             (!$anonymous_code || !$this->code_manager->exists($anonymous_code))) {
   254             $anonymous_code = 
"";
   256             throw new \ilWrongSurveyCodeException($this->
lng->txt(
"svy_wrong_or_expired_code"));
   258         $this->session_repo->setCode($survey->getId(), $anonymous_code);
   266         return $this->session_repo->getCode($this->survey->getId());
   271         $this->session_repo->clearCode($this->survey->getId());
   282         $this->session_repo->setPageEnter($time);
   283         $this->repo->addTime($run_id, $time, $first_question);
   290         $this->repo->updateTime($run_id, $time, $this->session_repo->getPageEnter());
   291         $this->session_repo->clearPageEnter();
   296         return $this->session_repo->getPageEnter();
   301         $this->session_repo->setPreviewData($this->survey_id, $question_id, $data);
   306         return $this->session_repo->getPreviewData($this->survey_id, $question_id);
   311         $this->session_repo->clearPreviewData($this->survey_id, $question_id);
   316         $this->session_repo->clearAllPreviewData($this->survey_id);
   321         $this->session_repo->setErrors($errors);
   326         return $this->session_repo->getErrors();
   331         $this->session_repo->clearErrors();
   336         $this->session_repo->setPostData($data);
   341         return $this->session_repo->getPostData();
   346         $this->session_repo->clearPostData();
 
initSession(string $requested_code="")
 
clearPreviewData(int $question_id)
 
getCode()
Get current valid code. 
 
belongsToFinishedRun(string $code)
Does code belong to current anonymous started, but not finished run? Note: this method acts on the cu...
 
code(\ilObjSurvey $survey, int $user_id)
 
getPreviewData(int $question_id)
 
setStartTime(int $first_question)
Set start time of run. 
 
__construct(InternalRepoService $repo_service, InternalDomainService $domain_service, \ilObjSurvey $survey, int $current_user_id, int $appraisee_id=0)
 
getCurrentRunId(int $survey_id, int $user_id, string $code="", int $appr_id=0)
 
getRunsForUser(int $user_id, string $code="")
 
Stores access codes of anonymous session. 
 
Survey internal data service. 
 
InternalDomainService $domain_service
 
hasStarted(int $appraisee=0)
 
Mode FeatureConfig $feature_config
 
setCode(int $survey_id, string $code)
 
modeFeatureConfig(int $mode)
 
RunSessionRepo $session_repo
 
checkUserParameters(int $user_id, string $code="")
Check user parameters. 
 
Survey Run Note: The manager should get the current user id passed. 
 
start(int $appraisee_id=0)
Starts the survey creating a new run. 
 
setPreviewData(int $question_id, array $data)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ILIAS Survey Code CodeManager $code_manager
 
const STARTED_NOT_FINISHED