Skip to content

Commit

Permalink
[BB-2120] Create excluded HTML5 block (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Agrendalath committed Feb 13, 2020
1 parent 1ac7787 commit cb2e533
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion html_xblock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""HTML XBlock module"""
from .html import HTML5XBlock
from .html import ExcludedHTML5XBlock, HTML5XBlock
16 changes: 16 additions & 0 deletions html_xblock/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging

import pkg_resources
from xblock.completable import XBlockCompletionMode
from xblock.core import XBlock
from xblock.fields import Boolean, Scope, String
from xblock.fragment import Fragment
Expand Down Expand Up @@ -255,3 +256,18 @@ def get_editable_fields(self):
fields.append(field_info)

return fields


class ExcludedHTML5XBlock(HTML5XBlock):
"""
This XBlock is excluded from the completion calculations.
"""

display_name = String(
display_name=_('Display Name'),
help=_('The display name for this component.'),
scope=Scope.settings,
default=_('Exclusion')
)
has_custom_completion = True
completion_mode = XBlockCompletionMode.EXCLUDED
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def package_data(pkg, roots):

setup(
name='html-xblock',
version='0.1.1',
version='0.1.2',
description='HTML XBlock will help creating and using a secure and easy-to-use HTML blocks',
license='AGPL v3',
packages=[
Expand All @@ -36,6 +36,7 @@ def package_data(pkg, roots):
entry_points={
'xblock.v1': [
'html5 = html_xblock:HTML5XBlock',
'excluded_html5 = html_xblock:ExcludedHTML5XBlock',
]
},
package_data=package_data("html_xblock", ["static", "public"]),
Expand Down

0 comments on commit cb2e533

Please sign in to comment.