-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: receive XBlock visibility from the Learning MFE #35491
fix: receive XBlock visibility from the Learning MFE #35491
Conversation
Thanks for the pull request, @Agrendalath! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
35b2276
to
dbd60f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- ✅ I tested this on tutor devstack and it is making those publish calls.
- ✅ I read through the code
- ❌ I checked for accessibility issues
- ❌ Includes documentation
- ❌ I made sure any change in configuration variables is reflected in the corresponding client's
configuration-secure
repository.
dbd60f6
to
52df0f9
Compare
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
Currently, the LMS retrieves the viewport information with
getBoundingClientRect
. However, it doesn't work correctly when the XBlocks are rendered in an iframe because the iframe is automatically resized to its full height.This solves the described problem by sending the visibility status from the Learning MFE to the LMS.
Testing instructions:
COMPLETION_BY_VIEWING_DELAY_MS = 1000
inlms/envs/private.py
for easier testing. The default value is5000
.publish_completion
topublish_completions
inlms/static/completion/js/CompletionOnViewService.js
for easier testing. Otherwise, you will need to create a new XBlock for the next check or manually remove theBlockCompletion
object from the DB to get the API call re-triggered the next time you view it.publish_completion
request is called in both the Learning MFE and the Preview (to check for regressions).publish_completion
request is called when you scroll down to the bottom of each of these blocks (in the Learning MFE and Preview).Deadline
"None"
Other information
Ported from open-craft#662.
Private-ref: BB-8826