ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
35  $handledSourcePoolDefinitions = array_flip($this->questionsSourcePoolDefinitionMap);
36 
37  $testSequence = $this->getTestSequence($activeId, $pass);
38 
39  foreach($testSequence->getOrderedSequenceQuestions() as $questionId)
40  {
41  $definitionId = $testSequence->getResponsibleSourcePoolDefinitionId($questionId);
42 
43  if( isset($handledSourcePoolDefinitions[$definitionId]) )
44  {
45  continue;
46  }
47 
48  if($this->wasAnsweredInThisPass($testSequence, $questionId))
49  {
50  $this->questionsPassMap[$questionId] = $pass;
51 
52  $this->questionsSourcePoolDefinitionMap[$questionId] = $definitionId;
53  }
54  }
55  }
56  }
57 }
Interface ilDBInterface.
Create styles array
The data for the language used.
wasAnsweredInThisPass(ilTestSequence $testSequence, $questionId)
__construct(ilDBInterface $db, ilObjTest $testOBJ, ilTestSequenceFactory $testSequenceFactory)