Open edX events
edX pydantic models
base
¶
Base event model definitions
AbstractBaseEventField (BaseModelWithConfig)
pydantic-model
¶
Represents the base model inherited by all event
fields.
The base model does not have any attributes as event field does not have common sub-fields.
Source code in ralph/models/edx/base.py
class AbstractBaseEventField(BaseModelWithConfig):
"""Represents the base model inherited by all `event` fields.
The base model does not have any attributes as event field does not have common
sub-fields.
"""
BaseContextField (BaseModelWithConfig)
pydantic-model
¶
Represents the base model inherited by all event context
fields.
Attributes:
Name | Type | Description |
---|---|---|
course_user_tags |
dict of str |
Content from |
user_id |
int or str or None |
Consists of the ID of the authenticated user.
Retrieved with:
|
org_id |
str |
Consists of the organization name that lists the course.
Retrieved with:
|
course_id |
str |
Consists of the unique identifier for the visited course page.
Retrieved with:
|
path |
Path |
Consist of the relative URL (without the hostname) of the
requested page.
Retrieved with:
|
Source code in ralph/models/edx/base.py
class BaseContextField(BaseModelWithConfig):
"""Represents the base model inherited by all event `context` fields.
Attributes:
course_user_tags (dict of str): Content from `user_api_usercoursetag` table.
Retrieved with:
`dict(
UserCourseTag.objects.filter(
user=request.user.pk, course_id=course_key
).values_list('key', 'value')
)`
Note:
Is only present when a course page is requested.
Is an empty dictionary when the user is not logged in or not found in
the `user_api_usercoursetag` table.
user_id (int or str or None): Consists of the ID of the authenticated user.
Retrieved with:
`request.user.pk` querying the `auth_user` table.
Note:
Is an integer when the user is found in the `auth_user` table.
Is an empty string when an exception is raised while retrieving the ID.
Is `None` when the user is not logged in.
org_id (str): Consists of the organization name that lists the course.
Retrieved with:
`course_id.org` where `course_id` is an
`opaque_keys.edx.locator.CourseLocator` which is created using the URL
of the requested page.
Note:
Is an empty string when the requested page is not a course page.
course_id (str): Consists of the unique identifier for the visited course page.
Retrieved with:
`course_id.to_deprecated_string()` where `course_id` is an
`opaque_keys.edx.locator.CourseLocator` which is created using the URL
of the requested page.
Note:
Is an empty string when the requested page is not a course page.
path (Path): Consist of the relative URL (without the hostname) of the
requested page.
Retrieved with:
`request.META['PATH_INFO']`
"""
course_id: constr(regex=r"^$|^course-v1:.+\+.+\+.+$") # noqa:F722
course_user_tags: Optional[dict[str, str]]
module: Optional[ContextModuleField]
org_id: str
path: Path
user_id: Union[int, Literal[""], None]
BaseEdxModel (BaseModelWithConfig)
pydantic-model
¶
Represents the base model all statements inherit from.
WARNING: it does not define the event
, event_type
and event_source
fields.
Attributes:
Name | Type | Description |
---|---|---|
username |
str |
Consists of the unique username identifying the logged in user.
Retrieved with:
|
ip |
IPv4Address or str |
Consists of the public IPv4 address of the user.
Retrieved with:
|
agent |
str |
Consists of the |
host |
str |
Consists of the hostname of the server.
Retrieved with:
|
referer |
Path |
Consists of the |
accept_language |
str |
Consists of the |
context |
BaseContextField |
see BaseContextField. |
time |
datetime |
Consists of the UTC time in ISO format at which the event was
emitted.
Retrieved with:
|
page |
None |
Consists of the value |
Source code in ralph/models/edx/base.py
class BaseEdxModel(BaseModelWithConfig):
"""Represents the base model all statements inherit from.
WARNING: it does not define the `event`, `event_type` and `event_source` fields.
Attributes:
username (str): Consists of the unique username identifying the logged in user.
Retrieved with:
`request.user.username` querying the `auth_user` table.
Note:
Is an empty string when the user is not logged in.
If an exception is raised when retrieving the username from the table
then the value is `anonymous`.
Usernames are made of 2-30 ASCII letters / numbers / underscores (_) /
hyphens (-)
ip (IPv4Address or str): Consists of the public IPv4 address of the user.
Retrieved with:
`get_ip(request)` cf. https://github.com/un33k/django-ipware/tree/1.1.0
Note:
Can be an empty string if the IP address is not found.
agent (str): Consists of the `User-Agent` HTTP request header.
Retrieved with:
`request.META[HTTP_USER_AGENT]`
Note:
Can be an empty string if the header is not present in the request.
Contains information about:
Browser name and version
Operating system name and version
Default language
host (str): Consists of the hostname of the server.
Retrieved with:
`request.META[SERVER_NAME]`
referer (Path): Consists of the `Referer` HTTP request header.
Retrieved with:
`request.META[HTTP_REFERER]`
Note:
Can be an empty string if the header is not present in the request.
Contains the referring URL (previous URL visited by the user).
accept_language (str): Consists of the `Accept-Language` HTTP request header.
Retrieved with:
`request.META[HTTP_ACCEPT_LANGUAGE]`
Note:
Can be an empty string if the header is not present in the request.
Contains the default language settings of the user.
context (BaseContextField): see BaseContextField.
time (datetime): Consists of the UTC time in ISO format at which the event was
emitted.
Retrieved with:
`datetime.datetime.utcnow()`
page (None): Consists of the value `None`
Note:
In JSON the value is `null` instead of `None`.
"""
username: Union[constr(min_length=2, max_length=30), Literal[""]]
ip: Union[IPv4Address, Literal[""]]
agent: str
host: str
referer: Union[AnyHttpUrl, Literal[""]]
accept_language: str
context: BaseContextField
time: datetime
page: None
BaseModelWithConfig (BaseModel)
pydantic-model
¶
Base model defining configuration shared among all models.
Source code in ralph/models/edx/base.py
class BaseModelWithConfig(BaseModel):
"""Base model defining configuration shared among all models."""
class Config: # pylint: disable=missing-class-docstring
extra = "forbid"
ContextModuleField (BaseModelWithConfig)
pydantic-model
¶
Represents the context module
field.
Attributes:
Name | Type | Description |
---|---|---|
usage_key |
str |
Consists of a block ID of the current component. |
display_name |
str |
Consists of a short description or title of the component. |
Source code in ralph/models/edx/base.py
class ContextModuleField(BaseModelWithConfig):
"""Represents the context `module` field.
Attributes:
usage_key (str): Consists of a block ID of the current component.
display_name (str): Consists of a short description or title of the component.
"""
usage_key: constr(regex=r"^block-v1:.+\+.+\+.+type@.+@[a-f0-9]{32}$") # noqa:F722
display_name: str
original_usage_key: Optional[
constr(
regex=r"^block-v1:.+\+.+\+.+type@problem\+block@[a-f0-9]{32}$" # noqa:F722
)
]
original_usage_version: Optional[str]
browser
¶
Browser event model definitions
BaseBrowserModel (BaseEdxModel)
pydantic-model
¶
Represents the base model all browser statements inherit from.
This type of event is triggered on (XHR) POST/GET requests to the /event
URL.
Attributes:
Name | Type | Description |
---|---|---|
event_source |
str |
Consists of the value |
page |
AnyUrl |
Consists of the URL (with hostname) of the visited page.
Retrieved with:
|
session |
str |
Consists of the md5 encrypted Django session key or an empty string. |
Source code in ralph/models/edx/browser.py
class BaseBrowserModel(BaseEdxModel):
"""Represents the base model all browser statements inherit from.
This type of event is triggered on (XHR) POST/GET requests to the `/event` URL.
Attributes:
event_source (str): Consists of the value `browser`.
page (AnyUrl): Consists of the URL (with hostname) of the visited page.
Retrieved with:
`window.location.href` from the JavaScript front-end.
session (str): Consists of the md5 encrypted Django session key or an empty
string.
"""
event_source: Literal["browser"]
page: AnyUrl
session: Union[constr(regex=r"^[a-f0-9]{32}$"), Literal[""]] # noqa: F722
converters
special
¶
xapi
special
¶
edX to xAPI conversion sets
base
¶
Base xAPI Converter
BaseXapiConverter (BaseConversionSet)
¶
Base xAPI Converter.
WARNING: The converter may not include the following edX fields:
- context.org_id: When org_id
is an empty string.
- context.course_id: When course_id
is an empty string.
WARNING: The converter should not include the following edX fields as they may
contain sensitive data: username
, referer
, event
, event_source
, ip
,
agent
, accept_language:
, context.course_user_tags
.
Source code in ralph/models/edx/converters/xapi/base.py
class BaseXapiConverter(BaseConversionSet):
"""Base xAPI Converter.
WARNING: The converter may not include the following edX fields:
- context.org_id: When `org_id` is an empty string.
- context.course_id: When `course_id` is an empty string.
WARNING: The converter should not include the following edX fields as they may
contain sensitive data: `username`, `referer`, `event`, `event_source`, `ip`,
`agent`, `accept_language:`, `context.course_user_tags`.
"""
def __init__(self, uuid_namespace: str, platform_url: str):
"""Initializes BaseXapiConverter."""
self.platform_url = platform_url
try:
self.uuid_namespace = UUID(uuid_namespace)
except (TypeError, ValueError, AttributeError) as err:
raise ConfigurationException("Invalid UUID namespace") from err
super().__init__()
def _get_conversion_items(self):
"""Returns a set of ConversionItems used for conversion."""
return {
ConversionItem(
"id",
None,
lambda event_str: str(uuid5(self.uuid_namespace, event_str)),
True,
),
ConversionItem(
"actor__account__homePage", transformers=lambda _: self.platform_url
),
ConversionItem(
"actor__account__name",
"context__user_id",
lambda user_id: str(user_id) if user_id else "anonymous",
),
ConversionItem(
"object__definition__extensions__" + EXTENSION_SCHOOL_ID,
"context__org_id",
),
ConversionItem(
"object__definition__extensions__" + EXTENSION_COURSE_ID,
"context__course_id",
(self.parse_course_id, lambda x: x["course"]),
),
ConversionItem(
"object__definition__extensions__" + EXTENSION_MODULE_ID,
"context__course_id",
(self.parse_course_id, lambda x: x["module"]),
),
ConversionItem("timestamp", "time"),
}
@staticmethod
def parse_course_id(course_id: str):
"""Returns a dictionary with `course` and `module` of edX event's
`context.course_id`.
"""
match = re.match(r"^course-v1:.+\+(.+)\+(.+)$", course_id)
if not match:
return {"course": None, "module": None}
return {"course": match.group(1), "module": match.group(2)}
__init__(self, uuid_namespace, platform_url)
special
¶
Initializes BaseXapiConverter.
Source code in ralph/models/edx/converters/xapi/base.py
def __init__(self, uuid_namespace: str, platform_url: str):
"""Initializes BaseXapiConverter."""
self.platform_url = platform_url
try:
self.uuid_namespace = UUID(uuid_namespace)
except (TypeError, ValueError, AttributeError) as err:
raise ConfigurationException("Invalid UUID namespace") from err
super().__init__()
parse_course_id(course_id)
staticmethod
¶
Returns a dictionary with course
and module
of edX event’s
context.course_id
.
Source code in ralph/models/edx/converters/xapi/base.py
@staticmethod
def parse_course_id(course_id: str):
"""Returns a dictionary with `course` and `module` of edX event's
`context.course_id`.
"""
match = re.match(r"^course-v1:.+\+(.+)\+(.+)$", course_id)
if not match:
return {"course": None, "module": None}
return {"course": match.group(1), "module": match.group(2)}
navigational
¶
Navigational event xAPI Converter
UIPageCloseToPageTerminated (BaseXapiConverter)
¶
Converts a common edX page_close
event to xAPI.
Example Statement: John terminated https://www.fun-mooc.fr/ page.
WARNING: The converter does not use the self.platform_url
in the object__id
because the platform_url
is present in the edX’s event page
field.
Source code in ralph/models/edx/converters/xapi/navigational.py
class UIPageCloseToPageTerminated(BaseXapiConverter):
"""Converts a common edX `page_close` event to xAPI.
Example Statement: John terminated https://www.fun-mooc.fr/ page.
WARNING: The converter does not use the `self.platform_url` in the `object__id`
because the `platform_url` is present in the edX's event `page` field.
"""
__src__ = UIPageClose
__dest__ = PageTerminated
def _get_conversion_items(self):
"""Returns a set of ConversionItems used for conversion."""
conversion_items = super()._get_conversion_items()
return conversion_items.union({ConversionItem("object__id", "page")})
__dest__ (BaseXapiModel)
pydantic-model
¶
Represents a page terminated xAPI statement.
Example: John terminated the https://www.fun-mooc.fr/ page.
Attributes:
Name | Type | Description |
---|---|---|
object |
PageObjectField |
See PageObjectField. |
verb |
PageTerminatedVerbField |
See PageTerminatedVerbField. |
Source code in ralph/models/edx/converters/xapi/navigational.py
class PageTerminated(BaseXapiModel):
"""Represents a page terminated xAPI statement.
Example: John terminated the https://www.fun-mooc.fr/ page.
Attributes:
object (PageObjectField): See PageObjectField.
verb (PageTerminatedVerbField): See PageTerminatedVerbField.
"""
__selector__ = selector(
object__definition__type="http://activitystrea.ms/schema/1.0/page",
verb__id="http://adlnet.gov/expapi/verbs/terminated",
)
object: PageObjectField
verb: TerminatedVerbField = TerminatedVerbField()
__src__ (BaseBrowserModel)
pydantic-model
¶
Represents the page_close
browser statement.
This type of statement is triggered when the user navigates to the next page
or closes the browser window (when the JavaScript window.onunload
event
is called).
Attributes:
Name | Type | Description |
---|---|---|
event |
str |
Consists of the string value |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/converters/xapi/navigational.py
class UIPageClose(BaseBrowserModel):
"""Represents the `page_close` browser statement.
This type of statement is triggered when the user navigates to the next page
or closes the browser window (when the JavaScript `window.onunload` event
is called).
Attributes:
event (str): Consists of the string value `{}`.
event_type (str): Consists of the value `page_close`.
name (str): Consists of the value `page_close`.
"""
__selector__ = selector(event_source="browser", event_type="page_close")
# pylint: disable=unsubscriptable-object
event: Literal["{}"]
event_type: Literal["page_close"]
name: Literal["page_close"]
server
¶
Server event xAPI Converter
ServerEventToPageViewed (BaseXapiConverter)
¶
Converts a common edX server event to xAPI.
Example Statement: John viewed https://www.fun-mooc.fr/ page.
Source code in ralph/models/edx/converters/xapi/server.py
class ServerEventToPageViewed(BaseXapiConverter):
"""Converts a common edX server event to xAPI.
Example Statement: John viewed https://www.fun-mooc.fr/ page.
"""
__src__ = Server
__dest__ = PageViewed
def _get_conversion_items(self):
"""Returns a set of ConversionItems used for conversion."""
conversion_items = super()._get_conversion_items()
return conversion_items.union(
{
ConversionItem(
"object__id",
"event_type",
lambda event_type: self.platform_url + event_type,
),
}
)
__dest__ (BaseXapiModel)
pydantic-model
¶
Represents a page viewed xAPI statement.
Example: John viewed the https://www.fun-mooc.fr/ page.
Attributes:
Name | Type | Description |
---|---|---|
object |
PageObjectField |
See PageObjectField. |
verb |
PageViewedVerbField |
See PageViewedVerbField. |
Source code in ralph/models/edx/converters/xapi/server.py
class PageViewed(BaseXapiModel):
"""Represents a page viewed xAPI statement.
Example: John viewed the https://www.fun-mooc.fr/ page.
Attributes:
object (PageObjectField): See PageObjectField.
verb (PageViewedVerbField): See PageViewedVerbField.
"""
__selector__ = selector(
object__definition__type="http://activitystrea.ms/schema/1.0/page",
verb__id="http://id.tincanapi.com/verb/viewed",
)
object: PageObjectField
verb: ViewedVerbField = ViewedVerbField()
__src__ (BaseServerModel)
pydantic-model
¶
Represents a common server statement.
This type of event is triggered from the django middleware on each request
excluding: /event
, login
, heartbeat
, /segmentio/event
and /performance
.
Attributes:
Name | Type | Description |
---|---|---|
event_type |
str |
Consist of the relative URL (without the hostname) of the
requested page.
Retrieved with:
|
event |
str |
Consist of a JSON string holding the content of the GET or POST
request.
Retrieved with:
|
Source code in ralph/models/edx/converters/xapi/server.py
class Server(BaseServerModel):
"""Represents a common server statement.
This type of event is triggered from the django middleware on each request
excluding: `/event`, `login`, `heartbeat`, `/segmentio/event` and `/performance`.
Attributes:
event_type (str): Consist of the relative URL (without the hostname) of the
requested page.
Retrieved with:
`request.META['PATH_INFO']`
event (str): Consist of a JSON string holding the content of the GET or POST
request.
Retrieved with:
```json.dumps(
{
'GET': dict(request.GET),
'POST': dict(request.POST)
}
)[:512]```
Note:
Values for ['password', 'newpassword', 'new_password', 'oldpassword',
'old_password', 'new_password1', 'new_password2'] are replaced by
`********`.
The JSON string is truncated at 512 characters resulting in invalid
JSON.
"""
__selector__ = selector(
event_source="server", event_type=LazyModelField("context__path")
)
# pylint: disable=unsubscriptable-object
event_type: Path
event: Union[Json[ServerEventField], ServerEventField]
enrollment
special
¶
fields
special
¶
contexts
¶
Enrollment event models context fields definitions
EdxCourseEnrollmentUpgradeClickedContextField (BaseContextField)
pydantic-model
¶
Represents the context
field of the edx.course.enrollment.upgrade_clicked
server statement.
In addition to the common context member fields, this statement also comprises the
mode
context member field.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str |
Consists of either the |
Source code in ralph/models/edx/enrollment/fields/contexts.py
class EdxCourseEnrollmentUpgradeClickedContextField(BaseContextField):
"""Represents the `context` field of the `edx.course.enrollment.upgrade_clicked`
server statement.
In addition to the common context member fields, this statement also comprises the
`mode` context member field.
Attributes:
mode (str): Consists of either the `audit` or `honor` value. It identifies the
enrollment mode when the user clicked <kbd>Challenge Yourself</kbd>.
"""
mode: Union[Literal["audit"], Literal["honor"]]
EdxCourseEnrollmentUpgradeSucceededContextField (BaseContextField)
pydantic-model
¶
Represents the context
field of the edx.course.enrollment.upgrade.succeeded
server statement.
In addition to the common context member fields, this statement also comprises the
mode
context member field.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str |
Consists of the |
Source code in ralph/models/edx/enrollment/fields/contexts.py
class EdxCourseEnrollmentUpgradeSucceededContextField(BaseContextField):
"""Represents the `context` field of the `edx.course.enrollment.upgrade.succeeded`
server statement.
In addition to the common context member fields, this statement also comprises the
`mode` context member field.
Attributes:
mode (str): Consists of the `verified` value.
"""
mode: Literal["verified"]
events
¶
Enrollment models event field definition
EnrollmentEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field for enrollment statements.
Note: Only server enrollment statements require an event
field.
Attributes:
Name | Type | Description |
---|---|---|
course_id |
str |
Consists in the course in which the student was enrolled or unenrolled. |
mode |
str |
Takes either |
user_id |
int |
Identifies the student who was enrolled or unenrolled. |
Source code in ralph/models/edx/enrollment/fields/events.py
class EnrollmentEventField(AbstractBaseEventField):
"""Represents the `event` field for enrollment statements.
Note: Only server enrollment statements require an `event` field.
Attributes:
course_id (str): Consists in the course in which the student was enrolled or
unenrolled.
mode (str): Takes either `audit`, `honor`, `professional` or `verified` value.
It identifies the student’s enrollment mode.
user_id (int): Identifies the student who was enrolled or unenrolled.
"""
course_id: str
mode: Union[
Literal["audit"], Literal["honor"], Literal["professional"], Literal["verified"]
]
user_id: Union[int, Literal[""], None]
statements
¶
Enrollment event model definitions
EdxCourseEnrollmentActivated (BaseServerModel)
pydantic-model
¶
Represents the edx.course.enrollment.activated
server statement.
The server emits it when a student enrolls in a course.
Attributes:
Name | Type | Description |
---|---|---|
event |
EnrollmentEventField |
See EnrollmentEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/enrollment/statements.py
class EdxCourseEnrollmentActivated(BaseServerModel):
"""Represents the `edx.course.enrollment.activated` server statement.
The server emits it when a student enrolls in a course.
Attributes:
event (EnrollmentEventField): See EnrollmentEventField.
event_type (str): Consists of the value `edx.course.enrollment.activated`.
name (str): Consists of the value `edx.course.enrollment.activated`.
"""
__selector__ = selector(
event_source="server", event_type="edx.course.enrollment.activated"
)
event: Union[
Json[EnrollmentEventField], # pylint: disable=unsubscriptable-object
EnrollmentEventField,
]
event_type: Literal["edx.course.enrollment.activated"]
name: Literal["edx.course.enrollment.activated"]
EdxCourseEnrollmentDeactivated (BaseServerModel)
pydantic-model
¶
Represents the edx.course.enrollment.deactivated
server statement.
The server emits it when a student unenrolls from a course.
Attributes:
Name | Type | Description |
---|---|---|
event |
EnrollmentEventField |
See EnrollmentEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/enrollment/statements.py
class EdxCourseEnrollmentDeactivated(BaseServerModel):
"""Represents the `edx.course.enrollment.deactivated` server statement.
The server emits it when a student unenrolls from a course.
Attributes:
event (EnrollmentEventField): See EnrollmentEventField.
event_type (str): Consists of the value `edx.course.enrollment.deactivated`.
name (str): Consists of the value `edx.course.enrollment.deactivated`.
"""
__selector__ = selector(
event_source="server", event_type="edx.course.enrollment.deactivated"
)
event: Union[
Json[EnrollmentEventField], # pylint: disable=unsubscriptable-object
EnrollmentEventField,
]
event_type: Literal["edx.course.enrollment.deactivated"]
name: Literal["edx.course.enrollment.deactivated"]
EdxCourseEnrollmentModeChanged (BaseServerModel)
pydantic-model
¶
Represents the edx.course.enrollment.mode_changed
server statement.
The server emits it when the process of changing a student’s student_courseenrollment.mode to a different mode is complete.
Attributes:
Name | Type | Description |
---|---|---|
event |
EnrollmentEventField |
See EnrollmentEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/enrollment/statements.py
class EdxCourseEnrollmentModeChanged(BaseServerModel):
"""Represents the `edx.course.enrollment.mode_changed` server statement.
The server emits it when the process of changing a student’s
student_courseenrollment.mode to a different mode is complete.
Attributes:
event (EnrollmentEventField): See EnrollmentEventField.
event_type (str): Consists of the value `edx.course.enrollment.mode_changed`.
name (str): Consists of the value `edx.course.enrollment.mode_changed`.
"""
__selector__ = selector(
event_source="server", event_type="edx.course.enrollment.mode_changed"
)
event: Union[
Json[EnrollmentEventField], # pylint: disable=unsubscriptable-object
EnrollmentEventField,
]
event_type: Literal["edx.course.enrollment.mode_changed"]
name: Literal["edx.course.enrollment.mode_changed"]
EdxCourseEnrollmentUpgradeSucceeded (BaseServerModel)
pydantic-model
¶
Represents the edx.course.enrollment.upgrade.succeeded
server statement.
The server emits it when the process of upgrading a student’s
student_courseenrollment.mode from audit
or honor
to verified
is complete.
Attributes:
Name | Type | Description |
---|---|---|
context |
EdxCourseEnrollmentUpgradeSucceededContextField |
See EdxCourseEnrollmentUpgradeSucceededContextField. |
event_type |
str |
Consists of the value
|
name |
str |
Consists of the value |
Source code in ralph/models/edx/enrollment/statements.py
class EdxCourseEnrollmentUpgradeSucceeded(BaseServerModel):
"""Represents the `edx.course.enrollment.upgrade.succeeded` server statement.
The server emits it when the process of upgrading a student’s
student_courseenrollment.mode from `audit` or `honor` to `verified` is complete.
Attributes:
context (EdxCourseEnrollmentUpgradeSucceededContextField):
See EdxCourseEnrollmentUpgradeSucceededContextField.
event_type (str): Consists of the value
`edx.course.enrollment.upgrade.succeeded`.
name (str): Consists of the value `edx.course.enrollment.upgrade.succeeded`.
"""
__selector__ = selector(
event_source="server", event_type="edx.course.enrollment.upgrade.succeeded"
)
context: EdxCourseEnrollmentUpgradeSucceededContextField
event_type: Literal["edx.course.enrollment.upgrade.succeeded"]
name: Literal["edx.course.enrollment.upgrade.succeeded"]
UIEdxCourseEnrollmentUpgradeClicked (BaseBrowserModel)
pydantic-model
¶
Represents the edx.course.enrollment.upgrade_clicked
browser statement.
The browser emits it when a student clicks ChallengeYourself option,
and the process of upgrading the student_courseenrollment.mode for the student
to verified
begins.
Attributes:
Name | Type | Description |
---|---|---|
context |
EdxCourseEnrollmentUpgradeClickedContextField |
See EdxCourseEnrollmentUpgradeClickedContextField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/enrollment/statements.py
class UIEdxCourseEnrollmentUpgradeClicked(BaseBrowserModel):
"""Represents the `edx.course.enrollment.upgrade_clicked` browser statement.
The browser emits it when a student clicks <kbd>ChallengeYourself</kbd> option,
and the process of upgrading the student_courseenrollment.mode for the student
to `verified` begins.
Attributes:
context (EdxCourseEnrollmentUpgradeClickedContextField):
See EdxCourseEnrollmentUpgradeClickedContextField.
event_type (str): Consists of the value `edx.course.enrollment.upgrade_clicked`.
name (str): Consists of the value `edx.course.enrollment.upgrade_clicked`.
"""
__selector__ = selector(
event_source="browser", event_type="edx.course.enrollment.upgrade_clicked"
)
context: EdxCourseEnrollmentUpgradeClickedContextField
event_type: Literal["edx.course.enrollment.upgrade_clicked"]
name: Literal["edx.course.enrollment.upgrade_clicked"]
navigational
special
¶
fields
special
¶
events
¶
Navigational event field definition
NavigationalEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of navigational statements.
Note: All navigational statements are emitted from the browser.
Attributes:
Name | Type | Description |
---|---|---|
id |
str |
Consists of the edX ID of the sequence. |
old |
int |
For |
new |
int |
For |
Source code in ralph/models/edx/navigational/fields/events.py
class NavigationalEventField(AbstractBaseEventField):
"""Represents the `event` field of navigational statements.
Note: All navigational statements are emitted from the browser.
Attributes:
id (str): Consists of the edX ID of the sequence.
old (int): For `seq_goto`, it consists of the index of the unit being jumped to.
For `seq_next` and `seq_prev`, it consists of the index of the unit being
navigated to.
new (int): For `seq_goto`, it consists of the index of the unit being jumped
from. For `seq_next` and `seq_prev`, it consists of the index of the unit
being navigated away from.
"""
id: constr(
regex=(
r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+type" # noqa : F722
r"@sequential\+block@[a-f0-9]{32}$" # noqa : F722
)
)
new: int
old: int
statements
¶
Navigational event model definitions
UIPageClose (BaseBrowserModel)
pydantic-model
¶
Represents the page_close
browser statement.
This type of statement is triggered when the user navigates to the next page
or closes the browser window (when the JavaScript window.onunload
event
is called).
Attributes:
Name | Type | Description |
---|---|---|
event |
str |
Consists of the string value |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/navigational/statements.py
class UIPageClose(BaseBrowserModel):
"""Represents the `page_close` browser statement.
This type of statement is triggered when the user navigates to the next page
or closes the browser window (when the JavaScript `window.onunload` event
is called).
Attributes:
event (str): Consists of the string value `{}`.
event_type (str): Consists of the value `page_close`.
name (str): Consists of the value `page_close`.
"""
__selector__ = selector(event_source="browser", event_type="page_close")
# pylint: disable=unsubscriptable-object
event: Literal["{}"]
event_type: Literal["page_close"]
name: Literal["page_close"]
UISeqGoto (BaseBrowserModel)
pydantic-model
¶
Represents the seq_goto
browser statement.
The browser emits such statement when a user selects a navigational control.
seq_goto
is emitted when a user jumps between units in a sequence.
Attributes:
Name | Type | Description |
---|---|---|
event |
obj |
Consists of member fields that identify specifics triggered event. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/navigational/statements.py
class UISeqGoto(BaseBrowserModel):
"""Represents the `seq_goto` browser statement.
The browser emits such statement when a user selects a navigational control.
`seq_goto` is emitted when a user jumps between units in a sequence.
Attributes:
event (obj): Consists of member fields that identify specifics triggered event.
event_type (str): Consists of the value `seq_goto`.
name (str): Consists of the value `seq_goto`.
"""
__selector__ = selector(event_source="browser", event_type="seq_goto")
# pylint: disable=unsubscriptable-object
event: Union[Json[NavigationalEventField], NavigationalEventField]
event_type: Literal["seq_goto"]
name: Literal["seq_goto"]
UISeqNext (BaseBrowserModel)
pydantic-model
¶
Represents the seq_next
browser statement.
The browser emits such statement when a user selects a navigational control.
seq_next
is emitted when a user navigates to the next unit in a sequence.
Attributes:
Name | Type | Description |
---|---|---|
event |
obj |
Consists of member fields that identify specifics triggered event. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/navigational/statements.py
class UISeqNext(BaseBrowserModel):
"""Represents the `seq_next` browser statement.
The browser emits such statement when a user selects a navigational control.
`seq_next` is emitted when a user navigates to the next unit in a sequence.
Attributes:
event (obj): Consists of member fields that identify specifics triggered event.
event_type (str): Consists of the value `seq_next`.
name (str): Consists of the value `seq_next`.
"""
__selector__ = selector(event_source="browser", event_type="seq_next")
# pylint: disable=unsubscriptable-object
event: Union[Json[NavigationalEventField], NavigationalEventField]
event_type: Literal["seq_next"]
name: Literal["seq_next"]
@validator("event")
@classmethod
def validate_next_jump_event_field(cls, value):
"""Checks that event.new is equal to event.old + 1."""
if value.new != value.old + 1:
raise ValueError("event.new - event.old should be equal to 1")
return value
validate_next_jump_event_field(value)
classmethod
¶
Checks that event.new is equal to event.old + 1.
Source code in ralph/models/edx/navigational/statements.py
@validator("event")
@classmethod
def validate_next_jump_event_field(cls, value):
"""Checks that event.new is equal to event.old + 1."""
if value.new != value.old + 1:
raise ValueError("event.new - event.old should be equal to 1")
return value
UISeqPrev (BaseBrowserModel)
pydantic-model
¶
Represents the seq_prev
browser statement.
The browser emits such statement when a user selects a navigational control.
seq_prev
is emitted when a user navigates to the previous unit in a sequence.
Attributes:
Name | Type | Description |
---|---|---|
event |
obj |
Consists of member fields that identify specifics triggered event. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/navigational/statements.py
class UISeqPrev(BaseBrowserModel):
"""Represents the `seq_prev` browser statement.
The browser emits such statement when a user selects a navigational control.
`seq_prev` is emitted when a user navigates to the previous unit in a sequence.
Attributes:
event (obj): Consists of member fields that identify specifics triggered event.
event_type (str): Consists of the value `seq_prev`.
name (str): Consists of the value `seq_prev`.
"""
__selector__ = selector(event_source="browser", event_type="seq_prev")
# pylint: disable=unsubscriptable-object
event: Union[Json[NavigationalEventField], NavigationalEventField]
event_type: Literal["seq_prev"]
name: Literal["seq_prev"]
@validator("event")
@classmethod
def validate_prev_jump_event_field(cls, value):
"""Checks that event.new is equal to event.old - 1."""
if value.new != value.old - 1:
raise ValueError("event.old - event.new should be equal to 1")
return value
validate_prev_jump_event_field(value)
classmethod
¶
Checks that event.new is equal to event.old - 1.
Source code in ralph/models/edx/navigational/statements.py
@validator("event")
@classmethod
def validate_prev_jump_event_field(cls, value):
"""Checks that event.new is equal to event.old - 1."""
if value.new != value.old - 1:
raise ValueError("event.old - event.new should be equal to 1")
return value
problem_interaction
special
¶
fields
special
¶
events
¶
Problem interaction events model event fields definitions
CorrectMap (BaseModelWithConfig)
pydantic-model
¶
Represents the correct_map
sub-field.
Attributes:
Name | Type | Description |
---|---|---|
answervariable |
str |
Consists of the variable chosen in answer in the case of optionresponse provided with variables. |
correctness |
str |
Consists either of the |
hint |
str |
Consists of optional hint. |
hint_mode |
str |
Consists either of the value |
msg |
str |
Consists of extra message response. |
npoints |
int |
Consists of awarded points. |
queuestate |
json |
see QueueStateField. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class CorrectMap(BaseModelWithConfig):
"""Represents the `correct_map` sub-field.
Attributes:
answervariable (str): Consists of the variable chosen in answer in the case of
optionresponse provided with variables.
correctness (str): Consists either of the `correct` or `incorrect` value.
hint (str): Consists of optional hint.
hint_mode (str): Consists either of the value `on_request` or `always` value.
msg (str): Consists of extra message response.
npoints (int): Consists of awarded points.
queuestate (json): see QueueStateField.
"""
answervariable: Union[Literal[None], None, str]
correctness: Union[Literal["correct"], Literal["incorrect"]]
hint: Optional[str]
hintmode: Optional[Union[Literal["on_request"], Literal["always"]]]
msg: str
npoints: Optional[int]
queuestate: Optional[QueueState]
EdxProblemHintDemandhintDisplayedEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of EdxProblemHintDemandhintDisplayed
model.
Attributes:
Name | Type | Description |
---|---|---|
hint_index |
int |
Consists of the identifier for the hint that was displayed to the user. |
hint_len |
int |
Consists of the total number of hints defined for this problem. |
hint_text |
str |
Consists of the text of the hint that was displayed to the user. |
module_id |
str |
Consists of the identifier for the problem component for which the user requested the hint. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class EdxProblemHintDemandhintDisplayedEventField(AbstractBaseEventField):
"""Represents the `event` field of `EdxProblemHintDemandhintDisplayed` model.
Attributes:
hint_index (int): Consists of the identifier for the hint that was displayed to
the user.
hint_len (int): Consists of the total number of hints defined for this problem.
hint_text (str): Consists of the text of the hint that was displayed to the
user.
module_id (str): Consists of the identifier for the problem component for which
the user requested the hint.
"""
hint_index: int
hint_len: int
hint_text: str
module_id: str
EdxProblemHintFeedbackDisplayedEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of EdxProblemHintFeedbackDisplayed
model.
Attributes:
Name | Type | Description |
---|---|---|
choice_all |
list |
Lists all of the answer choices for problems with multiple possible answers defined. |
correctness |
bool |
|
hint_label |
str |
Consists of the feedback message given for the answer correctness. |
hints |
list |
Consists of a text member field with the given feedback string. |
module_id |
str |
Consists of the identifier for the problem component for which the user received the feedback. |
problem_part_id |
str |
Consists of the specific problem for which the user received feedback. |
question_type |
str |
Consists of the XML tag that identifies the problem type. |
student_answer |
list |
Consists of the answer value(s) selected or supplied by the user. |
trigger_type |
str |
Identifies the type of feedback obtained by the
|
Source code in ralph/models/edx/problem_interaction/fields/events.py
class EdxProblemHintFeedbackDisplayedEventField(AbstractBaseEventField):
"""Represents the `event` field of `EdxProblemHintFeedbackDisplayed` model.
Attributes:
choice_all (list): Lists all of the answer choices for problems with multiple
possible answers defined.
correctness (bool): `True` if the `student_answer` value is correct, else
`False`.
hint_label (str): Consists of the feedback message given for the answer
correctness.
hints (list): Consists of a text member field with the given feedback string.
module_id (str): Consists of the identifier for the problem component for which
the user received the feedback.
problem_part_id (str): Consists of the specific problem for which the user
received feedback.
question_type (str): Consists of the XML tag that identifies the problem type.
student_answer (list): Consists of the answer value(s) selected or supplied by
the user.
trigger_type (str): Identifies the type of feedback obtained by the
`student_answer` response. Consists either of `single` or `compound` value.
"""
choice_all: Optional[list[str]]
correctness: bool
hint_label: str
hints: list[dict]
module_id: str
problem_part_id: str
question_type: Union[
Literal["stringresponse"],
Literal["choiceresponse"],
Literal["multiplechoiceresponse"],
Literal["numericalresponse"],
Literal["optionresponse"],
]
student_answer: list[str]
trigger_type: Union[Literal["single"], Literal["compound"]]
ProblemCheckEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ProblemCheck
model.
Attributes:
Name | Type | Description |
---|---|---|
answers |
dict |
Consists of a dictionary of problem ID and the corresponding internal answer identifier for each problem. |
attempts |
int |
Consists of the number of times the user attempted to answer the problem. |
correct_map |
dict |
Consists of the evaluation data for each answer. |
grade |
int |
Consists of the current grade value. |
max_grade |
int |
Consists of the maximum possible grade value. |
problem_id |
str |
Consists of the ID of the problem that was checked. |
state |
json |
Consists of the current problem state. |
submission |
dict |
Consists of a dictionnary of data about the given answer. |
success |
str |
Consists of either the |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ProblemCheckEventField(AbstractBaseEventField):
"""Represents the `event` field of `ProblemCheck` model.
Attributes:
answers (dict): Consists of a dictionary of problem ID and the corresponding
internal answer identifier for each problem.
attempts (int): Consists of the number of times the user attempted to answer
the problem.
correct_map (dict): Consists of the evaluation data for each answer.
grade (int): Consists of the current grade value.
max_grade (int): Consists of the maximum possible grade value.
problem_id (str): Consists of the ID of the problem that was checked.
state (json): Consists of the current problem state.
submission (dict): Consists of a dictionnary of data about the given answer.
success (str): Consists of either the `correct` or `incorrect` value.
"""
answers: dict[
constr(regex=r"^[a-f0-9]{32}_[0-9]_[0-9]$"), # noqa : F722
Union[list[str], str],
]
attempts: int
correct_map: dict[
constr(regex=r"^[a-f0-9]{32}_[0-9]_[0-9]$"), # noqa : F722
CorrectMap,
]
grade: int
max_grade: int
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
state: State
submission: dict[
constr(regex=r"^[a-f0-9]{32}_[0-9]_[0-9]$"), # noqa : F722
SubmissionAnswerField,
]
success: Union[Literal["correct"], Literal["incorrect"]]
ProblemCheckFailEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ProblemCheckFail
model.
Attributes:
Name | Type | Description |
---|---|---|
answers |
dict |
Consists of a dictionary of problem ID and the internal answer identifier for each problem. |
failure |
str |
Consists either of the |
problem_id |
str |
Consists of the ID of the problem that was checked. |
state |
dict |
Consists of the current problem state. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ProblemCheckFailEventField(AbstractBaseEventField):
"""Represents the `event` field of `ProblemCheckFail` model.
Attributes:
answers (dict): Consists of a dictionary of problem ID and the internal answer
identifier for each problem.
failure (str): Consists either of the `closed` or `unreset` value.
problem_id (str): Consists of the ID of the problem that was checked.
state (dict): Consists of the current problem state.
"""
answers: dict[
constr(regex=r"^[a-f0-9]{32}_[0-9]_[0-9]$"), # noqa : F722
Union[list[str], str],
]
failure: Union[Literal["closed"], Literal["unreset"]]
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
state: State
ProblemRescoreEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ProblemRescore
model.
Attributes:
Name | Type | Description |
---|---|---|
attempts |
int |
Consists of the number of attempts of rescoring. |
correct_map |
json |
see CorrectMapSubFields. |
new_score |
int |
Consists of the new score obtained after rescoring. |
new_total |
int |
Consists of the new total summed after rescoring. |
orig_score |
int |
Consists of the original scored before rescoring. |
problem_id |
str |
Consists of the ID of the problem being rescored. |
state |
json |
see StateField. |
success |
str |
Consists either of the |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ProblemRescoreEventField(AbstractBaseEventField):
"""Represents the `event` field of `ProblemRescore` model.
Attributes:
attempts (int): Consists of the number of attempts of rescoring.
correct_map (json): see CorrectMapSubFields.
new_score (int): Consists of the new score obtained after rescoring.
new_total (int): Consists of the new total summed after rescoring.
orig_score (int): Consists of the original scored before rescoring.
problem_id (str): Consists of the ID of the problem being rescored.
state (json): see StateField.
success (str): Consists either of the `correct` or `incorrect` value.
"""
attempts: int
correct_map: CorrectMap
new_score: int
new_total: int
orig_score: int
orig_total: int
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
state: State
success: Union[Literal["correct"], Literal["incorrect"]]
ProblemRescoreFailEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ProblemRescoreFail
model.
Attributes:
Name | Type | Description |
---|---|---|
failure |
str |
Consists either of the |
problem_id |
str |
Consists of the ID of the problem being checked. |
state |
json |
see StateField. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ProblemRescoreFailEventField(AbstractBaseEventField):
"""Represents the `event` field of `ProblemRescoreFail` model.
Attributes:
failure (str): Consists either of the `closed` or `unreset` value.
problem_id (str): Consists of the ID of the problem being checked.
state (json): see StateField.
"""
failure: Union[Literal["closed"], Literal["unreset"]]
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
state: State
QueueState (BaseModelWithConfig)
pydantic-model
¶
Represents the queuestate
sub-field.
Attributes:
Name | Type | Description |
---|---|---|
key |
str |
Consists of a secret string. |
time |
str |
Consists of a string dump of a DateTime object in the format ‘%Y%m%d%H%M%S’. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class QueueState(BaseModelWithConfig):
"""Represents the `queuestate` sub-field.
Attributes:
key (str): Consists of a secret string.
time (str): Consists of a string dump of a DateTime object in the format
'%Y%m%d%H%M%S'.
"""
key: str
time: datetime
ResetProblemEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ResetProblem
model.
Attributes:
Name | Type | Description |
---|---|---|
new_state |
json |
see StateField. |
old_state |
json |
see StateField. |
problem_id |
str |
Consists of the ID of the problem being reset. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ResetProblemEventField(AbstractBaseEventField):
"""Represents the `event` field of `ResetProblem` model.
Attributes:
new_state (json): see StateField.
old_state (json): see StateField.
problem_id (str): Consists of the ID of the problem being reset.
"""
new_state: State
old_state: State
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
ResetProblemFailEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ResetProblemFail
model.
Attributes:
Name | Type | Description |
---|---|---|
failure |
str |
Consists either of |
old_state |
json |
see StateField. |
problem_id |
str |
Consists of the ID of the problem being reset. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ResetProblemFailEventField(AbstractBaseEventField):
"""Represents the `event` field of `ResetProblemFail` model.
Attributes:
failure (str): Consists either of `closed` or `not_done` value.
old_state (json): see StateField.
problem_id (str): Consists of the ID of the problem being reset.
"""
failure: Union[Literal["closed"], Literal["not_done"]]
old_state: State
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
SaveProblemFailEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of SaveProblemFail
model.
Attributes:
Name | Type | Description |
---|---|---|
answers |
dict |
Consists of a dict of the answer string or a list or a dict of the answer strings if multiple choices are allowed. |
failure |
str |
Consists either of |
problem_id |
str |
Consists of the ID of the problem being saved. |
state |
json |
see StateField. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class SaveProblemFailEventField(AbstractBaseEventField):
"""Represents the `event` field of `SaveProblemFail` model.
Attributes:
answers (dict): Consists of a dict of the answer string or a list or a dict of
the answer strings if multiple choices are allowed.
failure (str): Consists either of `closed` or `done` value.
problem_id (str): Consists of the ID of the problem being saved.
state (json): see StateField.
"""
answers: dict[str, Union[int, str, list, dict]]
failure: Union[Literal["closed"], Literal["done"]]
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
state: State
SaveProblemSuccessEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of SaveProblemSuccess
model.
Attributes:
Name | Type | Description |
---|---|---|
answers |
dict |
Consists of a dict of the answer string or a list or a dict of the answer strings if multiple choices are allowed. |
problem_id |
str |
Consists of the ID of the problem being saved. |
state |
json |
see StateField. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class SaveProblemSuccessEventField(AbstractBaseEventField):
"""Represents the `event` field of `SaveProblemSuccess` model.
Attributes:
answers (dict): Consists of a dict of the answer string or a list or a dict of
the answer strings if multiple choices are allowed.
problem_id (str): Consists of the ID of the problem being saved.
state (json): see StateField.
"""
answers: dict[str, Union[int, str, list, dict]]
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
state: State
ShowAnswerEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ShowAnswer
model.
Attributes:
Name | Type | Description |
---|---|---|
problem_id |
str |
Consists of the ID of the problem being shown. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class ShowAnswerEventField(AbstractBaseEventField):
"""Represents the `event` field of `ShowAnswer` model.
Attributes:
problem_id (str): Consists of the ID of the problem being shown.
"""
problem_id: constr(
regex=r"^block-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+" # noqa : F722
r"type@problem\+block@[a-f0-9]{32}$" # noqa : F722
)
State (BaseModelWithConfig)
pydantic-model
¶
Represents the state
sub-field.
Attributes:
Name | Type | Description |
---|---|---|
correct_map |
dict |
see CorrectMapSubFields. |
done |
bool |
|
input_state |
dict |
Consists of the state field given before answering. |
seed |
int |
Consists of the seed element for the current state. |
student_answers |
dict |
Consists of the answer(s) given by the user. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class State(BaseModelWithConfig):
"""Represents the `state` sub-field.
Attributes:
correct_map (dict): see CorrectMapSubFields.
done (bool): `True` if the problem is answered, else `False`.
input_state (dict): Consists of the state field given before answering.
seed (int): Consists of the seed element for the current state.
student_answers (dict): Consists of the answer(s) given by the user.
"""
correct_map: dict[
constr(regex=r"^[a-f0-9]{32}_[0-9]_[0-9]$"), # noqa : F722
CorrectMap,
]
done: Optional[bool]
input_state: dict
seed: int
student_answers: dict
SubmissionAnswerField (BaseModelWithConfig)
pydantic-model
¶
Represents the information in a problem of submission
field.
Attributes:
Name | Type | Description |
---|---|---|
answer |
str, list |
Consists of the answer string or a list of the answer strings if multiple choices are allorwed. |
correct |
bool |
|
input_type |
str |
Consists of the type of value that the student supplies for
the |
question |
str |
Consists of the question text. |
response_type |
str |
Consists of the type of problem. |
variant |
str |
Consists of the unique ID of the variant that was presented to this user. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class SubmissionAnswerField(BaseModelWithConfig):
"""Represents the information in a problem of `submission` field.
Attributes:
answer (str, list): Consists of the answer string or a list of the answer
strings if multiple choices are allorwed.
correct (bool): `True` if the `answer` value is correct, else `False`.
input_type (str): Consists of the type of value that the student supplies for
the `response_type`.
question (str): Consists of the question text.
response_type (str): Consists of the type of problem.
variant (str): Consists of the unique ID of the variant that was presented to
this user.
"""
answer: Union[str, list[str]]
correct: bool
input_type: str
question: str
response_type: str
variant: str
UIProblemResetEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ProblemReset
model.
Attributes:
Name | Type | Description |
---|---|---|
answers |
str, list |
Consists of the answer string or a list of the answer strings if multiple choices are allowed. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class UIProblemResetEventField(AbstractBaseEventField):
"""Represents the `event` field of `ProblemReset` model.
Attributes:
answers (str, list): Consists of the answer string or a list of the answer
strings if multiple choices are allowed.
"""
answers: Union[str, list[str]]
UIProblemShowEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of ProblemShow
model.
Attributes:
Name | Type | Description |
---|---|---|
problem |
str |
Consists of the optional name value that the course creators supply or the system-generated hash code for the problem being shown. |
Source code in ralph/models/edx/problem_interaction/fields/events.py
class UIProblemShowEventField(AbstractBaseEventField):
"""Represents the `event` field of `ProblemShow` model.
Attributes:
problem (str): Consists of the optional name value that the course creators
supply or the system-generated hash code for the problem being shown.
"""
problem: str
statements
¶
Problem interaction events model definitions
EdxProblemHintDemandhintDisplayed (BaseServerModel)
pydantic-model
¶
Represents the edx.problem.hint.demandhint_displayed
server event.
This event is triggered when a user requests a hint for a problem.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See EdxProblemHintDemandhintDisplayedEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class EdxProblemHintDemandhintDisplayed(BaseServerModel):
"""Represents the `edx.problem.hint.demandhint_displayed` server event.
This event is triggered when a user requests a hint for a problem.
Attributes:
event (dict): See EdxProblemHintDemandhintDisplayedEventField.
event_type (str): Consists of the value `edx.problem.hint.demandhint_displayed`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(
event_source="server", event_type="edx.problem.hint.demandhint_displayed"
)
event: EdxProblemHintDemandhintDisplayedEventField
event_type: Literal["edx.problem.hint.demandhint_displayed"]
page: Literal["x_module"]
EdxProblemHintFeedbackDisplayed (BaseServerModel)
pydantic-model
¶
Represents the edx.problem.hint.feedback_displayed
server event.
This event is triggered when a user receives a hint after answering a problem.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See EdxProblemHintFeedbackDisplayedEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class EdxProblemHintFeedbackDisplayed(BaseServerModel):
"""Represents the `edx.problem.hint.feedback_displayed` server event.
This event is triggered when a user receives a hint after answering a problem.
Attributes:
event (dict): See EdxProblemHintFeedbackDisplayedEventField.
event_type (str): Consists of the value `edx.problem.hint.feedback_displayed`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(
event_source="server", event_type="edx.problem.hint.feedback_displayed"
)
event: EdxProblemHintFeedbackDisplayedEventField
event_type: Literal["edx.problem.hint.feedback_displayed"]
page: Literal["x_module"]
ProblemCheck (BaseServerModel)
pydantic-model
¶
Represents the problem_check
server event.
This event is triggered when a user checks a problem.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ProblemCheckEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ProblemCheck(BaseServerModel):
"""Represents the `problem_check` server event.
This event is triggered when a user checks a problem.
Attributes:
event (dict): See ProblemCheckEventField.
event_type (str): Consists of the value `problem_check`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="problem_check")
event: ProblemCheckEventField
event_type: Literal["problem_check"]
page: Literal["x_module"]
ProblemCheckFail (BaseServerModel)
pydantic-model
¶
Represents the problem_check_fail
server event.
This event is triggered when a user checks a problem and a failure prevents the problem from being checked successfully.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ProblemCheckFailEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ProblemCheckFail(BaseServerModel):
"""Represents the `problem_check_fail` server event.
This event is triggered when a user checks a problem and a failure prevents the
problem from being checked successfully.
Attributes:
event (dict): See ProblemCheckFailEventField.
event_type (str): Consists of the value `problem_check_fail`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="problem_check_fail")
event: ProblemCheckFailEventField
event_type: Literal["problem_check_fail"]
page: Literal["x_module"]
ProblemRescore (BaseServerModel)
pydantic-model
¶
Represents the problem_rescore
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ProblemRescoreEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ProblemRescore(BaseServerModel):
"""Represents the `problem_rescore` server event.
Attributes:
event (dict): See ProblemRescoreEventField.
event_type (str): Consists of the value `problem_rescore`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="problem_rescore")
event: ProblemRescoreEventField
event_type: Literal["problem_rescore"]
page: Literal["x_module"]
ProblemRescoreFail (BaseServerModel)
pydantic-model
¶
Represents the problem_rescore_fail
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ProblemRescoreFailEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ProblemRescoreFail(BaseServerModel):
"""Represents the `problem_rescore_fail` server event.
Attributes:
event (dict): See ProblemRescoreFailEventField.
event_type (str): Consists of the value `problem_rescore_fail`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="problem_rescore_fail")
event: ProblemRescoreFailEventField
event_type: Literal["problem_rescore_fail"]
page: Literal["x_module"]
ResetProblem (BaseServerModel)
pydantic-model
¶
Represents the reset_problem
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ResetProblemEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ResetProblem(BaseServerModel):
"""Represents the `reset_problem` server event.
Attributes:
event (dict): See ResetProblemEventField.
event_type (str): Consists of the value `reset_problem`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="reset_problem")
event: ResetProblemEventField
event_type: Literal["reset_problem"]
page: Literal["x_module"]
ResetProblemFail (BaseServerModel)
pydantic-model
¶
Represents the reset_problem_fail
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ResetProblemFailEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ResetProblemFail(BaseServerModel):
"""Represents the `reset_problem_fail` server event.
Attributes:
event (dict): See ResetProblemFailEventField.
event_type (str): Consists of the value `reset_problem_fail`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="reset_problem_fail")
event: ResetProblemFailEventField
event_type: Literal["reset_problem_fail"]
page: Literal["x_module"]
SaveProblemFail (BaseServerModel)
pydantic-model
¶
Represents the save_problem_fail
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See SaveProblemFailEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class SaveProblemFail(BaseServerModel):
"""Represents the `save_problem_fail` server event.
Attributes:
event (dict): See SaveProblemFailEventField.
event_type (str): Consists of the value `save_problem_fail`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="save_problem_fail")
event: SaveProblemFailEventField
event_type: Literal["save_problem_fail"]
page: Literal["x_module"]
SaveProblemSuccess (BaseServerModel)
pydantic-model
¶
Represents the save_problem_success
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See SaveProblemSuccessEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class SaveProblemSuccess(BaseServerModel):
"""Represents the `save_problem_success` server event.
Attributes:
event (dict): See SaveProblemSuccessEventField.
event_type (str): Consists of the value `save_problem_success`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="save_problem_success")
event: SaveProblemSuccessEventField
event_type: Literal["save_problem_success"]
page: Literal["x_module"]
ShowAnswer (BaseServerModel)
pydantic-model
¶
Represents the showanswer
server event.
Attributes:
Name | Type | Description |
---|---|---|
event |
dict |
See ShowAnswerEventField. |
event_type |
str |
Consists of the value |
page |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class ShowAnswer(BaseServerModel):
"""Represents the `showanswer` server event.
Attributes:
event (dict): See ShowAnswerEventField.
event_type (str): Consists of the value `showanswer`.
page (str): Consists of the value `x_module`.
"""
__selector__ = selector(event_source="server", event_type="showanswer")
event: ShowAnswerEventField
event_type: Literal["showanswer"]
page: Literal["x_module"]
UIProblemCheck (BaseBrowserModel)
pydantic-model
¶
Represents the problem_check
browser event.
The browser emits this event when a user checks a problem.
Attributes:
Name | Type | Description |
---|---|---|
event |
str |
Consists of values of problem being checked, styled as |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class UIProblemCheck(BaseBrowserModel):
"""Represents the `problem_check` browser event.
The browser emits this event when a user checks a problem.
Attributes:
event (str): Consists of values of problem being checked, styled as `GET`
parameters.
event_type (str): Consists of the value `problem_check`.
name (str): Consists of the value `problem_check`.
"""
__selector__ = selector(event_source="browser", event_type="problem_check")
event: str
event_type: Literal["problem_check"]
name: Literal["problem_check"]
UIProblemGraded (BaseBrowserModel)
pydantic-model
¶
Represents the problem_graded
browser event.
Attributes:
Name | Type | Description |
---|---|---|
event |
list |
See ProblemGradedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class UIProblemGraded(BaseBrowserModel):
"""Represents the `problem_graded` browser event.
Attributes:
event (list): See ProblemGradedEventField.
event_type (str): Consists of the value `problem_graded`.
name (str): Consists of the value `problem_graded`.
"""
__selector__ = selector(event_source="browser", event_type="problem_graded")
event: list[Union[str, Literal[None], None]]
event_type: Literal["problem_graded"]
name: Literal["problem_graded"]
UIProblemReset (BaseBrowserModel)
pydantic-model
¶
Represents the problem_reset
browser event.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See ProblemResetEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class UIProblemReset(BaseBrowserModel):
"""Represents the `problem_reset` browser event.
Attributes:
event (json): See ProblemResetEventField.
event_type (str): Consists of the value `problem_reset`.
name (str): Consists of the value `problem_reset`.
"""
__selector__ = selector(event_source="browser", event_type="problem_reset")
event: Union[
str,
Json[UIProblemResetEventField], # pylint: disable=unsubscriptable-object
UIProblemResetEventField,
]
event_type: Literal["problem_reset"]
name: Literal["problem_reset"]
UIProblemSave (BaseBrowserModel)
pydantic-model
¶
Represents the problem_save
browser event.
Attributes:
Name | Type | Description |
---|---|---|
event |
str |
Consists of all the answers saved for the problem. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class UIProblemSave(BaseBrowserModel):
"""Represents the `problem_save` browser event.
Attributes:
event (str): Consists of all the answers saved for the problem.
event_type (str): Consists of the value `problem_save`.
name (str): Consists of the value `problem_save`.
"""
__selector__ = selector(event_source="browser", event_type="problem_save")
event: str
event_type: Literal["problem_save"]
name: Literal["problem_save"]
UIProblemShow (BaseBrowserModel)
pydantic-model
¶
Represents the problem_show
browser event.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See ProblemShowEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/problem_interaction/statements.py
class UIProblemShow(BaseBrowserModel):
"""Represents the `problem_show` browser event.
Attributes:
event (json): See ProblemShowEventField.
event_type (str): Consists of the value `problem_save`.
name (str): Consists of the value `problem_save`.
"""
__selector__ = selector(event_source="browser", event_type="problem_show")
event: Union[
Json[UIProblemShowEventField], # pylint: disable=unsubscriptable-object
UIProblemShowEventField,
]
event_type: Literal["problem_show"]
name: Literal["problem_show"]
server
¶
Server event model definitions
BaseServerModel (BaseEdxModel)
pydantic-model
¶
Represents the base model all server statements inherit from.
Source code in ralph/models/edx/server.py
class BaseServerModel(BaseEdxModel):
"""Represents the base model all server statements inherit from."""
event_source: Literal["server"]
Server (BaseServerModel)
pydantic-model
¶
Represents a common server statement.
This type of event is triggered from the django middleware on each request
excluding: /event
, login
, heartbeat
, /segmentio/event
and /performance
.
Attributes:
Name | Type | Description |
---|---|---|
event_type |
str |
Consist of the relative URL (without the hostname) of the
requested page.
Retrieved with:
|
event |
str |
Consist of a JSON string holding the content of the GET or POST
request.
Retrieved with:
|
Source code in ralph/models/edx/server.py
class Server(BaseServerModel):
"""Represents a common server statement.
This type of event is triggered from the django middleware on each request
excluding: `/event`, `login`, `heartbeat`, `/segmentio/event` and `/performance`.
Attributes:
event_type (str): Consist of the relative URL (without the hostname) of the
requested page.
Retrieved with:
`request.META['PATH_INFO']`
event (str): Consist of a JSON string holding the content of the GET or POST
request.
Retrieved with:
```json.dumps(
{
'GET': dict(request.GET),
'POST': dict(request.POST)
}
)[:512]```
Note:
Values for ['password', 'newpassword', 'new_password', 'oldpassword',
'old_password', 'new_password1', 'new_password2'] are replaced by
`********`.
The JSON string is truncated at 512 characters resulting in invalid
JSON.
"""
__selector__ = selector(
event_source="server", event_type=LazyModelField("context__path")
)
# pylint: disable=unsubscriptable-object
event_type: Path
event: Union[Json[ServerEventField], ServerEventField]
ServerEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event
field of the ServerEventModel.
Source code in ralph/models/edx/server.py
class ServerEventField(AbstractBaseEventField):
"""Represents the `event` field of the ServerEventModel."""
GET: dict
POST: dict
textbook_interaction
special
¶
fields
special
¶
events
¶
Textbook interaction event fields definitions
BookEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the book
event field.
Attributes:
Name | Type | Description |
---|---|---|
chapter |
str |
Consists of the name of the PDF file. |
name |
str |
Consists of |
new |
int |
Consists of the destination page number. |
old |
int |
Consists of the original page number. It applies to |
type |
str |
Consists of |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class BookEventField(AbstractBaseEventField):
"""Represents the `book` event field.
Attributes:
chapter (str): Consists of the name of the PDF file.
name (str): Consists of `textbook.pdf.page.loaded` if type is set to
`gotopage`,
`textbook.pdf.page.navigatednext` if type is set to `prevpage`,
`textbook.pdf.page.navigatednext` if type is set to `nextpage`.
new (int): Consists of the destination page number.
old (int): Consists of the original page number. It applies to `gotopage` event
types only.
type (str): Consists of `gotopage` value when a page loads after the student
manually enters its number, `prevpage` value when the next page button is
clicked or `nextpage` value when the previous page button is clicked.
"""
chapter: constr(
regex=(
r"^\/asset-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+type@asset\+block.+$" # noqa
)
)
name: Union[
Literal["textbook.pdf.page.loaded"], Literal["textbook.pdf.page.navigatednext"]
]
new: int
old: Optional[int]
type: Union[Literal["gotopage"], Literal["prevpage"], Literal["nextpage"]] = Field(
alias="type"
)
TextbookInteractionBaseEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the event field which attributes are common to most of the textbook interaction events.
Attributes:
Name | Type | Description |
---|---|---|
chapter |
str |
Consists of the name of the PDF file.
It begins with the |
page |
int |
The number of the page that is open when the event is emitted. |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookInteractionBaseEventField(AbstractBaseEventField):
"""Represents the event field which attributes are common to most of the textbook
interaction events.
Attributes:
chapter (str): Consists of the name of the PDF file.
It begins with the `block_id` value and ends with the `.pdf` extension.
page (int): The number of the page that is open when the event is emitted.
"""
page: int
chapter: constr(
regex=(
r"^\/asset-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+type@asset\+block.+$" # noqa
)
)
TextbookPdfChapterNavigatedEventField (AbstractBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.chapter.navigated
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
chapter |
str |
Consists of the name of the PDF file.
It begins with the |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfChapterNavigatedEventField(AbstractBaseEventField):
"""Represents the `textbook.pdf.chapter.navigated` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.chapter.navigated`.
chapter (str): Consists of the name of the PDF file.
It begins with the `block_id` value and ends with the `.pdf` extension.
"""
name: Literal["textbook.pdf.chapter.navigated"]
chapter: constr(
regex=(
r"^\/asset-v1:[^\/+]+(\/|\+)[^\/+]+(\/|\+)[^\/?]+type@asset\+block.+$" # noqa
)
)
chapter_title: str
TextbookPdfDisplayScaledEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.display.scaled
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
amount |
str |
Consists of a floating point number string value. |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfDisplayScaledEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.display.scaled` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.display.scaled`.
amount (str): Consists of a floating point number string value.
"""
name: Literal["textbook.pdf.display.scaled"]
amount: float
TextbookPdfOutlineToggledEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.outline.toggled
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfOutlineToggledEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.outline.toggled` event field.
Attribute:
name (str): Consists of the value `textbook.pdf.outline.toggled`.
"""
name: Literal["textbook.pdf.outline.toggled"]
TextbookPdfPageNavigatedEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.page.navigated
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfPageNavigatedEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.page.navigated` event field.
Attribute:
name (str): Consists of the value `textbook.pdf.page.navigated`.
"""
name: Literal["textbook.pdf.page.navigated"]
TextbookPdfPageScrolledEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.page.scrolled
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
direction |
str |
Consists either of the |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfPageScrolledEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.page.scrolled` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.page.scrolled`.
direction (str): Consists either of the `up` or `down` value.
"""
name: Literal["textbook.pdf.page.scrolled"]
direction: Union[Literal["up"], Literal["down"]]
TextbookPdfSearchCaseSensitivityToggledEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.searchcasesensitivity.toggled
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
caseSensitive |
bool |
Consists either of the |
highlightAll |
bool |
Consists either of the |
query |
str |
Consists of the value in the search field. |
status |
str |
Consists either of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfSearchCaseSensitivityToggledEventField(
TextbookInteractionBaseEventField
):
"""Represents the `textbook.pdf.searchcasesensitivity.toggled` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.searchcasesensitivity.toggled`.
caseSensitive (bool): Consists either of the `true` value if the case sensitive
option is selected or `false` if this option is not selected.
highlightAll (bool): Consists either of the `true` value if the option to
highlight all matches is selected or `false` if this option is not selected.
query (str): Consists of the value in the search field.
status (str): Consists either of the value `not found` for a search string that
is unsuccessful or blank for successful search strings.
"""
name: Literal["textbook.pdf.searchcasesensitivity.toggled"]
caseSensitive: bool
highlightAll: bool
query: str
status: str
TextbookPdfSearchExecutedEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.search.executed
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
caseSensitive |
bool |
Consists either of the |
highlightAll |
bool |
Consists either of the |
query |
str |
Consists of the value in the search field. |
status |
str |
Consists either of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfSearchExecutedEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.search.executed` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.search.executed`.
caseSensitive (bool): Consists either of the `true` value if the case sensitive
option is selected or `false` if this option is not selected.
highlightAll (bool): Consists either of the `true` value if the option to
highlight all matches is selected or `false` if this option is not selected.
query (str): Consists of the value in the search field.
status (str): Consists either of the value `not found` for a search string that
is unsuccessful or blank for successful search strings.
"""
name: Literal["textbook.pdf.search.executed"]
caseSensitive: bool
highlightAll: bool
query: str
status: str
TextbookPdfSearchHighlightToggledEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.search.highlight.toggled
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
caseSensitive |
bool |
Consists either of the |
highlightAll |
bool |
Consists either of the |
query |
str |
Consists of the value in the search field. |
status |
str |
Consists either of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfSearchHighlightToggledEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.search.highlight.toggled` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.search.highlight.toggled`.
caseSensitive (bool): Consists either of the `true` value if the case sensitive
option is selected or `false` if this option is not selected.
highlightAll (bool): Consists either of the `true` value if the option to
highlight all matches is selected or `false` if this option is not selected.
query (str): Consists of the value in the search field.
status (str): Consists either of the value `not found` for a search string that
is unsuccessful or blank for successful search strings.
"""
name: Literal["textbook.pdf.search.highlight.toggled"]
caseSensitive: bool
highlightAll: bool
query: str
status: str
TextbookPdfSearchNavigatedNextEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.search.navigatednext
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
caseSensitive |
bool |
Consists either of the |
findPrevious(bool) |
Consists either of the ‘true’ value if the user clicks the Find Previous icon or ‘false’ if the user clicks the Find Next icon. |
|
highlightAll |
bool |
Consists either of the |
query |
str |
Consists of the value in the search field. |
status |
str |
Consists either of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfSearchNavigatedNextEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.search.navigatednext` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.search.navigatednext`.
caseSensitive (bool): Consists either of the `true` value if the case sensitive
option is selected or `false` if this option is not selected.
findPrevious(bool): Consists either of the ‘true’ value if the user clicks the
Find Previous icon or ‘false’ if the user clicks the <kbd>Find Next</kbd>
icon.
highlightAll (bool): Consists either of the `true` value if the option to
highlight all matches is selected or `false` if this option is not selected.
query (str): Consists of the value in the search field.
status (str): Consists either of the value `not found` for a search string that
is unsuccessful or blank for successful search strings.
"""
name: Literal["textbook.pdf.search.navigatednext"]
caseSensitive: bool
findPrevious: bool
highlightAll: bool
query: str
status: str
TextbookPdfThumbnailNavigatedEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.thumbnail.navigated
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
thumbnail_title |
str |
Consists of the name of the thumbnail. |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfThumbnailNavigatedEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.thumbnail.navigated` event field.
Attribute:
name (str): Consists of the value `textbook.pdf.thumbnail.navigated`.
thumbnail_title (str): Consists of the name of the thumbnail.
"""
name: Literal["textbook.pdf.thumbnail.navigated"]
thumbnail_title: str
TextbookPdfThumbnailsToggledEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.thumbnails.toggled
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfThumbnailsToggledEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.thumbnails.toggled` event field.
Attribute:
name (str): Consists of the value `textbook.pdf.thumbnails.toggled`.
"""
name: Literal["textbook.pdf.thumbnails.toggled"]
TextbookPdfZoomButtonsChangedEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.zoom.buttons.changed
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
direction |
str |
Consists of either the |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfZoomButtonsChangedEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.zoom.buttons.changed` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.zoom.buttons.changed`.
direction (str): Consists of either the `in` or `out` value.
"""
name: Literal["textbook.pdf.zoom.buttons.changed"]
direction: Union[Literal["in"], Literal["out"]]
TextbookPdfZoomMenuChangedEventField (TextbookInteractionBaseEventField)
pydantic-model
¶
Represents the textbook.pdf.zoom.menu.changed
event field.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Consists of the value |
amount |
str |
Consists either of the |
Source code in ralph/models/edx/textbook_interaction/fields/events.py
class TextbookPdfZoomMenuChangedEventField(TextbookInteractionBaseEventField):
"""Represents the `textbook.pdf.zoom.menu.changed` event field.
Attributes:
name (str): Consists of the value `textbook.pdf.zoom.menu.changed`.
amount (str): Consists either of the `0.5`, `0.75`, `1`, `1.25`, `1.5`, `2`,
`3`, `4`, `auto`, `custom`, `page-actual`, `page-fit`, `page-width` value.
"""
name: Literal["textbook.pdf.zoom.menu.changed"]
amount: Union[
Literal["0.5"],
Literal["0.75"],
Literal["1"],
Literal["1.25"],
Literal["1.5"],
Literal["2"],
Literal["3"],
Literal["4"],
Literal["auto"],
Literal["custom"],
Literal["page-actual"],
Literal["page-fit"],
Literal["page-width"],
]
statements
¶
Textbook interaction event model definitions
UIBook (BaseBrowserModel)
pydantic-model
¶
Represents the book
browser event model.
The browser emits this event when a user navigates within the PDF Viewer or the PNG Viewer.
Attributes:
Name | Type | Description |
---|---|---|
event |
BookEventField |
See BookEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UIBook(BaseBrowserModel):
"""Represents the `book` browser event model.
The browser emits this event when a user navigates within the PDF Viewer or the
PNG Viewer.
Attributes:
event (BookEventField): See BookEventField.
event_type (str): Consists of the value `book`.
name (str): Consists of the value `book`.
"""
__selector__ = selector(event_source="browser", event_type="book")
event: Union[
Json[BookEventField], BookEventField # pylint: disable=unsubscriptable-object
]
event_type: Literal["book"]
name: Literal["book"]
UITextbookPdfChapterNavigated (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.chapter.navigated
browser event model.
The browser emits this event when a user clicks on a link in the outline to navigate to a chapter.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfChapterNavigatedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfChapterNavigated(BaseBrowserModel):
"""Represents the `textbook.pdf.chapter.navigated` browser event model.
The browser emits this event when a user clicks on a link in the outline to navigate
to a chapter.
Attributes:
event (json): See TextbookPdfChapterNavigatedEventField.
event_type (str): Consists of the value `textbook.pdf.chapter.navigated`.
name (str): Consists of the value `textbook.pdf.chapter.navigated`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.chapter.navigated"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfChapterNavigatedEventField
],
TextbookPdfChapterNavigatedEventField,
]
event_type: Literal["textbook.pdf.chapter.navigated"]
name: Literal["textbook.pdf.chapter.navigated"]
UITextbookPdfDisplayScaled (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.display.scaled
browser event model.
The browser emits this event when the display magnification changes or the first page is shown.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfDisplayScaledEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfDisplayScaled(BaseBrowserModel):
"""Represents the `textbook.pdf.display.scaled` browser event model.
The browser emits this event when the display magnification changes or the first
page is shown.
Attributes:
event (json): See TextbookPdfDisplayScaledEventField.
event_type (str): Consists of the value `textbook.pdf.display.scaled`.
name (str): Consists of the value `textbook.pdf.display.scaled`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.display.scaled"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfDisplayScaledEventField
],
TextbookPdfDisplayScaledEventField,
]
event_type: Literal["textbook.pdf.display.scaled"]
name: Literal["textbook.pdf.display.scaled"]
UITextbookPdfOutlineToggled (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.outline.toggled
browser event model.
The browser emits this event when a user clicks the outline icon to show or hide a list of the book’s chapters.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfOutlineToggledEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfOutlineToggled(BaseBrowserModel):
"""Represents the `textbook.pdf.outline.toggled` browser event model.
The browser emits this event when a user clicks the outline icon to show or hide
a list of the book’s chapters.
Attributes:
event (json): See TextbookPdfOutlineToggledEventField.
event_type (str): Consists of the value `textbook.pdf.outline.toggled`.
name (str): Consists of the value `textbook.pdf.outline.toggled`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.outline.toggled"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfOutlineToggledEventField
],
TextbookPdfOutlineToggledEventField,
]
event_type: Literal["textbook.pdf.outline.toggled"]
name: Literal["textbook.pdf.outline.toggled"]
UITextbookPdfPageNavigated (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.page.navigated
browser event model.
The browser emits this event when a user manually enters a page number.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfPageNavigatedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfPageNavigated(BaseBrowserModel):
"""Represents the `textbook.pdf.page.navigated` browser event model.
The browser emits this event when a user manually enters a page number.
Attributes:
event (json): See TextbookPdfPageNavigatedEventField.
event_type (str): Consists of the value `textbook.pdf.page.navigated`.
name (str): Consists of the value `textbook.pdf.page.navigated`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.page.navigated"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfPageNavigatedEventField
],
TextbookPdfPageNavigatedEventField,
]
event_type: Literal["textbook.pdf.page.navigated"]
name: Literal["textbook.pdf.page.navigated"]
UITextbookPdfPageScrolled (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.page.scrolled
browser event model.
The browser emits this event when the user scrolls to the next or previous page and the transition takes less than 50 milliseconds.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfPageScrolledEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfPageScrolled(BaseBrowserModel):
"""Represents the `textbook.pdf.page.scrolled` browser event model.
The browser emits this event when the user scrolls to the next or previous page and
the transition takes less than 50 milliseconds.
Attributes:
event (json): See TextbookPdfPageScrolledEventField.
event_type (str): Consists of the value `textbook.pdf.page.scrolled`.
name (str): Consists of the value `textbook.pdf.page.scrolled`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.page.scrolled"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfPageScrolledEventField
],
TextbookPdfPageScrolledEventField,
]
event_type: Literal["textbook.pdf.page.scrolled"]
name: Literal["textbook.pdf.page.scrolled"]
UITextbookPdfSearchCaseSensitivityToggled (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.searchcasesensitivity.toggled
browser event model.
The browser emits this event when a user selects or clears the Match Case option.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfSearchCaseSensitivityToggledEventField. |
event_type |
str |
Consists of the value
|
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfSearchCaseSensitivityToggled(BaseBrowserModel):
"""Represents the `textbook.pdf.searchcasesensitivity.toggled` browser event model.
The browser emits this event when a user selects or clears the
<kbd>Match Case</kbd> option.
Attributes:
event (json): See TextbookPdfSearchCaseSensitivityToggledEventField.
event_type (str): Consists of the value
`textbook.pdf.searchcasesensitivity.toggled`.
name (str): Consists of the value `textbook.pdf.searchcasesensitivity.toggled`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.searchcasesensitivity.toggled"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfSearchCaseSensitivityToggledEventField
],
TextbookPdfSearchCaseSensitivityToggledEventField,
]
event_type: Literal["textbook.pdf.searchcasesensitivity.toggled"]
name: Literal["textbook.pdf.searchcasesensitivity.toggled"]
UITextbookPdfSearchExecuted (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.search.executed
browser event model.
The browser emits this event when a user searches for a text value in the file.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfSearchExecutedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfSearchExecuted(BaseBrowserModel):
"""Represents the `textbook.pdf.search.executed` browser event model.
The browser emits this event when a user searches for a text value in the file.
Attributes:
event (json): See TextbookPdfSearchExecutedEventField.
event_type (str): Consists of the value `textbook.pdf.search.executed`.
name (str): Consists of the value `textbook.pdf.search.executed`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.search.executed"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfSearchExecutedEventField
],
TextbookPdfSearchExecutedEventField,
]
event_type: Literal["textbook.pdf.search.executed"]
name: Literal["textbook.pdf.search.executed"]
UITextbookPdfSearchHighlightToggled (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.search.highlight.toggled
browser event model.
The browser emits this event when a user selects or clears the Highlight All option.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfSearchHighlightToggledEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfSearchHighlightToggled(BaseBrowserModel):
"""Represents the `textbook.pdf.search.highlight.toggled` browser event model.
The browser emits this event when a user selects or clears the
<kbd>Highlight All</kbd> option.
Attributes:
event (json): See TextbookPdfSearchHighlightToggledEventField.
event_type (str): Consists of the value `textbook.pdf.search.highlight.toggled`.
name (str): Consists of the value `textbook.pdf.search.highlight.toggled`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.search.highlight.toggled"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfSearchHighlightToggledEventField
],
TextbookPdfSearchHighlightToggledEventField,
]
event_type: Literal["textbook.pdf.search.highlight.toggled"]
name: Literal["textbook.pdf.search.highlight.toggled"]
UITextbookPdfSearchNavigatedNext (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.search.navigatednext
browser event model.
The browser emits this event when a user clicks on the Find Next or Find Previous icons for an entered search string.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfSearchNavigatedNextEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfSearchNavigatedNext(BaseBrowserModel):
"""Represents the `textbook.pdf.search.navigatednext` browser event model.
The browser emits this event when a user clicks on the <kbd>Find Next</kbd> or
<kbd>Find Previous</kbd> icons for an entered search string.
Attributes:
event (json): See TextbookPdfSearchNavigatedNextEventField.
event_type (str): Consists of the value `textbook.pdf.search.navigatednext`.
name (str): Consists of the value `textbook.pdf.search.navigatednext`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.search.navigatednext"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfSearchNavigatedNextEventField
],
TextbookPdfSearchNavigatedNextEventField,
]
event_type: Literal["textbook.pdf.search.navigatednext"]
name: Literal["textbook.pdf.search.navigatednext"]
UITextbookPdfThumbnailNavigated (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.thumbnail.navigated
browser event model.
The browser emits this event when a user clicks on a thumbnail image to navigate to a page.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfThumbnailNavigatedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfThumbnailNavigated(BaseBrowserModel):
"""Represents the `textbook.pdf.thumbnail.navigated` browser event model.
The browser emits this event when a user clicks on a thumbnail image to navigate
to a page.
Attributes:
event (json): See TextbookPdfThumbnailNavigatedEventField.
event_type (str): Consists of the value `textbook.pdf.thumbnail.navigated`.
name (str): Consists of the value `textbook.pdf.thumbnail.navigated`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.thumbnail.navigated"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfThumbnailNavigatedEventField
],
TextbookPdfThumbnailNavigatedEventField,
]
event_type: Literal["textbook.pdf.thumbnail.navigated"]
name: Literal["textbook.pdf.thumbnail.navigated"]
UITextbookPdfThumbnailsToggled (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.thumbnails.toggled
browser event model.
The browser emits this event when a user clicks on the icon to show or hide page thumbnails.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfThumbnailsToggledEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfThumbnailsToggled(BaseBrowserModel):
"""Represents the `textbook.pdf.thumbnails.toggled` browser event model.
The browser emits this event when a user clicks on the icon to show or hide page
thumbnails.
Attributes:
event (json): See TextbookPdfThumbnailsToggledEventField.
event_type (str): Consists of the value `textbook.pdf.thumbnails.toggled`.
name (str): Consists of the value `textbook.pdf.thumbnails.toggled`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.thumbnails.toggled"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfThumbnailsToggledEventField
],
TextbookPdfThumbnailsToggledEventField,
]
event_type: Literal["textbook.pdf.thumbnails.toggled"]
name: Literal["textbook.pdf.thumbnails.toggled"]
UITextbookPdfZoomButtonsChanged (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.zoom.buttons.changed
browser event model.
The browser emits this event when a user clicks either the Zoom In or Zoom Out icon.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfZoomButtonsChangedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfZoomButtonsChanged(BaseBrowserModel):
"""Represents the `textbook.pdf.zoom.buttons.changed` browser event model.
The browser emits this event when a user clicks either the <kbd>Zoom In</kbd>
or <kbd>Zoom Out</kbd> icon.
Attributes:
event (json): See TextbookPdfZoomButtonsChangedEventField.
event_type (str): Consists of the value `textbook.pdf.zoom.buttons.changed`.
name (str): Consists of the value `textbook.pdf.zoom.buttons.changed`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.zoom.buttons.changed"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfZoomButtonsChangedEventField
],
TextbookPdfZoomButtonsChangedEventField,
]
event_type: Literal["textbook.pdf.zoom.buttons.changed"]
name: Literal["textbook.pdf.zoom.buttons.changed"]
UITextbookPdfZoomMenuChanged (BaseBrowserModel)
pydantic-model
¶
Represents the textbook.pdf.zoom.menu.changed
browser event model.
The browser emits this event when a user selects a magnification setting.
Attributes:
Name | Type | Description |
---|---|---|
event |
json |
See TextbookPdfZoomMenuChangedEventField. |
event_type |
str |
Consists of the value |
name |
str |
Consists of the value |
Source code in ralph/models/edx/textbook_interaction/statements.py
class UITextbookPdfZoomMenuChanged(BaseBrowserModel):
"""Represents the `textbook.pdf.zoom.menu.changed` browser event model.
The browser emits this event when a user selects a magnification setting.
Attributes:
event (json): See TextbookPdfZoomMenuChangedEventField.
event_type (str): Consists of the value `textbook.pdf.zoom.menu.changed`.
name (str): Consists of the value `textbook.pdf.zoom.menu.changed`.
"""
__selector__ = selector(
event_source="browser", event_type="textbook.pdf.zoom.menu.changed"
)
event: Union[
Json[ # pylint: disable=unsubscriptable-object
TextbookPdfZoomMenuChangedEventField
],
TextbookPdfZoomMenuChangedEventField,
]
event_type: Literal["textbook.pdf.zoom.menu.changed"]
name: Literal["textbook.pdf.zoom.menu.changed"]