ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Survey\Sequence\SequenceManager Class Reference
+ Collaboration diagram for ILIAS\Survey\Sequence\SequenceManager:

Public Member Functions

 __construct (InternalRepoService $repo, InternalDomainService $domain, int $survey_id, \ilObjSurvey $survey)
 
 appendQuestion (int $survey_question_id, bool $duplicate=true, bool $force_duplicate=false)
 

Protected Attributes

ilObjSurvey $survey
 
ilLogger $log
 
int $survey_id
 
InternalDomainService $domain
 
SequenceDBRepository $question_repo
 

Detailed Description

Definition at line 26 of file SequenceManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Sequence\SequenceManager::__construct ( InternalRepoService  $repo,
InternalDomainService  $domain,
int  $survey_id,
\ilObjSurvey  $survey 
)

Member Function Documentation

◆ appendQuestion()

ILIAS\Survey\Sequence\SequenceManager::appendQuestion ( int  $survey_question_id,
bool  $duplicate = true,
bool  $force_duplicate = false 
)

Definition at line 47 of file SequenceManager.php.

51 : int {
52 $this->log->debug("append question, id: " . $survey_question_id . ", duplicate: " . $duplicate . ", force: " . $force_duplicate);
53
54 // create duplicate if pool question (or forced for question blocks copy)
55 if ($duplicate) {
56 // this does nothing if this is not a pool question and $a_force_duplicate is false
57 $survey_question_id = $this->survey->duplicateQuestionForSurvey($survey_question_id, $force_duplicate);
58 }
59
60 // check if question is not already in the survey, see #22018
61 if ($this->survey->isQuestionInSurvey($survey_question_id)) {
62 return $survey_question_id;
63 }
64
65 // append to survey
66 $next_id = $this->question_repo->insert($this->survey_id, $survey_question_id);
67
68 $this->log->debug("insert svy_svy_qst, id: " . $next_id . ", qfi: " . $survey_question_id);
69
70 return $survey_question_id;
71 }

Field Documentation

◆ $domain

InternalDomainService ILIAS\Survey\Sequence\SequenceManager::$domain
protected

◆ $log

ilLogger ILIAS\Survey\Sequence\SequenceManager::$log
protected

Definition at line 29 of file SequenceManager.php.

◆ $question_repo

SequenceDBRepository ILIAS\Survey\Sequence\SequenceManager::$question_repo
protected

Definition at line 32 of file SequenceManager.php.

◆ $survey

ilObjSurvey ILIAS\Survey\Sequence\SequenceManager::$survey
protected

◆ $survey_id

int ILIAS\Survey\Sequence\SequenceManager::$survey_id
protected

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