3 declare(strict_types=1);
45 $this->activeId = null;
47 $this->questionsPassMap = array();
62 return array_keys($this->questionsPassMap);
72 return array_unique(array_values($this->questionsPassMap));
75 public function init(): void
83 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
85 $passesSelector->setActiveId($activeId);
87 $passes = $passesSelector->getExistingPasses();
89 rsort($passes, SORT_NUMERIC);
99 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, $pass);
101 $testSequence->loadFromDb();
102 $testSequence->loadQuestions();
104 $testSequence->setConsiderHiddenQuestionsEnabled(
true);
105 $testSequence->setConsiderOptionalQuestionsEnabled(
true);
106 return $testSequence;
131 $this->questionsPassMap = array();
133 foreach ($passes as $pass) {
136 foreach ($testSequence->getOrderedSequenceQuestions() as $questionId) {
137 if (isset($this->questionsPassMap[$questionId])) {
142 $this->questionsPassMap[$questionId] = $pass;
fetchQuestionsFromPasses(int $activeId, array $passes)
getExistingPassesDescendent($activeId)
setActiveId(int $activeId)
isQuestionOptional($questionId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilTestSequenceFactory $testSequenceFactory
getTestSequence(int $activeId, int $pass)
isHiddenQuestion($question_id)
wasAnsweredInThisPass(ilTestSequence $testSequence, $questionId)
isAnsweringOptionalQuestionsConfirmed()
__construct(ilDBInterface $db, ilObjTest $testOBJ, ilTestSequenceFactory $testSequenceFactory)