ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable Class Reference
+ Inheritance diagram for ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable:
+ Collaboration diagram for ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable:

Public Member Functions

 __construct (private readonly RequestDataCollectorInterface $pool_request, private readonly \ilAssQuestionSkillAssignmentList $assignment_list, private readonly UIFactory $ui_factory, private readonly \ilLanguage $lng, private readonly EditSkillsOfQuestionTableActions $table_actions)
 
 getComponents (URLBuilder $url_builder)
 
 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 records available. More...
 
 acquireParameters (URLBuilder $url_builder)
 
- Public Member Functions inherited from ILIAS\UI\Component\Table\DataRetrieval
 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.g. More...
 
 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 records available. More...
 

Data Fields

const string ID = 'ska'
 

Private Member Functions

 retrieveRecords ()
 
 getColumns ()
 

Detailed Description

Definition at line 31 of file EditSkillsOfQuestionTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::__construct ( private readonly RequestDataCollectorInterface  $pool_request,
private readonly \ilAssQuestionSkillAssignmentList  $assignment_list,
private readonly UIFactory  $ui_factory,
private readonly \ilLanguage  $lng,
private readonly EditSkillsOfQuestionTableActions  $table_actions 
)

Definition at line 35 of file EditSkillsOfQuestionTable.php.

41 {
42 }

Member Function Documentation

◆ acquireParameters()

ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::acquireParameters ( URLBuilder  $url_builder)

◆ getColumns()

ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::getColumns ( )
private

Definition at line 118 of file EditSkillsOfQuestionTable.php.

118 : array
119 {
120 $column = $this->ui_factory->table()->column();
121 return [
122 'competence' => $column->text($this->lng->txt('tst_competence'))->withIsSortable(true),
123 'competence_tree' => $column->text($this->lng->txt('tst_competence_tree'))->withIsSortable(true),
124 'eval_mode' => $column->text($this->lng->txt('tst_comp_eval_mode'))->withIsSortable(true),
125 'points' => $column->number($this->lng->txt('tst_comp_points'))->withIsSortable(true)
126 ];
127 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getComponents()

ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::getComponents ( URLBuilder  $url_builder)
Returns
array<Component>

Definition at line 47 of file EditSkillsOfQuestionTable.php.

47 : array
48 {
49 $question = \assQuestion::instantiateQuestion($this->pool_request->getQuestionId());
50 return [
51 $this->ui_factory->table()->data(
52 $this,
53 sprintf($this->lng->txt('qpl_skl_assignment_for_question'), $question->getTitle()),
54 $this->getColumns()
55 )
56 ->withActions(
57 $this->table_actions->getEnabledActions(...$this->acquireParameters($url_builder))
58 )
59 ->withRequest($this->pool_request->getRequest())
60 ];
61 }
static instantiateQuestion(int $question_id)

References assQuestion\instantiateQuestion(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::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 records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 91 of file EditSkillsOfQuestionTable.php.

95 : ?int {
96 return count(
97 $this->assignment_list->getAssignmentsByQuestionId(
98 $this->pool_request->getQuestionId()
99 )
100 );
101 }

◆ retrieveRecords()

ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::retrieveRecords ( )
private

Definition at line 113 of file EditSkillsOfQuestionTable.php.

113 : iterable
114 {
115 return $this->assignment_list->getAssignmentsByQuestionId($this->pool_request->getQuestionId());
116 }

Field Documentation

◆ ID

const string ILIAS\TestQuestionPool\Skills\EditSkillsOfQuestionTable::ID = 'ska'

Definition at line 33 of file EditSkillsOfQuestionTable.php.


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