Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨(converter) add edx to xapi video converter #211

Merged
merged 3 commits into from Nov 17, 2022

Conversation

quitterie-lcs
Copy link
Member

@quitterie-lcs quitterie-lcs commented Sep 1, 2022

Purpose

edX video events can be converted to xAPI for most of them. The interaction events can still not be converted.

Proposal

  • load_video to initialized
  • play_video to played
  • pause_video to paused
  • stop_video to terminated
  • seek_video to seeked

Copy link
Collaborator

@SergioSim SergioSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great) have only minor questions & suggestions)

image

Also, it seems that some required extensions are missing; a table of required/optional extensions of the video profile can be found here.
If it's not possible to add a required extension due to insufficient data in the edX event, could we add a comment in the converter class doc-string?

src/ralph/models/edx/converters/xapi/video.py Outdated Show resolved Hide resolved
tests/fixtures/hypothesis_strategies.py Outdated Show resolved Hide resolved
tests/fixtures/hypothesis_strategies.py Show resolved Hide resolved
src/ralph/models/edx/converters/xapi/video.py Show resolved Hide resolved
@quitterie-lcs
Copy link
Member Author

Also, it seems that some required extensions are missing; a table of required/optional extensions of the video profile can be found here. If it's not possible to add a required extension due to insufficient data in the edX event, could we add a comment in the converter class doc-string?

@SergioSim
Actually, the xAPI statement modelisation for video events have to be changed too. All fields in context, results have been defined as optional, however in the modelisation, it does not fit to the statement rules of the video profile

@quitterie-lcs quitterie-lcs added this to Open in Edx learning event modeling via automation Sep 5, 2022
@quitterie-lcs quitterie-lcs moved this from Open to Review in progress in Edx learning event modeling Sep 5, 2022
Copy link
Collaborator

@SergioSim SergioSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great) Almost there 👍 only a few comments/suggestions left

src/ralph/models/xapi/video/fields/contexts.py Outdated Show resolved Hide resolved
src/ralph/models/edx/converters/xapi/video.py Show resolved Hide resolved
src/ralph/models/xapi/video/fields/results.py Outdated Show resolved Hide resolved
Comment on lines 62 to 64
length: Optional[float] = Field(alias=VIDEO_EXTENSION_LENGTH)
playedSegments: Optional[str] = Field(alias=VIDEO_EXTENSION_PLAYED_SEGMENTS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the length a context extension field (to remove) and the playedSegments a result extension field (to keep)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playedSegments is not in the template description, and length neither by the way !
https://profiles.adlnet.gov/profile/90b2c849-d744-4d0c-8bd0-403e7859a35b/templates/d0ee8f46-5704-428c-b21e-b583f99cd571

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! It seems there are differences between the video profile on the ADL profile server and the video profile documentation (recipe).

This might be because the video profile on the ADL profile server is version https://w3id.org/xapi/video/v1.0.2
and the documentation for the video profile is for version https://w3id.org/xapi/video/v1.0.3 😕

Also, looking at the ADL profile server user guide, it seems that once a profile is published, it cannot be updated (a part of adding translations).
Thus, could it be that the video profile might not be updated to v1.0.3 on the ADL profile server?

Could we add a note in the xAPI video statements model that they are using version 1.0.2 of the video profile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you see in the documentation the v1.0.3 version ? I don't get it. Only the 1.0.2 version has been published on the ADL server, I don't get why they would have documented a newer version before publishing it 😞

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems they indeed don't mention a version number on their gitbook, however, the recipe for the video seeked statement looks very similar to the v1.0.3 jsonld template of the video profile on the xapi-authored-profiles repository.
I don't know why they published v1.0.2 on the profile server instead of v1.0.3. Maybe it's more widely accepted/used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergioSim It's very unclear indeed. I based the model on v1.0.2 as it is the more visible on the profile documentation. But indeed, it would change a bit if the v1.0.3 is the official new version for this profile. I can ask in a issue the reason why. WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Idea) I think version v1.0.2 should be fine, however, it's always good to double check)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergioSim I opened this issue in the xapi-authored-profile repository.

src/ralph/models/xapi/video/fields/results.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/video/statements.py Show resolved Hide resolved
@quitterie-lcs quitterie-lcs force-pushed the add-edx-xapi-video-converter branch 3 times, most recently from b88deff to 763d10e Compare October 20, 2022 12:11
@quitterie-lcs quitterie-lcs force-pushed the add-edx-xapi-video-converter branch 4 times, most recently from 5e7154d to cdaa89b Compare November 2, 2022 16:02
@quitterie-lcs
Copy link
Member Author

@SergioSim the last round! 🙏

@quitterie-lcs quitterie-lcs force-pushed the add-edx-xapi-video-converter branch 3 times, most recently from 6f1bcce to 707af4b Compare November 15, 2022 08:45
Copy link
Collaborator

@SergioSim SergioSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Wonderful work! 🥇
Have only a few minor questions and optional suggestions)
image

src/ralph/models/xapi/video/fields/results.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/video/fields/contexts.py Outdated Show resolved Hide resolved
src/ralph/models/edx/converters/xapi/video.py Show resolved Hide resolved
src/ralph/models/xapi/video/fields/contexts.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/video/fields/contexts.py Outdated Show resolved Hide resolved
@@ -17,27 +17,27 @@
)


class VideoActionResultExtensionsField(BaseModelWithConfig):
class VideoResultExtensionsField(BaseModelWithConfig):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same suggestion here to make the VideoResultExtensionsField inherit from the BaseModel which let's us remove the Config class overwrites in Video*ResultExtensionsField classes.

    class Config:  # pylint: disable=missing-class-docstring
        min_anystr_length = 0

src/ralph/models/xapi/video/fields/results.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/video/fields/contexts.py Outdated Show resolved Hide resolved
src/ralph/models/xapi/video/statements.py Outdated Show resolved Hide resolved
tests/fixtures/hypothesis_configuration.py Outdated Show resolved Hide resolved
Edx learning event modeling automation moved this from Review in progress to Reviewer approved Nov 15, 2022
@quitterie-lcs
Copy link
Member Author

@SergioSim even if you have already approved it, I made then modification you suggested. For the pydantic model configuration, I would suggest to keep this in this PR and modify in the future. The problem is a more global one, not only this field should have the additional extensions to be accepted. WDYT?

@SergioSim
Copy link
Collaborator

@SergioSim even if you have already approved it, I made then modification you suggested. For the pydantic model configuration, I would suggest to keep this in this PR and modify in the future. The problem is a more global one, not only this field should have the additional extensions to be accepted. WDYT?

Thanks a lot @quitterie-lcs ) Good Idea, let's discuss/resolve the optional extensions suggestion in a separate PR)
LGTM)

edX video events can be converted to xAPI for most of them. The
interaction events can still not be converted.
When statements and events fields have to be tested for the edx models,
two separate files are created for statements and events fields tests
respectively.
`unhashable-member` pylint warning has to be disabled for some parts of
the code.
@quitterie-lcs quitterie-lcs merged commit 71c58f8 into master Nov 17, 2022
Edx learning event modeling automation moved this from Reviewer approved to Done Nov 17, 2022
@quitterie-lcs quitterie-lcs deleted the add-edx-xapi-video-converter branch November 17, 2022 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants