Skip to content

Commit

Permalink
Merge pull request #289 from edx/ashultz0/video-hack
Browse files Browse the repository at this point in the history
feat: trigger summary block on any video, remove content pointer
  • Loading branch information
ashultz0 authored May 9, 2023
2 parents 7758e0b + a9f0bd5 commit 5491d4d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Unreleased
~~~~~~~~~~
*

[1.2.0] - 2023-05-08
~~~~~~~~~~~~~~~~~~~~

* Update summary hook to trigger on videos
* Remove text selection data key from summary hook html

[1.1.4] - 2023-04-14
~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion edx_arch_experiments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
A plugin to include applications under development by the architecture team at 2U.
"""

__version__ = '1.1.4'
__version__ = '1.2.0'
9 changes: 5 additions & 4 deletions edx_arch_experiments/summaryhook_aside/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<div summary-launch>
<div id="launch-summary-button"
data-url-api="{{data_url_api}}"
data-text-identifier="{{data_text_identifier}}"
data-course-id="{{data_course_id}}"
data-content-id="{{data_content_id}}"
>
Expand All @@ -37,13 +36,16 @@ def _children_have_summarizable_content(block):
"""
children = block.get_children()
for child in children:
category = getattr(child, 'category', None)
if (
getattr(child, 'category', None) == 'html'
category == 'html'
and hasattr(child, 'get_html')
and len(child.get_html()) > settings.SUMMARY_HOOK_MIN_SIZE
):
return True

# we will eventually require there to be transcripts available to trigger but not yet
if category == 'video':
return True
return False


Expand All @@ -66,7 +68,6 @@ def student_view_aside(self, block, context=None): # pylint: disable=unused-arg
_render_summary(
{
'data_url_api': settings.SUMMARY_HOOK_HOST,
'data_text_identifier': '.xblock-student_view-html',
'data_course_id': block.scope_ids.usage_id.course_key,
'data_content_id': block.scope_ids.usage_id,
'js_url': settings.SUMMARY_HOOK_HOST + settings.SUMMARY_HOOK_JS_PATH,
Expand Down

0 comments on commit 5491d4d

Please sign in to comment.