ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilTestVirtualSequenceRandomQuestionSet.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Modules/Test/classes/class.ilTestVirtualSequence.php';
5 require_once 'Modules/Test/interfaces/interface.ilTestRandomQuestionSequence.php';
6 
14 {
16 
18  {
19  parent::__construct($db, $testOBJ, $testSequenceFactory);
20 
21  $this->questionsSourcePoolDefinitionMap = array();
22  }
23 
24  public function getResponsibleSourcePoolDefinitionId($questionId)
25  {
26  return $this->questionsSourcePoolDefinitionMap[$questionId];
27  }
28 
29  protected function fetchQuestionsFromPasses($activeId, $passes)
30  {
31  $this->questionsPassMap = array();
32 
33  foreach ($passes as $pass) {
34  $handledSourcePoolDefinitions = array_flip($this->questionsSourcePoolDefinitionMap);
35 
36  $testSequence = $this->getTestSequence($activeId, $pass);
37 
38  foreach ($testSequence->getOrderedSequenceQuestions() as $questionId) {
39  $definitionId = $testSequence->getResponsibleSourcePoolDefinitionId($questionId);
40 
41  if (isset($handledSourcePoolDefinitions[$definitionId])) {
42  continue;
43  }
44 
45  if ($this->wasAnsweredInThisPass($testSequence, $questionId)) {
46  $this->questionsPassMap[$questionId] = $pass;
47 
48  $this->questionsSourcePoolDefinitionMap[$questionId] = $definitionId;
49  }
50  }
51  }
52  }
53 }
Interface ilDBInterface.
Create styles array
The data for the language used.
wasAnsweredInThisPass(ilTestSequence $testSequence, $questionId)
__construct(ilDBInterface $db, ilObjTest $testOBJ, ilTestSequenceFactory $testSequenceFactory)