{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/16569","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/16569/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/16569/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/16569/events","html_url":"https://github.com/edx/edx-platform/pull/16569","id":273960160,"number":16569,"title":"Define custom completion for VideoModule","user":{"login":"jcdyer","id":77486,"avatar_url":"https://avatars0.githubusercontent.com/u/77486?v=4","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2017-11-14T22:05:27Z","updated_at":"2017-12-19T13:04:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/16569","html_url":"https://github.com/edx/edx-platform/pull/16569","diff_url":"https://github.com/edx/edx-platform/pull/16569.diff","patch_url":"https://github.com/edx/edx-platform/pull/16569.patch"},"body":"Update the VideoModule to publish a completion event when the player\r\nreaches 95% complete, and submit a BlockCompletion when that event\r\noccurs.\r\n\r\n## Testing instructions\r\n\r\n1.  In the lms shell, remove all existing BlockCompletions for video blocks.\r\n    ```python\r\n    from lms.djangoapps.completion.models import BlockCompletion\r\n    BlockCompletion.objects.filter(block_type='video').delete()\r\n    ```\r\n2.  Sign in to the LMS and visit the demo course.\r\n3.  Navigate to \"Example Week 1: Getting Started > Lesson 1 - Getting Started > (Vertical 2) Working with Videos\".  Open the browser's development panel, and view network traffic.  \r\n4. Verify that when the video reach 4m 3s, a POST is sent to a URL for the block ending with \"publish_completion\", and receives a 200 response.  \r\n5.  Verify that a BlockCompletion now exists for the video block with completion value == 1.0.\r\n    ```python\r\n    from lms.djangoapps.completion.models import BlockCompletion\r\n    print(BlockCompletion.objects.filter(block_type='video', completion=1.0))\r\n    ```\r\n6.  Navigate to the next vertical: \"Videos on edX\".  This one uses more features (a custom start time and end-time).  Watch to the end of the video (or jump to a few seconds before the end of the video, and just watch the end). \r\n7.  Verify that a publish_completion POST is sent after 7m 17s (Start time is 5m 10s, end time is 7m 24s = 134s; 134 * .95 = 127.3s; 5m 10s + 127s = 7m 17s), and receives a 200 response.\r\n8.  Verify that a BlockCompletion object exists for this block as well.\r\n\r\n## Author concerns\r\n\r\nI'm rusty at Javascript, and entirely new to the video player.  I may not be doing things the right way. \r\n\r\n## Reviewers\r\n- [x] @pomegranited \r\n- [ ] @robrap \r\n\r\nFYI: @yro for video player expertise.\r\n\r\n## TODO:\r\n\r\n- [ ] Squash commits\r\n- [ ] Rebase PR against edx:master after cliff/complete-default-blocks merges ( #16234 )"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/352743108","html_url":"https://github.com/edx/edx-platform/pull/16569#issuecomment-352743108","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/16569","id":352743108,"user":{"login":"jcdyer","id":77486,"avatar_url":"https://avatars0.githubusercontent.com/u/77486?v=4","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},"created_at":"2017-12-19T13:04:41Z","updated_at":"2017-12-19T13:04:41Z","author_association":"CONTRIBUTOR","body":"There was an error (wher I hadn't changed completeAfterSeconds to xxxTime in the specfile, so I cleaned it up, and added some documentation.  In adding the documentation, I noticed that I was registering the destroy handler at the wrong time, so I updated that, too."}}
{"actor":{"display_login":"jcdyer"}}