ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 

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.

References ILIAS\Test\Logging\LogTable\ACTION_ID_SHOW_ADDITIONAL_INFO, ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow(), ILIAS\Test\Utilities\TitleColumnsBuilder\buildQuestionTitleAsLink(), ILIAS\Test\Utilities\TitleColumnsBuilder\buildTestTitleAsLink(), ilUserUtil\getNamePresentation(), ILIAS\Test\Logging\TestParticipantInteraction\getUniqueIdentifier(), null, and ilLanguage\txt().

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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='ilpublicuserprofilegui')
Default behaviour is:
global $lng
Definition: privfeed.php:31
+ 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.

References ILIAS\Test\Utilities\TitleColumnsBuilder\buildQuestionTitleAsText(), ILIAS\Test\Utilities\TitleColumnsBuilder\buildTestTitleAsText(), ilUserUtil\getNamePresentation(), ILIAS\Test\Logging\AdditionalInformationGenerator\parseForExport(), and ilLanguage\txt().

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  }
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='ilpublicuserprofilegui')
Default behaviour is:
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

◆ 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.

References ILIAS\Test\Logging\AdditionalInformationGenerator\parseForTable().

135  return $additional_info->parseForTable($this->additional_data, $environment);
136  }
+ Here is the call graph for this function:

◆ getUniqueIdentifier()

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

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 50 of file TestParticipantInteraction.php.

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

Referenced by ILIAS\Test\Logging\TestParticipantInteraction\getLogEntryAsDataTableRow().

50  : ?string
51  {
52  return self::IDENTIFIER . '_' . $this->id;
53  }
+ Here is the caller graph for this function:

◆ toStorage()

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

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 138 of file TestParticipantInteraction.php.

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

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

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  }
+ 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.

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

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

Field Documentation

◆ $id

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

◆ IDENTIFIER


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