19 declare(strict_types=1);
45 protected readonly array
$data 51 array $visible_column_ids,
55 ?array $additional_parameters
57 foreach ($this->
getData($range, $order) as $question) {
58 $title = $this->ui_factory->link()->standard($question[
'title'], $this->
createShowQuestionLink($question[
'sequence']));
60 'order' => (
int) $question[
'order'],
61 'title' => $title->withDisabled($question[
'disabled']),
62 'description' => $question[
'description'],
63 'points' => $question[
'points'],
64 'postponed' => (bool) $question[
'postponed'],
65 'answered' => (
bool) $question[
'isAnswered'],
66 'marked' => (bool) $question[
'marked'],
68 yield $row_builder->
buildDataRow((
string) $question[
'order'], $record);
75 return count($this->data);
84 $this->ui_factory->button()->standard(
85 $this->
lng->txt(
'tst_resume_test'),
90 $button_text = $this->
lng->txt(
'finish_test');
92 if ($this->parent_gui->getObject()->getMainSettings()->getFinishingSettings()->getShowAnswerOverview()) {
93 $components[] = $this->ui_factory->button()->standard(
95 $this->
ctrl->getLinkTargetByClass(ilTestSubmissionReviewGUI::class,
'show')
98 $finish_test_modal = $this->parent_gui->buildFinishTestModal();
99 $components[] = $this->ui_factory->button()->standard($button_text,
'')
100 ->withOnClick($finish_test_modal->getShowSignal());
106 $this->
lng->txt(
'question_summary'),
109 ->withRequest($this->
http->request())
110 ->withId(
'listofquestions');
123 $this->
ctrl->setParameter($this->parent_gui,
'sequence', $sequence);
124 $this->
ctrl->setParameter($this->parent_gui,
'pmode',
'');
133 $column_factory = $this->ui_factory->table()->column();
134 $icon_factory = $this->ui_factory->symbol()->icon();
135 $icon_checked = $icon_factory->custom(
'assets/images/standard/icon_checked.svg', $this->
lng->txt(
'yes'));
136 $icon_unchecked = $icon_factory->custom(
'assets/images/standard/icon_unchecked.svg', $this->
lng->txt(
'no'));
137 $icon_marked = $icon_factory->custom(
'assets/images/object/marked.svg', $this->
lng->txt(
'tst_question_marked'));
140 'order' => $column_factory->number($this->
lng->txt(
'tst_qst_order')),
141 'title' => $column_factory->link($this->lng->txt(
'tst_question')),
142 'description' => $column_factory->text($this->lng->txt(
'description')),
143 'postponed' => $column_factory->boolean(ucfirst($this->
lng->txt(
'postponed')), $this->
lng->txt(
'yes'),
''),
144 'points' => $column_factory->number($this->lng->txt(
'tst_maximum_points'))->withUnit($this->
lng->txt(
'points_short')),
145 'answered' => $column_factory->boolean($this->lng->txt(
'answered'), $icon_checked, $icon_unchecked),
146 'marked' => $column_factory->boolean($this->lng->txt(
'tst_question_marker'), $icon_marked,
''),
149 $optional_columns = [
157 foreach ($columns as $key => $column) {
158 if (isset($optional_columns[$key]) && !$optional_columns[$key]) {
161 $list[$key] = $column->withIsOptional(
false,
true)->withIsSortable(
false);
168 return $this->test->getListOfQuestionsDescription();
173 return $this->test->isPostponingEnabled();
178 return !$this->test->getTitleOutput();
183 return $this->test->getShowMarker();
getData(Range $range, Order $order)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(protected readonly \ilLanguage $lng, protected readonly \ilCtrlInterface $ctrl, protected readonly UIFactory $ui_factory, protected readonly DataFactory $data_factory, protected readonly GlobalHttpState $http, protected readonly \ilTestPlayerAbstractGUI $parent_gui, protected readonly \ilObjTest $test, protected readonly array $data)
getTotalRowCount(?array $filter_data, ?array $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
isShowDescriptionEnabled()
Both the subject and the direction need to be specified when expressing an order. ...
buildDataRow(string $id, array $record)
static http()
Fetches the global http state from ILIAS.
createShowQuestionLink(int $sequence)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A simple class to express a naive range of whole positive numbers.
getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e...