28 خطوط
935 B
PHP
28 خطوط
935 B
PHP
<?php
|
|
|
|
namespace App\Modules\Events\Domain;
|
|
|
|
final class EventTaxonomy
|
|
{
|
|
public const SCHEMA_VERSION = 1;
|
|
|
|
/** @return list<string> */
|
|
public static function learning(): array
|
|
{
|
|
return [
|
|
'course.opened', 'course.completed',
|
|
'lesson.started', 'lesson.progressed', 'lesson.completed',
|
|
'block.viewed', 'block.interacted', 'block.completed',
|
|
'video.started', 'video.progressed', 'video.completed', 'video.replayed', 'video.skipped', 'video.exited',
|
|
'assessment.started', 'question.answered', 'assessment.completed',
|
|
'comment.created', 'bookmark.created', 'note.created',
|
|
];
|
|
}
|
|
|
|
/** @param array<string, mixed> $context @return array<string, mixed> */
|
|
public static function deviceContext(array $context): array
|
|
{
|
|
return collect($context)->only(['platform', 'formFactor', 'online', 'appVersion'])->all();
|
|
}
|
|
}
|