ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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...
 

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 115 of file QuestionsTable.php.

115  : array
116  {
117  $this->table_actions->getActions();
118  }

◆ getColumns()

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

Definition at line 83 of file QuestionsTable.php.

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

Referenced by ILIAS\Test\Questions\Presentation\QuestionsTable\getTableComponent().

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

◆ getRecords()

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

Definition at line 120 of file QuestionsTable.php.

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

Referenced by ILIAS\Test\Questions\Presentation\QuestionsTable\getRows().

120  : \Generator
121  {
122  $records = $this->questionrepository
123  ->getQuestionPropertiesWithAggregatedResultsForTest($this->test_obj);
124  usort(
125  $records,
126  static fn(TestQuestionProperties $a, TestQuestionProperties $b): int =>
127  $a->getSequenceInformation()?->getPlaceInSequence() <=> $b->getSequenceInformation()?->getPlaceInSequence()
128  );
129  yield from $records;
130  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller 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 66 of file QuestionsTable.php.

References ILIAS\Test\Questions\Presentation\QuestionsTable\getRecords(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

69  : \Generator {
70  foreach ($this->getRecords() as $record) {
71  $row = $record->getAsQuestionsTableRow(
72  $this->lng,
73  $this->ui_factory,
74  $this->refinery,
75  $this->table_actions->getQuestionTargetLinkBuilder(),
76  $row_builder,
77  $this->title_builder
78  );
79  yield $this->table_actions->setDisabledActions($row, $record);
80  }
81  }
+ Here is the call graph for this function:

◆ getTableComponent()

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

Definition at line 51 of file QuestionsTable.php.

References ILIAS\Test\Questions\Presentation\QuestionsTable\getColumns(), and ILIAS\Repository\lng().

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  return $table;
64  }
+ Here is the call graph for this function:

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