ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.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.ilTestRandomQuestionSetSourcePoolDefinition.php';
5 
13 {
17  private $db = null;
18 
22  private $testOBJ = null;
23 
29  {
30  $this->db = $db;
31  $this->testOBJ = $testOBJ;
32  }
33 
37  public function getSourcePoolDefinitionByOriginalPoolData($originalPoolData)
38  {
39  $sourcePoolDefinition = $this->buildDefinitionInstance();
40 
41  $sourcePoolDefinition->setPoolId( $originalPoolData['qpl_id'] );
42  $sourcePoolDefinition->setPoolTitle( $originalPoolData['qpl_title'] );
43  $sourcePoolDefinition->setPoolPath( $originalPoolData['qpl_path'] );
44  $sourcePoolDefinition->setPoolQuestionCount( $originalPoolData['count'] );
45 
46  return $sourcePoolDefinition;
47  }
48 
52  public function getSourcePoolDefinitionByDefinitionId($definitionId)
53  {
54  $sourcePoolDefinition = $this->buildDefinitionInstance();
55 
56  $sourcePoolDefinition->loadFromDb($definitionId);
57 
58  return $sourcePoolDefinition;
59  }
60 
64  public function getEmptySourcePoolDefinition()
65  {
66  return $this->buildDefinitionInstance();
67  }
68 
72  private function buildDefinitionInstance()
73  {
74  return new ilTestRandomQuestionSetSourcePoolDefinition($this->db, $this->testOBJ);
75  }
76 }
Interface ilDBInterface.