ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestQuestionSetConfigFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
32 {
34 
35  public function __construct(
36  protected ilTree $tree,
37  protected ilDBInterface $db,
38  protected ilLanguage $lng,
39  protected ilLogger $log,
40  protected ilComponentRepository $component_repository,
41  protected ilObjTest $test_obj,
42  protected QuestionInfoService $questioninfo
43  ) {
44  }
45 
51  {
52  if ($this->testQuestionSetConfig === null) {
53  if ($this->test_obj->isFixedTest()) {
54  $this->testQuestionSetConfig = new ilTestFixedQuestionSetConfig(
55  $this->tree,
56  $this->db,
57  $this->lng,
58  $this->log,
59  $this->component_repository,
60  $this->test_obj,
61  $this->questioninfo
62  );
63  }
64  if ($this->test_obj->isRandomTest()) {
65  $this->testQuestionSetConfig = new ilTestRandomQuestionSetConfig(
66  $this->tree,
67  $this->db,
68  $this->lng,
69  $this->log,
70  $this->component_repository,
71  $this->test_obj,
72  $this->questioninfo
73  );
74  }
75 
76  $this->testQuestionSetConfig->loadFromDb();
77  }
78 
80  }
81 }
Readable part of repository interface to ilComponentDataDB.
$lng
$log
Definition: result.php:33
__construct(protected ilTree $tree, protected ilDBInterface $db, protected ilLanguage $lng, protected ilLogger $log, protected ilComponentRepository $component_repository, protected ilObjTest $test_obj, protected QuestionInfoService $questioninfo)
getQuestionSetConfig()
creates and returns an instance of a test question set config that corresponds to the test&#39;s current ...