-
Notifications
You must be signed in to change notification settings - Fork 21
Add helper methods for complete-on-view to Service #19
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
Add helper methods for complete-on-view to Service #19
Conversation
bea8f71 to
af8da47
Compare
jcdyer
left a comment
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.
Only nits. Consider resolving them, but otherwise this is ready for upstream review.
completion/tests/test_services.py
Outdated
| def test_blocks_to_mark_complete_on_view(self): | ||
|
|
||
| block_1 = XBlock(Mock(), scope_ids=Mock(spec=ScopeIds)) | ||
| block_1.location = UsageKey.from_string("i4x://edX/100/a/1").replace(course_key=self.course_key) |
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.
Is this use of replace the same as usage_key.map_into_course(course_key)?
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 suspect so. I just copied this pattern from line 37 above.
completion/tests/test_services.py
Outdated
| block_2.location = UsageKey.from_string("i4x://edX/100/a/2").replace(course_key=self.course_key) | ||
| block_3 = XBlock(Mock(), scope_ids=Mock(spec=ScopeIds)) | ||
| block_3.location = UsageKey.from_string("i4x://edX/100/a/3").replace(course_key=self.course_key) | ||
| block_3.completion_mode = XBlockCompletionMode.AGGREGATOR |
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.
Nit: Consider giving these blocks descriptive names (E.g., s/block_3/aggregator_block/).
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.
Updated names.
|
|
||
| @ddt.data(1, 1000, 0) | ||
| def test_get_completion_by_viewing_delay_ms(self, delay): | ||
| def test_get_complete_on_view_delay_ms(self, delay): |
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.
Have you made sure you caught all uses of this method in edx-platform?
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.
Yup. They are used in two views and there is is bokchoy coverage for both.
85dfcd5 to
4987159
Compare
iloveagent57
left a comment
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.
👍
|
@iloveagent57 Can you please merge this as well? And if I create a tag, will that push a release to PyPi? |
|
@symbolist yup, merging now. And yes, if you create a tag (I usually just use the github release feature) it will kick off a travis build that will push a new release to PyPI. |
|
@iloveagent57 Thanks! Looks like I do not have access to either push a tag or create a release. Can you please take care of this? |
|
@symbolist yup, will do (I'll also make a note of this for future PRs). |
|
https://pypi.org/project/edx-completion/ is now at the latest version, 0.1.7 |
|
@iloveagent57 Thanks! |
|
Although this pull request is already merged, I've created OSPR-5543 so that we can track it in Jira. There is nothing you have to do. No action is needed from your side. Thanks again for your contribution. |
Description: Moving some helpers method from https://github.com/edx/edx-platform/pull/18273 to the Completion Service.
JIRA: Link to JIRA ticket
Dependencies: None
Installation instructions: N/A
Testing instructions: N/A
Reviewers:
Merge checklist:
Post merge:
finished.