ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ILIAS\Test\Questions\Presentation\QuestionsTable Class Reference
+ Inheritance diagram for ILIAS\Test\Questions\Presentation\QuestionsTable:
+ Collaboration diagram for ILIAS\Test\Questions\Presentation\QuestionsTable:

Public Member Functions

 __construct (private readonly UIFactory $ui_factory, private readonly Refinery $refinery, private readonly ServerRequestInterface $request, private readonly QuestionsTableActions $table_actions, private readonly Language $lng, private readonly \ilObjTest $test_obj, private readonly TestQuestionsRepository $questionrepository, private readonly TitleColumnsBuilder $title_builder,)
 
 getTableComponent ()
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids)
 This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids)
 This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 

Private Member Functions

 getColumns ()
 
 getActions ()
 
 getRecords ()
 

Detailed Description

Definition at line 34 of file QuestionsTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Questions\Presentation\QuestionsTable::__construct ( private readonly UIFactory  $ui_factory,
private readonly Refinery  $refinery,
private readonly ServerRequestInterface  $request,
private readonly QuestionsTableActions  $table_actions,
private readonly Language  $lng,
private readonly \ilObjTest  $test_obj,
private readonly TestQuestionsRepository  $questionrepository,
private readonly TitleColumnsBuilder  $title_builder 
)
Parameters
array$data<string, mixed>

Definition at line 39 of file QuestionsTable.php.

48 {
49 }

Member Function Documentation

◆ getActions()

ILIAS\Test\Questions\Presentation\QuestionsTable::getActions ( )
private

Definition at line 120 of file QuestionsTable.php.

120 : array
121 {
122 $this->table_actions->getActions();
123 }

◆ getColumns()

ILIAS\Test\Questions\Presentation\QuestionsTable::getColumns ( )
private

Definition at line 88 of file QuestionsTable.php.

88 : array
89 {
90 $f = $this->ui_factory;
91 $columns = [
92 'question_id' => $f->table()->column()->text($this->lng->txt('question_id'))
93 ->withIsOptional(true, false),
94 'title' => $f->table()->column()->link($this->lng->txt('tst_question_title')),
95 'description' => $f->table()->column()->text($this->lng->txt('description'))
96 ->withIsOptional(true, false),
97 'complete' => $f->table()->column()->boolean(
98 $this->lng->txt('question_complete_title'),
99 $f->symbol()->icon()->custom('assets/images/standard/icon_checked.svg', '', 'small'),
100 $f->symbol()->icon()->custom('assets/images/standard/icon_alert.svg', '', 'small')
101 ),
102 'type_tag' => $f->table()->column()->text($this->lng->txt('tst_question_type')),
103 'points' => $f->table()->column()->text($this->lng->txt('points')),
104 'author' => $f->table()->column()->text($this->lng->txt('author'))
105 ->withIsOptional(true, false),
106 'lifecycle' => $f->table()->column()->text($this->lng->txt('qst_lifecycle'))
107 ->withIsOptional(true, false),
108 'qpl' => $f->table()->column()->link($this->lng->txt('qpl')),
109 'nr_of_answers' => $f->table()->column()->number($this->lng->txt('number_of_answers'))
110 ->withIsOptional(true, false),
111 'average_points' => $f->table()->column()->number($this->lng->txt('average_reached_points'))
112 ->withIsOptional(true, false),
113 'percentage_points_achieved' => $f->table()->column()->text($this->lng->txt('percentage_points_achieved'))
114 ->withIsOptional(true, false),
115 ];
116
117 return $columns;
118 }

References Vendor\Package\$f, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getRecords()

ILIAS\Test\Questions\Presentation\QuestionsTable::getRecords ( )
private

Definition at line 125 of file QuestionsTable.php.

125 : \Generator
126 {
127 $records = $this->questionrepository
128 ->getQuestionPropertiesWithAggregatedResultsForTest($this->test_obj);
129 usort(
130 $records,
131 static fn(TestQuestionProperties $a, TestQuestionProperties $b): int =>
132 $a->getSequenceInformation()?->getPlaceInSequence() <=> $b->getSequenceInformation()?->getPlaceInSequence()
133 );
134 yield from $records;
135 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, Vendor\Package\$b, and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from().

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Test\Questions\Presentation\QuestionsTable::getRows ( OrderingRowBuilder  $row_builder,
array  $visible_column_ids 
)

This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g.

yield $row_builder->buildOrderingRow($row_id, $record).

Implements ILIAS\UI\Component\Table\OrderingRetrieval.

Definition at line 71 of file QuestionsTable.php.

74 : \Generator {
75 foreach ($this->getRecords() as $record) {
76 $row = $record->getAsQuestionsTableRow(
77 $this->lng,
78 $this->ui_factory,
79 $this->refinery,
80 $this->table_actions->getQuestionTargetLinkBuilder(),
81 $row_builder,
82 $this->title_builder
83 );
84 yield $this->table_actions->setDisabledActions($row, $record);
85 }
86 }

References ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getTableComponent()

ILIAS\Test\Questions\Presentation\QuestionsTable::getTableComponent ( )

Definition at line 51 of file QuestionsTable.php.

51 : Ordering
52 {
53 $table = $this->ui_factory->table()->ordering(
54 $this,
55 $this->table_actions->getOrderActionUrl(),
56 $this->lng->txt('list_of_questions'),
57 $this->getColumns(),
58 )
59 ->withId((string) $this->test_obj->getId())
60 ->withActions($this->table_actions->getActions())
61 ->withRequest($this->request);
62
63 if ($this->test_obj->isRandomTest()
64 || $this->test_obj->evalTotalPersons() !== 0) {
65 return $table->withOrderingDisabled(true);
66 }
67
68 return $table;
69 }

References ILIAS\UI\Component\Table\Ordering\withId().

+ Here is the call graph for this function:

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