ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Logging\TestParticipantInteraction Class Reference
+ Inheritance diagram for ILIAS\Test\Logging\TestParticipantInteraction:
+ Collaboration diagram for ILIAS\Test\Logging\TestParticipantInteraction:

Public Member Functions

 __construct (private readonly int $test_ref_id, private readonly ?int $question_id, private readonly int $pax_id, private readonly string $source_ip, private readonly TestParticipantInteractionTypes $interaction_type, private readonly int $modification_timestamp, private readonly array $additional_data)
 
 getUniqueIdentifier ()
 
 withId (int $id)
 
 getLogEntryAsDataTableRow (\ilLanguage $lng, TitleColumnsBuilder $title_builder, DataRowBuilder $row_builder, array $environment)
 
 getLogEntryAsExportRow (\ilLanguage $lng, TitleColumnsBuilder $title_builder, AdditionalInformationGenerator $additional_info, array $environment)
 
 getParsedAdditionalInformation (AdditionalInformationGenerator $additional_info, UIFactory $ui_factory, array $environment)
 
 toStorage ()
 
 getUniqueIdentifier ()
 
 withId (int $id)
 
 getLogEntryAsDataTableRow (\ilLanguage $lng, TitleColumnsBuilder $title_builder, DataRowBuilder $row_builder, array $environment)
 
 getLogEntryAsExportRow (\ilLanguage $lng, TitleColumnsBuilder $title_builder, AdditionalInformationGenerator $additional_info, array $environment)
 
 getParsedAdditionalInformation (AdditionalInformationGenerator $additional_info, UIFactory $ui_factory, array $environment)
 
 toStorage ()
 

Data Fields

const IDENTIFIER = 'pi'
 
- Data Fields inherited from ILIAS\Test\Logging\TestUserInteraction
const LANG_VAR_PREFIX = 'logs_'
 

Private Attributes

int $id
 

Detailed Description

Definition at line 29 of file TestParticipantInteraction.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Logging\TestParticipantInteraction::__construct ( private readonly int  $test_ref_id,
private readonly ?int  $question_id,
private readonly int  $pax_id,
private readonly string  $source_ip,
private readonly TestParticipantInteractionTypes  $interaction_type,
private readonly int  $modification_timestamp,
private readonly array  $additional_data 
)
Parameters
array<stringlabel_lang_var => mixed value> $additional_data

Definition at line 38 of file TestParticipantInteraction.php.

46 {
47
48 }

Member Function Documentation

◆ getLogEntryAsDataTableRow()

ILIAS\Test\Logging\TestParticipantInteraction::getLogEntryAsDataTableRow ( \ilLanguage  $lng,
TitleColumnsBuilder  $title_builder,
DataRowBuilder  $row_builder,
array  $environment 
)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 62 of file TestParticipantInteraction.php.

67 : DataRow {
68 $values = [
69 'date_and_time' => \DateTimeImmutable::createFromFormat('U', (string) $this->modification_timestamp)
70 ->setTimezone($environment['timezone']),
71 'corresponding_test' => $title_builder->buildTestTitleAsLink(
72 $this->test_ref_id
73 ),
74 'admin' => '',
75 'participant' => \ilUserUtil::getNamePresentation(
76 $this->pax_id,
77 false,
78 false,
79 '',
80 true
81 ),
82 'ip' => $this->source_ip,
83 'log_entry_type' => $lng->txt(self::LANG_VAR_PREFIX . self::IDENTIFIER),
84 'interaction_type' => $lng->txt(self::LANG_VAR_PREFIX . $this->interaction_type->value)
85 ];
86
87 if ($this->question_id !== null) {
88 $values['question'] = $title_builder->buildQuestionTitleAsLink(
89 $this->question_id,
90 $this->test_ref_id
91 );
92 }
93
94 return $row_builder->buildDataRow(
95 $this->getUniqueIdentifier(),
96 $values
97 )->withDisabledAction(
99 $this->additional_data === []
100 );
101 }
buildQuestionTitleAsLink(int $question_id, int $test_ref_id)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
buildDataRow(string $id, array $record)
global $lng
Definition: privfeed.php:31

References ILIAS\Test\Utilities\TitleColumnsBuilder\buildQuestionTitleAsLink().

+ Here is the call graph for this function:

◆ getLogEntryAsExportRow()

ILIAS\Test\Logging\TestParticipantInteraction::getLogEntryAsExportRow ( \ilLanguage  $lng,
TitleColumnsBuilder  $title_builder,
AdditionalInformationGenerator  $additional_info,
array  $environment 
)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 103 of file TestParticipantInteraction.php.

108 : array {
109 return [
110 \DateTimeImmutable::createFromFormat('U', (string) $this->modification_timestamp)
111 ->setTimezone($environment['timezone'])
112 ->format($environment['date_format']),
113 $title_builder->buildTestTitleAsText($this->test_ref_id),
114 '',
116 $this->pax_id,
117 false,
118 false,
119 '',
120 true
121 ),
122 $this->source_ip,
123 $title_builder->buildQuestionTitleAsText($this->question_id),
124 $lng->txt(self::LANG_VAR_PREFIX . self::IDENTIFIER),
125 $lng->txt(self::LANG_VAR_PREFIX . $this->interaction_type->value),
126 $additional_info->parseForExport($this->additional_data, $environment)
127 ];
128 }
parseForExport(array $additional_info, array $environment)

◆ getParsedAdditionalInformation()

ILIAS\Test\Logging\TestParticipantInteraction::getParsedAdditionalInformation ( AdditionalInformationGenerator  $additional_info,
UIFactory  $ui_factory,
array  $environment 
)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 130 of file TestParticipantInteraction.php.

134 : DescriptiveListing {
135 return $additional_info->parseForTable($this->additional_data, $environment);
136 }
parseForTable(array $additional_info, array $environment)

◆ getUniqueIdentifier()

ILIAS\Test\Logging\TestParticipantInteraction::getUniqueIdentifier ( )

◆ toStorage()

ILIAS\Test\Logging\TestParticipantInteraction::toStorage ( )

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 138 of file TestParticipantInteraction.php.

138 : array
139 {
140 return [
141 'ref_id' => [\ilDBConstants::T_INTEGER , $this->test_ref_id],
142 'qst_id' => [\ilDBConstants::T_INTEGER , $this->question_id],
143 'pax_id' => [\ilDBConstants::T_INTEGER , $this->pax_id],
144 'source_ip' => [\ilDBConstants::T_TEXT , $this->source_ip],
145 'interaction_type' => [\ilDBConstants::T_TEXT , $this->interaction_type->value],
146 'modification_ts' => [\ilDBConstants::T_INTEGER , $this->modification_timestamp],
147 'additional_data' => [\ilDBConstants::T_CLOB , json_encode($this->additional_data)]
148 ];
149 }

References ilDBConstants\T_CLOB, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Test\Logging\TestLoggingDatabaseRepository\storeParticipantInteraction().

+ Here is the caller graph for this function:

◆ withId()

ILIAS\Test\Logging\TestParticipantInteraction::withId ( int  $id)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 55 of file TestParticipantInteraction.php.

55 : self
56 {
57 $clone = clone $this;
58 $clone->id = $id;
59 return $clone;
60 }

References ILIAS\Test\Logging\TestParticipantInteraction\$id.

Field Documentation

◆ $id

int ILIAS\Test\Logging\TestParticipantInteraction::$id
private

◆ IDENTIFIER

const ILIAS\Test\Logging\TestParticipantInteraction::IDENTIFIER = 'pi'

Definition at line 31 of file TestParticipantInteraction.php.


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