ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Test\GUIFactory Class Reference
+ Collaboration diagram for ILIAS\Test\GUIFactory:

Public Member Functions

 get (string $gui_name, \ilObjTest $test_obj)
 
 __construct (private PimpleContainer $global_dic, private TestDIC $test_dic)
 

Private Attributes

array $definitions
 
array $internal
 

Detailed Description

Definition at line 32 of file GUIFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\GUIFactory::__construct ( private PimpleContainer  $global_dic,
private TestDIC  $test_dic 
)

Definition at line 45 of file GUIFactory.php.

48 {
49 $this->definitions['ILIAS\Test\Scoring\Manual\ConsecutiveScoringGUI'] = fn(\ilObjTest $test_obj): ConsecutiveScoringGUI =>
50 new ConsecutiveScoringGUI(
51 $this->global_dic['ilCtrl'],
52 $this->global_dic['tpl'],
53 $this->global_dic['ilTabs'],
54 $this->global_dic['lng'],
55 $test_obj,
56 $this->internal['test.access']($test_obj),
57 $this->global_dic['ui.factory'],
58 $this->global_dic['ui.renderer'],
59 $this->global_dic['refinery'],
60 $this->global_dic->http()->request(),
61 $this->test_dic['response_handler'],
62 $this->internal['manscoring.consecutive']($test_obj),
63 $this->internal['urlbuilder.manscoring']($test_obj),
64 $this->global_dic->uiService()->filter(),
65 );
66
67 $this->internal['test.access'] = static fn(\ilObjTest $test_obj): \ilTestAccess =>
68 new \ilTestAccess($test_obj->getRefId());
69
70 $this->internal['manscoring.consecutive'] = fn(\ilObjTest $test_obj): ConsecutiveScoring =>
71 new ConsecutiveScoring(
72 $this->internal['manscoring.positionsfactory']($test_obj)->get(),
73 $test_obj,
74 $this->test_dic['shuffler'],
75 $this->test_dic['logging.logger'],
76 $this->internal['manscoring.testscoring']($test_obj),
77 $this->test_dic['scoring.manual.done_helper'],
78 $this->global_dic['ilUser'],
79 $this->internal['test.access']($test_obj),
80 );
81
82 $this->internal['manscoring.positionsfactory'] = fn(\ilObjTest $test_obj): PositionsFactory =>
83 new PositionsFactory(
84 $test_obj,
85 $this->test_dic['question.general_properties.repository']
86 );
87
88 $this->internal['manscoring.testscoring'] = fn(\ilObjTest $test_obj): TestScoring =>
89 new TestScoring(
90 $test_obj,
91 $this->global_dic['ilUser'],
92 $this->global_dic['ilDB'],
93 $this->test_dic['results.data.repository']
94 );
95
96 $this->internal['urlbuilder.current'] = fn(): URLBuilder =>
97 new URLBuilder(
98 (new DataFactory())->uri($this->global_dic->http()->request()->getUri()->__toString())
99 );
100
101 $this->internal['urlbuilder.manscoring'] = fn(\ilObjTest $test_obj): ConsecutiveScoringURLs =>
102 new ConsecutiveScoringURLs(
103 $this->internal['urlbuilder.current'](),
104 ['tams_' . $test_obj->getRefId()],
105 $this->global_dic['refinery'],
106 $this->global_dic['http']->wrapper()->query(),
107 $this->global_dic['ilCtrl'],
108 );
109 }
get(string $gui_name, \ilObjTest $test_obj)
Definition: GUIFactory.php:37
static http()
Fetches the global http state from ILIAS.
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)

References ilObject\getRefId().

+ Here is the call graph for this function:

Member Function Documentation

◆ get()

ILIAS\Test\GUIFactory::get ( string  $gui_name,
\ilObjTest  $test_obj 
)

Definition at line 37 of file GUIFactory.php.

38 {
39 if (! array_key_exists($gui_name, $this->definitions)) {
40 throw new \InvalidArgumentException('No such GUI: ' . $gui_name);
41 }
42 return $this->definitions[$gui_name]($test_obj);
43 }

Field Documentation

◆ $definitions

array ILIAS\Test\GUIFactory::$definitions
private

Definition at line 34 of file GUIFactory.php.

◆ $internal

array ILIAS\Test\GUIFactory::$internal
private

Definition at line 35 of file GUIFactory.php.


The documentation for this class was generated from the following file: