19 declare(strict_types=1);
39 private bool $marks_editable,
50 $f = $this->ui_factory->table();
54 $this->
lng->txt(
'mark_schema'),
56 'name' =>
$f->column()->text($this->
lng->txt(
'tst_mark_short_form')),
57 'official_name' =>
$f->column()->text($this->
lng->txt(
'tst_mark_official_form')),
58 'minimum_level' =>
$f->column()->text($this->
lng->txt(
'tst_mark_minimum_level')),
59 'passed' =>
$f->column()->boolean(
60 $this->
lng->txt(
'tst_mark_passed'),
61 $this->ui_factory->symbol()->icon()->custom(
62 'assets/images/standard/icon_checked.svg',
63 $this->
lng->txt(
'yes'),
66 $this->ui_factory->symbol()->icon()->custom(
67 'assets/images/standard/icon_unchecked.svg',
68 $this->
lng->txt(
'no'),
75 if (!$this->marks_editable) {
79 return $table->withActions(
81 self::EDIT_ACTION_NAME =>
$f->action()->single(
82 $this->
lng->txt(
'edit'),
83 $this->url_builder->withParameter($this->action_parameter_token, self::EDIT_ACTION_NAME),
86 self::DELETE_ACTION_NAME =>
$f->action()->single(
87 $this->
lng->txt(
'delete'),
88 $this->url_builder->withParameter($this->action_parameter_token, self::DELETE_ACTION_NAME),
97 array $visible_column_ids,
101 ?array $additional_parameters
103 foreach ($this->mark_schema->getMarkSteps() as $index => $mark) {
107 'name' => $mark->getShortName(),
108 'official_name' => $mark->getOfficialName(),
109 'minimum_level' => $mark->getMinimumLevel(),
110 'passed' => $mark->getPassed()
112 )->withDisabledAction(
'edit', !$this->marks_editable)
113 ->withDisabledAction(
115 !$this->marks_editable
116 || $mark->getMinimumLevel() === 0.0 && $this->mark_schema->hasSingleZeroPercentageMark()
117 || $mark->getPassed() && $this->mark_schema->hasSinglePassedMark()
124 ?array $additional_parameters
126 return count($this->mark_schema->getMarkSteps());
A class defining mark schemas for assessment test objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Both the subject and the direction need to be specified when expressing an order. ...
buildDataRow(string $id, array $record)
__construct(private MarkSchema $mark_schema, private bool $marks_editable, private \ilLanguage $lng, private URLBuilder $url_builder, private URLBuilderToken $action_parameter_token, private URLBuilderToken $row_id_token, private UIFactory $ui_factory)
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...
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...
A simple class to express a naive range of whole positive numbers.