19 declare(strict_types=1);
    44         private readonly 
string $table_id,
    45         private readonly \
ilObjUser $current_user,
    49         private readonly \
ilCtrl $ctrl,
    53         private readonly 
string $parent_title
    59         return $this->ui_factory->table()->data(
    60             $this->
lng->txt(
'list_of_questions'),
    63         )->withId($this->table_id)
    65         ->withRequest($request)
    66         ->withFilter($filter);
    71         $column_factory = $this->ui_factory->table()->column();
    72         $icon_factory = $this->ui_factory->symbol()->icon();
    73         $iconYes = $icon_factory->custom(
'assets/images/standard/icon_checked.svg', 
'yes');
    74         $iconNo = $icon_factory->custom(
'assets/images/standard/icon_unchecked.svg', 
'no');
    77             'title' => $column_factory->text(
    78                 $this->
lng->txt(
'tst_question_title')
    79             )->withIsOptional(
false, 
true),
    80             'description' => $column_factory->text(
    81                 $this->
lng->txt(
'description')
    82             )->withIsOptional(
true, 
true),
    83             'type_tag' => $column_factory->text(
    84                 $this->
lng->txt(
'tst_question_type')
    85             )->withIsOptional(
false, 
true),
    86             'points' => $column_factory->number(
    87                 $this->
lng->txt(
'points')
    88             )->withIsOptional(
false, 
true),
    89             'author' => $column_factory->text(
    90                 $this->
lng->txt(
'author')
    91             )->withIsOptional(
true, 
false),
    92             'lifecycle' => $column_factory->text(
    93                 $this->
lng->txt(
'qst_lifecycle')
    94             )->withIsOptional(
true, 
false),
    95             'parent_title' => $column_factory->text(
    96                 $this->
lng->txt($this->parent_title)
    97             )->withIsOptional(
false, 
true),
    98             'taxonomies' => $column_factory->text(
    99                 $this->
lng->txt(
'qpl_settings_subtab_taxonomies')
   100             )->withIsOptional(
false, 
true),
   101             'feedback' => $column_factory->boolean(
   102                 $this->
lng->txt(
'feedback'),
   105             )->withIsOptional(
true, 
false),
   106             'hints' => $column_factory->boolean(
   107                 $this->
lng->txt(
'hints'),
   110             )->withIsOptional(
true, 
false),
   111             'created' => $column_factory->date(
   112                 $this->
lng->txt(
'created'),
   113                 $this->current_user->getDateTimeFormat()
   114             )->withIsOptional(
true, 
false),
   115             'tstamp' => $column_factory->date(
   116                 $this->
lng->txt(
'updated'),
   117                 $this->current_user->getDateTimeFormat()
   118             )->withIsOptional(
true, 
false)
   131         $url_builder = 
new URLBuilder($this->data_factory->uri(
   132             ServerRequest::getUriFromGlobals() . $this->ctrl->getLinkTargetByClass(
   133                 ilTestQuestionBrowserTableGUI::class,
   138         [$url_builder, $row_id_token] = $url_builder->acquireParameters([
'qlist'], 
'q_id');
   140         return $this->ui_factory->table()->action()->standard(
   141             $this->
lng->txt(
'tst_insert_in_test'),
   149         array $visible_column_ids,
   153         ?array $additional_parameters
   155         $timezone = new \DateTimeZone($this->current_user->getTimeZone());
   156         foreach ($this->
loadRecords($filter_data ?? [], $order, $range) as $record) {
   157             $question_id = $record[
'question_id'];
   159             $record[
'type_tag'] = $this->
lng->txt($record[
'type_tag']);
   160             $record[
'complete'] = (bool) $record[
'complete'];
   163             $record[
'created'] = (new \DateTimeImmutable(
"@{$record['created']}"))->setTimezone($timezone);
   164             $record[
'tstamp'] = (new \DateTimeImmutable(
"@{$record['tstamp']}"))->setTimezone($timezone);
   167             yield $row_builder->
buildDataRow((
string) $question_id, $record);
   175         return $this->question_list->getTotalRowCount($filter_data, $additional_parameters);
   182         $this->question_list->setOrder($order);
   183         $this->question_list->setRange(
$range);
   184         $this->question_list->load();
   186         return $this->question_list->getQuestionDataArray();
   191         foreach (array_filter($filters) as $key => $filter) {
   192             if ($key === 
'commented') {
   193                 $this->question_list->setCommentFilter((
int) $filter);
   197             $this->question_list->addFieldFilter($key, $filter);
   203         $available_taxonomy_ids = $this->taxonomy->getUsageOfObject($obj_fi);
   208         foreach (
$data as $taxonomyId => $taxData) {
   210             $taxonomies[] = $this->ui_renderer->render(
   211                 $this->ui_factory->listing()->unordered(
   213                         return \ilTaxonomyNode::_lookupTitle($node[
'node_id']);
   219         return implode(
'', $taxonomies);
   224         $taxonomyAssignmentData = [];
   226         foreach ($available_taxonomy_ids as $taxId) {
   227             $taxTree = new \ilTaxonomyTree($taxId);
   228             $assignments = (new \ilTaxNodeAssignment(
   233             ))->getAssignmentsOfItem($questionId);
   235             foreach ($assignments as $assData) {
   236                 $taxId = $assData[
'tax_id'];
   237                 if (!isset($taxonomyAssignmentData[$taxId])) {
   238                     $taxonomyAssignmentData[$taxId] = [];
   241                 $nodeId = $assData[
'node_id'];
   242                 $assData[
'node_lft'] = $taxTree->getNodeData($nodeId)[
'lft'];
   243                 $taxonomyAssignmentData[$taxId][$nodeId] = $assData;
   247         return $taxonomyAssignmentData;
 getComponent(ServerRequestInterface $request, ?array $filter)
 
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...
 
static getInstance($identifier)
 
withIsSortable(bool $flag)
 
loadRecords(array $filters=[], ?Order $order=null, ?Range $range=null)
 
loadTaxonomyAssignmentData(int $parentObjId, int $questionId, array $available_taxonomy_ids)
 
Both the subject and the direction need to be specified when expressing an order. ...
 
buildDataRow(string $id, array $record)
 
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...
 
static _lookupTitle(int $obj_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(private readonly string $table_id, private readonly \ilObjUser $current_user, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly \ilLanguage $lng, private readonly \ilCtrl $ctrl, private readonly DataFactory $data_factory, private readonly \ilAssQuestionList $question_list, private readonly TaxonomyService $taxonomy, private readonly string $parent_title)
 
addFiltersToQuestionList(array $filters)
 
resolveTaxonomiesRowData(int $obj_fi, int $questionId)
 
A simple class to express a naive range of whole positive numbers. 
 
A Column describes the form of presentation for a certain aspect of data, i.e. 
 
const CMD_INSERT_QUESTIONS