ILIAS  release_8 Revision v8.24
class.ilTestQuestionSetConfigFactory.php
Go to the documentation of this file.
1<?php
2
28{
29 private ilTree $tree;
34
35 public function __construct(
40 ) {
41 $this->tree = $tree;
42 $this->db = $db;
43 $this->component_repository = $component_repository;
44 $this->testOBJ = $testOBJ;
45 }
46
52 {
53 return $this->getQuestionSetConfigByType();
54 }
55
61 {
62 if ($this->testQuestionSetConfig === null) {
63 if ($this->testOBJ->isFixedTest()) {
64 $this->testQuestionSetConfig = new ilTestFixedQuestionSetConfig(
65 $this->tree,
66 $this->db,
67 $this->component_repository,
68 $this->testOBJ
69 );
70 }
71 if ($this->testOBJ->isRandomTest()) {
72 $this->testQuestionSetConfig = new ilTestRandomQuestionSetConfig(
73 $this->tree,
74 $this->db,
75 $this->component_repository,
76 $this->testOBJ
77 );
78 }
79
80 if ($this->testOBJ->isDynamicTest()) {
81 $this->testQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig(
82 $this->tree,
83 $this->db,
84 $this->component_repository,
85 $this->testOBJ
86 );
87 }
88
89 $this->testQuestionSetConfig->loadFromDb();
90 }
91
93 }
94}
getQuestionSetConfig()
creates and returns an instance of a test question set config that corresponds to the test's current ...
__construct(ilTree $tree, ilDBInterface $db, ilComponentRepository $component_repository, ilObjTest $testOBJ)
getQuestionSetConfigByType()
creates and returns an instance of a test question set config that corresponds to the passed question...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Readable part of repository interface to ilComponentDataDB.
Interface ilDBInterface.