Skip to content
Snippets Groups Projects
Commit 37ce4676 authored by John Hensley's avatar John Hensley Committed by J. Cliff Dyer
Browse files

Added completion mode to discussion XBlock

parent 0a65a2ff
No related merge requests found
......@@ -8,6 +8,7 @@ import urllib
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.utils.translation import get_language_bidi
from xblock.completable import XBlockCompletionMode
from xblock.core import XBlock
from xblock.fields import Scope, String, UNIQUE_ID
from web_fragments.fragment import Fragment
......@@ -19,6 +20,7 @@ from openedx.core.lib.xblock_builtin import get_css_dependencies, get_js_depende
from xmodule.raw_module import RawDescriptor
from xmodule.xml_module import XmlParserMixin
log = logging.getLogger(__name__)
loader = ResourceLoader(__name__) # pylint: disable=invalid-name
......@@ -36,6 +38,8 @@ class DiscussionXBlock(XBlock, StudioEditableXBlockMixin, XmlParserMixin):
"""
Provides a discussion forum that is inline with other content in the courseware.
"""
completion_mode = XBlockCompletionMode.EXCLUDED
discussion_id = String(scope=Scope.settings, default=UNIQUE_ID)
display_name = String(
display_name=_("Display Name"),
......
......@@ -108,6 +108,16 @@ class ScorableCompletionHandlerTestCase(CompletionSetUpMixin, TestCase):
)
self.assertFalse(completion.exists())
def test_handler_skips_discussion_block(self):
discussion_block_key = self.course_key.make_usage_key(block_type='discussion', block_id='blue')
self.call_scorable_block_completion_handler(discussion_block_key)
completion = BlockCompletion.objects.filter(
user=self.user,
course_key=self.course_key,
block_key=discussion_block_key,
)
self.assertFalse(completion.exists())
def test_signal_calls_handler(self):
with patch('completion.handlers.scorable_block_completion') as mock_handler:
PROBLEM_WEIGHTED_SCORE_CHANGED.send_robust(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment