19declare(strict_types=1);
40 protected readonly UIFactory $ui_factory,
41 protected readonly DataFactory $data_factory,
45 protected readonly array
$data
51 array $visible_column_ids,
54 mixed $additional_viewcontrol_data,
56 mixed $additional_parameters
59 $title = $this->ui_factory->link()->standard($question[
'title'], $this->
createShowQuestionLink($question[
'sequence']));
61 'order' => (
int) $question[
'order'],
62 'title' => $title->withDisabled($question[
'disabled']),
63 'description' => $question[
'description'],
64 'points' => $question[
'points'],
65 'postponed' => (bool) $question[
'postponed'],
66 'answered' => (
bool) $question[
'worked_through'],
67 'marked' => (bool) $question[
'marked'],
69 yield $row_builder->
buildDataRow((
string) $question[
'order'], $record);
74 mixed $additional_viewcontrol_data,
76 mixed $additional_parameters
90 $is_start_page ? $this->
lng->txt(
'goto_first_question') : $this->
lng->txt(
'tst_resume_test'),
95 $button_text = $this->
lng->txt(
'finish_test');
97 if ($this->parent_gui->getObject()->getMainSettings()->getFinishingSettings()->getShowAnswerOverview()) {
98 $components[] = $this->ui_factory->button()->standard(
100 $this->
ctrl->getLinkTargetByClass(ilTestSubmissionReviewGUI::class,
'show')
103 $finish_test_modal = $this->parent_gui->buildFinishTestModal();
104 $components[] = $this->ui_factory->button()->standard($button_text,
'')
105 ->withOnClick($finish_test_modal->getShowSignal());
111 $this->
lng->txt(
'question_summary'),
114 ->withRequest($this->
http->request())
115 ->withId(
'listofquestions');
128 $this->
ctrl->setParameter($this->parent_gui,
'sequence', $sequence);
129 $this->
ctrl->setParameter($this->parent_gui,
'pmode',
'');
138 $column_factory = $this->ui_factory->table()->column();
139 $icon_factory = $this->ui_factory->symbol()->icon();
140 $icon_checked = $icon_factory->custom(
'assets/images/standard/icon_checked.svg', $this->
lng->txt(
'yes'));
141 $icon_unchecked = $icon_factory->custom(
'assets/images/standard/icon_unchecked.svg', $this->
lng->txt(
'no'));
142 $icon_marked = $icon_factory->custom(
'assets/images/object/marked.svg', $this->
lng->txt(
'tst_question_marked'));
145 'order' => $column_factory->number($this->
lng->txt(
'tst_qst_order')),
146 'title' => $column_factory->link($this->
lng->txt(
'tst_question')),
147 'description' => $column_factory->text($this->
lng->txt(
'description')),
148 'postponed' => $column_factory->boolean(ucfirst($this->
lng->txt(
'postponed')), $this->lng->txt(
'yes'),
''),
149 'points' => $column_factory->number($this->
lng->txt(
'tst_maximum_points'))->withUnit($this->
lng->txt(
'points_short')),
150 'answered' => $column_factory->boolean($this->
lng->txt(
'answered'), $icon_checked, $icon_unchecked),
151 'marked' => $column_factory->boolean($this->
lng->txt(
'tst_question_marker'), $icon_marked,
''),
154 $optional_columns = [
155 'description' => $this->isShowDescriptionEnabled(),
156 'postponed' => $this->isPostponingEnabled(),
157 'points' => $this->isShowPointsEnabled(),
158 'marked' => $this->isShowMarkerEnabled(),
162 foreach ($columns as $key => $column) {
163 if (isset($optional_columns[$key]) && !$optional_columns[$key]) {
166 $list[$key] = $column->withIsOptional(
false,
true)->withIsSortable(
false);
173 return $this->test->getListOfQuestionsDescription();
178 return $this->test->isPostponingEnabled();
183 return !$this->test->getTitleOutput();
188 return $this->test->getShowMarker();
Builds a Color from either hex- or rgb values.
Both the subject and the direction need to be specified when expressing an order.
A simple class to express a naive range of whole positive numbers.
getData(Range $range, Order $order)
createShowQuestionLink(int $sequence)
getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e....
buildComponents(bool $is_start_page)
isShowDescriptionEnabled()
__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)
Class ilTestSubmissionReviewGUI.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface GlobalHttpState.
A component is the most general form of an entity in the UI.
A Column describes the form of presentation for a certain aspect of data, i.e.
buildDataRow(string $id, array $record)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
button(string $caption, string $cmd)