ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLTIConsumerGradeSynchronizationTableGUI Class Reference
+ Inheritance diagram for ilLTIConsumerGradeSynchronizationTableGUI:
+ Collaboration diagram for ilLTIConsumerGradeSynchronizationTableGUI:

Public Member Functions

 __construct (bool $isMultiActorReport)
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 setRecords (array $records)
 
 getHTML ()
 
 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.g. More...
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

Protected Attributes

ilLanguage $lng
 
Factory $ui_factory
 
ILIAS UI Renderer $ui_renderer
 
 $request
 
bool $isMultiActorReport
 

Private Member Functions

 getColumns ()
 

Private Attributes

array $records = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerGradeSynchronizationTableGUI::__construct ( bool  $isMultiActorReport)

Definition at line 44 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

45 {
46 global $DIC;
47
48 $this->isMultiActorReport = $isMultiActorReport;
49
50 $this->lng = $DIC->language();
51 $this->ui_factory = $DIC->ui()->factory();
52 $this->ui_renderer = $DIC->ui()->renderer();
53 $this->request = $DIC->http()->request();
54
55 }
global $DIC
Definition: shib_login.php:26

References $DIC, $isMultiActorReport, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ getColumns()

ilLTIConsumerGradeSynchronizationTableGUI::getColumns ( )
private

Definition at line 93 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

93 : array
94 {
95 global $DIC;
96 $df = new \ILIAS\Data\Factory();
97
98
99 return [
100 "lti_timestamp" => $this->ui_factory->table()->column()->date($this->lng->txt('tbl_grade_date'), $df->dateFormat()->withTime24($DIC->user()->getDateFormat())),
101 "actor" => $this->ui_factory->table()->column()->text($this->lng->txt('tbl_grade_actor')),
102 "score_given" => $this->ui_factory->table()->column()->text($this->lng->txt('tbl_grade_score')),
103 "activity_progress" => $this->ui_factory->table()->column()->text($this->lng->txt('tbl_grade_activity_progress')),
104 "grading_progress" => $this->ui_factory->table()->column()->text($this->lng->txt('tbl_grade_grading_progress')),
105 "stored" => $this->ui_factory->table()->column()->date($this->lng->txt('tbl_grade_stored'), $df->dateFormat()->withTime24($DIC->user()->getDateFormat()))
106 ];
107 }

References $DIC, and ILIAS\Repository\lng().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilLTIConsumerGradeSynchronizationTableGUI::getHTML ( )

Definition at line 83 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

83 : string
84 {
85 $table = $this->ui_factory->table()
86 ->data("", $this->getColumns(), $this)
87 ->withOrder(new Order("lti_timestamp", Order::DESC))
88 ->withRequest($this->request);
89
90 return $this->ui_renderer->render($table);
91 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29

References getColumns().

+ Here is the call graph for this function:

◆ getRows()

ilLTIConsumerGradeSynchronizationTableGUI::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
?array  $filter_data,
?array  $additional_parameters 
)
Exceptions
DateMalformedStringException

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 60 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

60 : Generator
61 {
62 foreach ($this->records as $record) {
63 $record['lti_timestamp'] = new DateTimeImmutable($record['lti_timestamp']);
64 $record['score_given'] = $record['score_given'] . ' / ' . $record['score_maximum'];
65 $record['activity_progress'] = $this->lng->txt('grade_activity_progress_' . strtolower($record['activity_progress']));
66 $record['grading_progress'] = $this->lng->txt('grade_grading_progress_' . strtolower($record['grading_progress']));
67 $record['stored'] = new DateTimeImmutable($record['stored']);
68
69 yield $row_builder->buildDataRow((string) $record['id'], $record);
70 }
71 }
buildDataRow(string $id, array $record)

References ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ilLTIConsumerGradeSynchronizationTableGUI::getTotalRowCount ( ?array  $filter_data,
?array  $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 73 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

73 : ?int
74 {
75 return count($this->records);
76 }

◆ setRecords()

ilLTIConsumerGradeSynchronizationTableGUI::setRecords ( array  $records)

Field Documentation

◆ $isMultiActorReport

bool ilLTIConsumerGradeSynchronizationTableGUI::$isMultiActorReport
protected

Definition at line 41 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilLTIConsumerGradeSynchronizationTableGUI::$lng
protected

◆ $records

array ilLTIConsumerGradeSynchronizationTableGUI::$records = []
private

Definition at line 42 of file class.ilLTIConsumerGradeSynchronizationTableGUI.php.

Referenced by setRecords().

◆ $request

ilLTIConsumerGradeSynchronizationTableGUI::$request
protected

◆ $ui_factory

Factory ilLTIConsumerGradeSynchronizationTableGUI::$ui_factory
protected

◆ $ui_renderer

ILIAS UI Renderer ilLTIConsumerGradeSynchronizationTableGUI::$ui_renderer
protected

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