ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
QuestionPoolDIC.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\TestQuestionPool;
22 
29 use ILIAS\Test\Settings\GlobalSettings\Repository as GlobalTestSettingsRepository;
31 
33 {
34  public static ?self $dic = null;
35 
36  public static function dic(): self
37  {
38  if (!self::$dic) {
39  global $DIC;
40  self::$dic = self::buildDIC($DIC);
41  }
42  return self::$dic;
43  }
44 
45  protected static function buildDIC(ILIASContainer $DIC): self
46  {
47  $dic = new self();
48  $dic['request_data_collector'] = static fn($c): RequestDataCollector =>
50  $DIC->http(),
51  $DIC['refinery'],
52  $DIC['upload']
53  );
54  $dic['question.repo.suggestedsolutions'] = static fn($c): SuggestedSolutionsDatabaseRepository =>
55  new SuggestedSolutionsDatabaseRepository($DIC['ilDB']);
56  $dic['question.general_properties.repository'] = static fn($c): GeneralQuestionPropertiesRepository =>
58  $DIC['ilDB'],
59  $DIC['component.factory'],
60  $DIC['component.repository']
61  );
62  $dic['question_files'] = fn($c): QuestionFiles =>
63  new QuestionFiles();
64 
65  $dic['participant_repository'] = static fn($c): ParticipantRepository =>
66  new ParticipantRepository($DIC['ilDB']);
67  $dic['global_test_settings'] = static fn($c): GlobalTestSettings =>
68  (new GlobalTestSettingsRepository($DIC['ilSetting'], new \ilSetting('assessment')))->getGlobalSettings();
69 
70  return $dic;
71  }
72 }
$c
Definition: deliver.php:25
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$dic
Definition: result.php:31
static buildDIC(ILIASContainer $DIC)