ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestQuestionSetConfig.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 {
28  public function __construct(
29  protected ilTree $tree,
30  protected ilDBInterface $db,
31  protected ilLanguage $lng,
32  protected ilLogger $log,
33  protected ilComponentRepository $component_repository,
34  protected ilObjTest $test_obj,
35  protected \ILIAS\TestQuestionPool\QuestionInfoService $questioninfo
36  ) {
37  }
38 
39  abstract public function loadFromDb(): void;
40  abstract public function saveToDb(): void;
41  abstract public function cloneToDbForTestId(int $testId): void;
42  abstract public function deleteFromDb(): void;
43 
44  public function areDepenciesInVulnerableState(): bool
45  {
46  return false;
47  }
48 
50  {
51  return '';
52  }
53 
54  public function areDepenciesBroken(): bool
55  {
56  return false;
57  }
58 
59  public function getDepenciesBrokenMessage(ilLanguage $lng): string
60  {
61  return '';
62  }
63 
64  public function isValidRequestOnBrokenQuestionSetDepencies(string $next_class, string $cmd): bool
65  {
66  return true;
67  }
68 
69  public function getHiddenTabsOnBrokenDepencies(): array
70  {
71  return [];
72  }
73 
74  abstract public function isQuestionSetConfigured(): bool;
75  abstract public function doesQuestionSetRelatedDataExist(): bool;
76  abstract public function removeQuestionSetRelatedData(): void;
77  abstract public function cloneQuestionSetRelatedData(ilObjTest $clone_test_obj): void;
78 
79  public function getQuestionPoolPathString(int $pool_id): string
80  {
81  $ref_id = current(ilObject::_getAllReferences($pool_id));
82 
83  $path = new ilPathGUI();
84  $path->enableTextOnly(true);
85  return $path->getPath(ROOT_FOLDER_ID, (int) $ref_id);
86  }
87 
88  public function getFirstQuestionPoolRefIdByObjId(int $pool_obj_id): int
89  {
90  $refs_ids = ilObject::_getAllReferences($pool_obj_id);
91  $refs_id = current($refs_ids);
92 
93  return (int) $refs_id;
94  }
95 
96  abstract public function isResultTaxonomyFilterSupported(): bool;
97 }
getDepenciesInVulnerableStateMessage(ilLanguage $lng)
Creates a path for a start and endnode.
Readable part of repository interface to ilComponentDataDB.
const ROOT_FOLDER_ID
Definition: constants.php:32
Class ChatMainBarProvider .
cloneQuestionSetRelatedData(ilObjTest $clone_test_obj)
static _getAllReferences(int $id)
get all reference ids for object ID
$path
Definition: ltiservices.php:32
$ref_id
Definition: ltiauth.php:67
$lng
$log
Definition: result.php:33
isValidRequestOnBrokenQuestionSetDepencies(string $next_class, string $cmd)
getFirstQuestionPoolRefIdByObjId(int $pool_obj_id)
__construct(protected ilTree $tree, protected ilDBInterface $db, protected ilLanguage $lng, protected ilLogger $log, protected ilComponentRepository $component_repository, protected ilObjTest $test_obj, protected \ILIAS\TestQuestionPool\QuestionInfoService $questioninfo)
cloneToDbForTestId(int $testId)