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.
Only nits. Consider resolving them, but otherwise this is ready for upstream review.
| 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.
Is this use of replace the same as usage_key.map_into_course(course_key)?
There was a problem hiding this comment.
I suspect so. I just copied this pattern from line 37 above.
| 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.
Nit: Consider giving these blocks descriptive names (E.g., s/block_3/aggregator_block/).
|
|
||
| @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.
Have you made sure you caught all uses of this method in edx-platform?
There was a problem hiding this comment.
Yup. They are used in two views and there is is bokchoy coverage for both.
85dfcd5 to
4987159
Compare
|
@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.