ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable Class Reference
+ Inheritance diagram for ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable:
+ Collaboration diagram for ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable:

Public Member Functions

 __construct (protected UIFactory $ui_factory, protected UIRenderer $ui_renderer, protected DataFactory $data_factory, protected Refinery $refinery, protected URLBuilder $url_builder, protected URLBuilderToken $action_parameter_token, protected URLBuilderToken $row_id_token, protected \ilDBInterface $db, protected \ilLanguage $lng, protected \ilComponentRepository $component_repository, protected \ilRbacSystem $rbac, protected \ilObjUser $current_user, protected TaxonomyService $taxonomy, protected NotesService $notes_service, protected int $parent_obj_id, protected int $request_ref_id)
 
 getTable ()
 
 getFilter (\ilUIService $ui_service, string $action)
 Filters should be part of the Table; for now, since they are not fully integrated, they are rendered and applied seperately. More...
 
 getColums ()
 
 getRows (Table\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 
- Public Member Functions inherited from ilAssQuestionList
 __construct (private ilDBInterface $db, private ilLanguage $lng, private Refinery $refinery, private ilComponentRepository $component_repository, private ?NotesService $notes_service=null)
 
 setOrder (?Order $order=null)
 
 setRange (?Range $range=null)
 
 getParentObjId ()
 
 setParentObjId (?int $parentObjId)
 
 setParentObjectType (string $parentObjType)
 
 setParentObjIdsFilter (array $parentObjIdsFilter)
 
 setQuestionInstanceTypeFilter (?string $questionInstanceTypeFilter)
 
 setIncludeQuestionIdsFilter (array $questionIdsFilter)
 
 setExcludeQuestionIdsFilter (array $excludeQuestionIdsFilter)
 
 addFieldFilter (string $fieldName, mixed $fieldValue)
 
 addTaxonomyFilter ($taxId, $taxNodes, $parentObjId, $parentObjType)
 
 addTaxonomyFilterNoTaxonomySet (bool $flag)
 
 setAvailableTaxonomyIds (array $availableTaxonomyIds)
 
 setAnswerStatusActiveId (?int $answerStatusActiveId)
 
 setAnswerStatusFilter (string $answerStatusFilter)
 
 setJoinObjectData (bool $a_val)
 Set if object data table should be joined. More...
 
 load ()
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 
 setCommentFilter (?int $commented=null)
 
 getDataArrayForQuestionId (int $questionId)
 
 getQuestionDataArray ()
 
 isInList (int $questionId)
 
 getTitle (string $a_comp_id, string $a_item_type, int $a_item_id)
 Get title of an assigned item. More...
 

Protected Member Functions

 getData (Order $order, Range $range)
 
 getActions ()
 
 buildAction (string $act, string $type, bool $async=false)
 
 postOrder (array $list, \ILIAS\Data\Order $order)
 
- Protected Member Functions inherited from ilAssQuestionList
 getTaxItems (string $parentType, int $parentObjId, int $taxId, int $taxNode)
 
 getNumberOfCommentsForQuestion (int $question_id)
 

Private Member Functions

 treeify (&$pointer, $stack)
 
 toNestedList (array $nodes)
 
 taxNodeReader ($tree, $sortfield, $node_id)
 
 singleTaxonomyRepresentation (int $tax_id, array $stored_tax_data, string $check_marker)
 
 taxonomyRepresentation (array $taxonomy_data)
 
 showCommentAction ()
 

Additional Inherited Members

- Data Fields inherited from ilAssQuestionList
const QUESTION_ANSWER_STATUS_NON_ANSWERED = 'nonAnswered'
 answer status domain for single questions More...
 
const QUESTION_ANSWER_STATUS_WRONG_ANSWERED = 'wrongAnswered'
 
const QUESTION_ANSWER_STATUS_CORRECT_ANSWERED = 'correctAnswered'
 
const ANSWER_STATUS_FILTER_ALL_NON_CORRECT = 'allNonCorrect'
 answer status filter value domain More...
 
const ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY = 'nonAnswered'
 
const ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY = 'wrongAnswered'
 
const QUESTION_INSTANCE_TYPE_ORIGINALS = 'QST_INSTANCE_TYPE_ORIGINALS'
 
const QUESTION_INSTANCE_TYPE_DUPLICATES = 'QST_INSTANCE_TYPE_DUPLICATES'
 
const QUESTION_INSTANCE_TYPE_ALL = 'QST_INSTANCE_TYPE_ALL'
 
const QUESTION_COMMENTED_ONLY = '1'
 
const QUESTION_COMMENTED_EXCLUDED = '2'
 
- Protected Attributes inherited from ilAssQuestionList
bool $join_obj_data = true
 
string $filter_comments = null
 
array $questions = []
 

Detailed Description

Definition at line 36 of file QuestionTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::__construct ( protected UIFactory  $ui_factory,
protected UIRenderer  $ui_renderer,
protected DataFactory  $data_factory,
protected Refinery  $refinery,
protected URLBuilder  $url_builder,
protected URLBuilderToken  $action_parameter_token,
protected URLBuilderToken  $row_id_token,
protected \ilDBInterface  $db,
protected \ilLanguage  $lng,
protected \ilComponentRepository  $component_repository,
protected \ilRbacSystem  $rbac,
protected \ilObjUser  $current_user,
protected TaxonomyService  $taxonomy,
protected NotesService  $notes_service,
protected int  $parent_obj_id,
protected int  $request_ref_id 
)

Definition at line 38 of file QuestionTable.php.

References ILIAS\GlobalScreen\Provider\__construct(), ilLanguage\loadLanguageModule(), and ilAssQuestionList\setAvailableTaxonomyIds().

55  {
56  $lng->loadLanguageModule('qpl');
57  parent::__construct($db, $lng, $refinery, $component_repository, $notes_service);
58  $this->setAvailableTaxonomyIds($taxonomy->getUsageOfObject($parent_obj_id));
59  }
setAvailableTaxonomyIds(array $availableTaxonomyIds)
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Member Function Documentation

◆ buildAction()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::buildAction ( string  $act,
string  $type,
bool  $async = false 
)
protected

Definition at line 352 of file QuestionTable.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getActions().

352  : array
353  {
354  $action = $this->ui_factory->table()->action()
355  ->$type(
356  $this->lng->txt($act),
357  $this->url_builder->withParameter($this->action_parameter_token, $act),
358  $this->row_id_token
359  );
360  if ($async) {
361  $action = $action->withAsync(true);
362  }
363 
364  return [$act => $action];
365  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActions()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getActions ( )
protected

Definition at line 332 of file QuestionTable.php.

References ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\buildAction(), ilBulkEditQuestionsGUI\CMD_EDITLIFECYCLE, ilBulkEditQuestionsGUI\CMD_EDITTAUTHOR, ilBulkEditQuestionsGUI\CMD_EDITTAXONOMIES, and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\showCommentAction().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getTable().

332  : array
333  {
334  return array_merge(
335  $this->buildAction('copy', 'standard'),
336  $this->buildAction('move', 'standard'),
337  $this->buildAction('delete', 'standard'),
338  $this->buildAction('export', 'multi'),
339  $this->buildAction('preview', 'single'),
340  $this->buildAction('statistics', 'single'),
341  $this->buildAction('edit_question', 'single'),
342  $this->buildAction('edit_page', 'single'),
343  $this->buildAction('feedback', 'single'),
344  $this->buildAction('hints', 'single'),
348  $this->showCommentAction() ? $this->buildAction('comments', 'single', true) : []
349  );
350  }
buildAction(string $act, string $type, bool $async=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColums()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getColums ( )

Definition at line 147 of file QuestionTable.php.

References Vendor\Package\$f, ilUtil\getImagePath(), and ILIAS\Repository\lng().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getTable().

147  : array
148  {
149  $f = $this->ui_factory->table()->column();
150  $df = $this->data_factory->dateFormat();
151  $icon_yes = $this->ui_factory->symbol()->icon()->custom(\ilUtil::getImagePath('standard/icon_checked.svg'), 'yes');
152  $icon_no = $this->ui_factory->symbol()->icon()->custom(\ilUtil::getImagePath('standard/icon_unchecked.svg'), 'no');
153 
154  return [
155  'title' => $f->link($this->lng->txt('title')),
156  'description' => $f->text($this->lng->txt('description'))->withIsOptional(true, true),
157  'ttype' => $f->text($this->lng->txt('question_type'))->withIsOptional(true, true),
158  'points' => $f->number($this->lng->txt('points'))->withDecimals(2)->withIsOptional(true, true),
159  'author' => $f->text($this->lng->txt('author'))->withIsOptional(true, true),
160  'lifecycle' => $f->text($this->lng->txt('qst_lifecycle'))->withIsOptional(true, true),
161  'taxonomies' => $f->text($this->lng->txt('qpl_settings_subtab_taxonomies'))->withIsOptional(true, true),
162  'feedback' => $f->boolean($this->lng->txt('feedback'), $icon_yes, $icon_no)->withIsOptional(true, true),
163  'hints' => $f->boolean($this->lng->txt('hints'), $icon_yes, $icon_no)->withIsOptional(true, true),
164  'created' => $f->date(
165  $this->lng->txt('create_date'),
166  $this->current_user->getDateTimeFormat()
167  )->withIsOptional(true, true),
168  'tstamp' => $f->date(
169  $this->lng->txt('last_update'),
170  $this->current_user->getDateTimeFormat()
171  )->withIsOptional(true, true),
172  'comments' => $f->number($this->lng->txt('comments'))->withIsOptional(true, false),
173  ];
174  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getData()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getData ( Order  $order,
Range  $range 
)
protected

Definition at line 322 of file QuestionTable.php.

References $data, ilAssQuestionList\getQuestionDataArray(), ilAssQuestionList\load(), null, ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\postOrder(), ilAssQuestionList\setParentObjId(), and ILIAS\Data\Range\unpack().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getRows().

322  : array
323  {
324  $this->setParentObjId($this->parent_obj_id);
325  $this->load();
326  $data = $this->postOrder($this->getQuestionDataArray(), $order);
327  [$offset, $length] = $range->unpack();
328  $length = $length > 0 ? $length : null;
329  return array_slice($data, $offset, $length);
330  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
postOrder(array $list, \ILIAS\Data\Order $order)
setParentObjId(?int $parentObjId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilter()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getFilter ( \ilUIService  $ui_service,
string  $action 
)

Filters should be part of the Table; for now, since they are not fully integrated, they are rendered and applied seperately.

Definition at line 76 of file QuestionTable.php.

References ilObjQuestionPool\_getQuestionTypes(), ilUIService\filter(), ilAssQuestionLifecycle\getDraftInstance(), ILIAS\Repository\lng(), ilAssQuestionList\QUESTION_COMMENTED_EXCLUDED, ilAssQuestionList\QUESTION_COMMENTED_ONLY, ilObjTaxonomy\SORT_ALPHABETICAL, and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxNodeReader().

76  : Filter
77  {
78  $lifecycle_options = array_merge(
79  ['' => $this->lng->txt('qst_lifecycle_filter_all')],
80  \ilAssQuestionLifecycle::getDraftInstance()->getSelectOptions($this->lng)
81  );
82  $question_type_options = [
83  '' => $this->lng->txt('filter_all_question_types')
84  ];
85  $question_types = \ilObjQuestionPool::_getQuestionTypes();
86  foreach ($question_types as $translation => $row) {
87  $question_type_options[$row['type_tag']] = $translation;
88  }
89 
90  $field_factory = $this->ui_factory->input()->field();
91  $filter_inputs = [
92  'title' => $field_factory->text($this->lng->txt("title")),
93  'description' => $field_factory->text($this->lng->txt("description")),
94  'author' => $field_factory->text($this->lng->txt("author")),
95  'lifecycle' => $field_factory->select($this->lng->txt("qst_lifecycle"), $lifecycle_options),
96  'type' => $field_factory->select($this->lng->txt("type"), $question_type_options),
97  'commented' => $field_factory->select(
98  $this->lng->txt("ass_comments"),
99  [
100  \ilAssQuestionList::QUESTION_COMMENTED_ONLY => $this->lng->txt('qpl_filter_commented_only'),
101  \ilAssQuestionList::QUESTION_COMMENTED_EXCLUDED => $this->lng->txt('qpl_filter_commented_exclude')
102  ]
103  )
104  ];
105 
106  $taxs = $this->taxonomy->getUsageOfObject($this->parent_obj_id, true);
107  $tax_filter_options = [
108  'null' => '<b>' . $this->lng->txt('tax_filter_notax') . '</b>'
109  ];
110 
111  foreach ($taxs as $tax_entry) {
112  $tax = new \ilObjTaxonomy($tax_entry['tax_id']);
113  $tax_tree = $tax->getTree();
114  $sortfield = $tax->getSortingMode() === \ilObjTaxonomy::SORT_ALPHABETICAL ? 'title' : 'order_nr';
115  $children = $this->taxNodeReader($tax_tree, $sortfield, $tax_tree->readRootId());
116  $nodes = implode('-', array_map(fn($node) => $node['obj_id'], $children));
117 
118  $tax_id = $tax_entry['tax_id'] . '-0-' . $nodes;
119  $tax_title = '<b>' . $tax_entry['title'] . '</b>';
120  $tax_filter_options[$tax_id] = $tax_title;
121 
122  foreach ($children as $subtax) {
123  $stax_id = $subtax['tax_id'] . '-' . $subtax['obj_id'];
124  $stax_title = str_repeat('&nbsp; ', ($subtax['depth'] - 2) * 2)
125  . ' &boxur;&HorizontalLine; '
126  . $subtax['title'];
127 
128  $tax_filter_options[$stax_id] = $stax_title;
129  }
130  }
131  $filter_inputs['taxonomies'] = $field_factory->multiSelect($this->lng->txt("tax_filter"), $tax_filter_options);
132 
133  $active = array_fill(0, count($filter_inputs), true);
134 
135  $filter = $ui_service->filter()->standard(
136  'question_table_filter_id',
137  $action,
138  $filter_inputs,
139  $active,
140  true,
141  true
142  );
143  return $filter;
144  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
+ Here is the call graph for this function:

◆ getRows()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getRows ( Table\DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
?array  $filter_data,
?array  $additional_parameters 
)

Definition at line 275 of file QuestionTable.php.

References $lifecycle, ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getData(), ilAssQuestionLifecycle\getInstance(), ILIAS\Repository\lng(), ILIAS\Repository\rbac(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxonomyRepresentation().

282  : \Generator {
283  $no_write_access = !($this->rbac->checkAccess('write', $this->request_ref_id));
284  $timezone = new \DateTimeZone($this->current_user->getTimeZone());
285  foreach ($this->getData($order, $range) as $record) {
286  $row_id = (string) $record['question_id'];
287  $record['created'] = (new \DateTimeImmutable("@{$record['created']}"))->setTimezone($timezone);
288  $record['tstamp'] = (new \DateTimeImmutable("@{$record['tstamp']}"))->setTimezone($timezone);
289  $lifecycle = \ilAssQuestionLifecycle::getInstance($record['lifecycle']);
290  $record['lifecycle'] = $lifecycle->getTranslation($this->lng);
291 
292  $title = $record['title'];
293  $to_question = $this->url_builder
294  ->withParameter($this->action_parameter_token, 'preview')
295  ->withParameter($this->row_id_token, $row_id)
296  ->buildURI()->__toString();
297  if (!(bool) $record['complete']) {
298  $title .= ' (' . $this->lng->txt('warning_question_not_complete') . ')';
299  }
300  $record['title'] = $this->ui_factory->link()->standard($title, $to_question);
301  $record['taxonomies'] = $this->taxonomyRepresentation($record['taxonomies']);
302 
303  yield $row_builder->buildDataRow($row_id, $record)
304  ->withDisabledAction('move', $no_write_access)
305  ->withDisabledAction('copy', $no_write_access)
306  ->withDisabledAction('delete', $no_write_access)
307  ->withDisabledAction('feedback', $no_write_access)
308  ->withDisabledAction('hints', $no_write_access)
309  ;
310  }
311  }
$lifecycle
+ Here is the call graph for this function:

◆ getTable()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getTable ( )

Definition at line 61 of file QuestionTable.php.

References ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getActions(), ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getColums(), and ILIAS\Repository\lng().

61  : Table\Data
62  {
63  return $this->ui_factory->table()->data(
64  $this,
65  $this->lng->txt('questions'),
66  $this->getColums(),
67  )
68  ->withActions($this->getActions())
69  ->withId('qpt' . $this->parent_obj_id . '_' . $this->request_ref_id);
70  }
+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Definition at line 313 of file QuestionTable.php.

References ilAssQuestionList\getQuestionDataArray(), ilAssQuestionList\load(), and ilAssQuestionList\setParentObjId().

316  : ?int {
317  $this->setParentObjId($this->parent_obj_id);
318  $this->load();
319  return count($this->getQuestionDataArray());
320  }
setParentObjId(?int $parentObjId)
+ Here is the call graph for this function:

◆ postOrder()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::postOrder ( array  $list,
\ILIAS\Data\Order  $order 
)
protected

Definition at line 367 of file QuestionTable.php.

References Vendor\Package\$a, Vendor\Package\$b, and null.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getData().

367  : array
368  {
369  [$aspect, $direction] = $order->join('', function ($i, $k, $v) {
370  return [$k, $v];
371  });
372  usort($list, static function (array $a, array $b) use ($aspect): int {
373  if (is_numeric($a[$aspect]) || is_bool($a[$aspect])) {
374  return $a[$aspect] <=> $b[$aspect];
375  }
376  if (is_array($a[$aspect])) {
377  return $a[$aspect] <=> $b[$aspect];
378  }
379 
380  $aspect_a = '';
381  $aspect_b = '';
382  if ($a[$aspect] !== null) {
383  $aspect_a = $a[$aspect];
384  }
385  if ($b[$aspect] !== null) {
386  $aspect_b = $b[$aspect];
387  }
388 
389  return strcoll($aspect_a, $aspect_b);
390  });
391 
392  if ($direction === $order::DESC) {
393  $list = array_reverse($list);
394  }
395  return $list;
396  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the caller graph for this function:

◆ showCommentAction()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::showCommentAction ( )
private

Definition at line 398 of file QuestionTable.php.

References ILIAS\Repository\rbac().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getActions().

398  : bool
399  {
400  return $this->notes_service->domain()->commentsActive($this->parent_obj_id)
401  || $this->rbac->checkAccess('write', $this->request_ref_id);
402  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singleTaxonomyRepresentation()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::singleTaxonomyRepresentation ( int  $tax_id,
array  $stored_tax_data,
string  $check_marker 
)
private

Definition at line 224 of file QuestionTable.php.

References $path, ilObject\_lookupTitle(), ilObjTaxonomy\SORT_ALPHABETICAL, ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxNodeReader(), ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\toNestedList(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\treeify().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\taxonomyRepresentation().

228  : string {
229  $tax = new \ilObjTaxonomy($tax_id);
230  $tax_tree = $tax->getTree();
231  $sortfield = $tax->getSortingMode() === \ilObjTaxonomy::SORT_ALPHABETICAL ? 'title' : 'order_nr';
232  $taxnodes = $this->taxNodeReader($tax_tree, $sortfield, $tax_tree->readRootId());
233 
234  $nodes = [];
235  foreach ($taxnodes as $taxnode) {
236  $taxdata = array_filter(
237  $stored_tax_data,
238  fn($data_child) => $data_child['node_id'] === $taxnode['obj_id']
239  );
240 
241  foreach (array_keys($taxdata) as $node_obj_id) {
242  $path = array_map(
243  fn($n) => in_array($n['obj_id'], array_keys($stored_tax_data)) ? $check_marker . $n['title'] : $n['title'],
244  $tax_tree->getPathFull($node_obj_id),
245  );
246  $path[0] = \ilObject::_lookupTitle($tax_id);
247  $this->treeify($nodes, $path);
248  }
249  }
250  return $this->toNestedList($nodes);
251  }
$path
Definition: ltiservices.php:29
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ taxNodeReader()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::taxNodeReader (   $tree,
  $sortfield,
  $node_id 
)
private

Definition at line 203 of file QuestionTable.php.

References Vendor\Package\$a, Vendor\Package\$b, and $c.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getFilter(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

203  : array
204  {
205  $ret = [];
206  $nodes = $tree->getChildsByTypeFilter($node_id, ['taxn']);
207  usort(
208  $nodes,
209  fn($a, $b) => strcmp(
210  (string) $a[$sortfield],
211  (string) $b[$sortfield]
212  )
213  );
214 
215  foreach ($nodes as $node) {
216  $ret[] = $node;
217  foreach ($this->taxNodeReader($tree, $sortfield, $node['obj_id']) as $c) {
218  $ret[] = $c;
219  }
220  }
221  return $ret;
222  }
$c
Definition: deliver.php:25
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the caller graph for this function:

◆ taxonomyRepresentation()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::taxonomyRepresentation ( array  $taxonomy_data)
private

Definition at line 253 of file QuestionTable.php.

References $check, ilUtil\getImagePath(), and ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getRows().

253  : string
254  {
255  $check = $this->ui_renderer->render(
256  $this->ui_factory->symbol()->icon()->custom(\ilUtil::getImagePath('standard/icon_checked.svg'), 'checked')
257  );
258 
259  $taxonomies = [];
260  $taxs = $this->taxonomy->getUsageOfObject($this->parent_obj_id, true);
261  foreach ($taxs as $tax_entry) {
262  $tax_id = $tax_entry['tax_id'];
263  if (!array_key_exists($tax_id, $taxonomy_data)) {
264  continue;
265  }
266  $taxonomies[] = $this->singleTaxonomyRepresentation(
267  $tax_id,
268  $taxonomy_data[$tax_id],
269  $check
270  );
271  }
272  return implode('', $taxonomies);
273  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$check
Definition: buildRTE.php:81
singleTaxonomyRepresentation(int $tax_id, array $stored_tax_data, string $check_marker)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toNestedList()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::toNestedList ( array  $nodes)
private

Definition at line 188 of file QuestionTable.php.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

188  : string
189  {
190  $entries = [];
191  foreach ($nodes as $k => $n) {
192  if ($n === []) {
193  $entries[] = $k;
194  } else {
195  $entries[] = $k . $this->toNestedList($n);
196  }
197  }
198  return $this->ui_renderer->render(
199  $this->ui_factory->listing()->unordered($entries)
200  );
201  }
+ Here is the caller graph for this function:

◆ treeify()

ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable::treeify ( $pointer,
  $stack 
)
private

Definition at line 176 of file QuestionTable.php.

Referenced by ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\singleTaxonomyRepresentation().

177  {
178  $hop = array_shift($stack);
179  if (!$hop) {
180  return;
181  }
182  if (! array_key_exists($hop, $pointer)) {
183  $pointer[$hop] = [];
184  }
185  $this->treeify($pointer[$hop], $stack);
186  }
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: