19 declare(strict_types=1);
46 private readonly TestQuestionsRepository $questionrepository,
53 $table = $this->ui_factory->table()->ordering(
55 $this->table_actions->getOrderActionUrl(),
56 $this->
lng->txt(
'list_of_questions'),
59 ->withId((
string) $this->test_obj->getId())
60 ->withActions($this->table_actions->getActions())
61 ->withRequest($this->request);
63 if ($this->test_obj->isRandomTest()) {
72 array $visible_column_ids
75 $row = $record->getAsQuestionsTableRow(
79 $this->table_actions->getQuestionTargetLinkBuilder(),
83 yield $this->table_actions->setDisabledActions($row, $record);
89 $f = $this->ui_factory;
91 'question_id' =>
$f->table()->column()->text($this->
lng->txt(
'question_id'))
92 ->withIsOptional(
true,
false),
93 'title' =>
$f->table()->column()->link($this->
lng->txt(
'tst_question_title')),
94 'description' =>
$f->table()->column()->text($this->
lng->txt(
'description'))
95 ->withIsOptional(
true,
false),
96 'complete' =>
$f->table()->column()->boolean(
97 $this->
lng->txt(
'question_complete_title'),
98 $f->symbol()->icon()->custom(
'assets/images/standard/icon_checked.svg',
'',
'small'),
99 $f->symbol()->icon()->custom(
'assets/images/standard/icon_alert.svg',
'',
'small')
101 'type_tag' =>
$f->table()->column()->text($this->
lng->txt(
'tst_question_type')),
102 'points' =>
$f->table()->column()->text($this->
lng->txt(
'points')),
103 'author' =>
$f->table()->column()->text($this->
lng->txt(
'author'))
104 ->withIsOptional(
true,
false),
105 'lifecycle' =>
$f->table()->column()->text($this->
lng->txt(
'qst_lifecycle'))
106 ->withIsOptional(
true,
false),
107 'qpl' =>
$f->table()->column()->link($this->
lng->txt(
'qpl')),
108 'nr_of_answers' =>
$f->table()->column()->number($this->
lng->txt(
'number_of_answers'))
109 ->withIsOptional(
true,
false),
110 'average_points' =>
$f->table()->column()->number($this->
lng->txt(
'average_reached_points'))
111 ->withIsOptional(
true,
false),
112 'percentage_points_achieved' =>
$f->table()->column()->text($this->
lng->txt(
'percentage_points_achieved'))
113 ->withIsOptional(
true,
false),
121 $this->table_actions->getActions();
126 $records = $this->questionrepository
127 ->getQuestionPropertiesWithAggregatedResultsForTest($this->test_obj);
130 static fn(TestQuestionProperties
$a, TestQuestionProperties
$b):
int =>
131 $a->getSequenceInformation()?->getPlaceInSequence() <=> $b->getSequenceInformation()?->getPlaceInSequence()
__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,)
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_buil...
This describes a Table to specify the order of its data (rows).
withOrderingDisabled(bool $flag)
Turns ordering capabilites off/on.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples