Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
37ce4676
Commit
37ce4676
authored
7 years ago
by
John Hensley
Committed by
J. Cliff Dyer
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added completion mode to discussion XBlock
parent
0a65a2ff
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/lib/xblock_builtin/xblock_discussion/xblock_discussion/__init__.py
+4
-0
4 additions, 0 deletions
...k_builtin/xblock_discussion/xblock_discussion/__init__.py
openedx/tests/completion_integration/test_handlers.py
+10
-0
10 additions, 0 deletions
openedx/tests/completion_integration/test_handlers.py
with
14 additions
and
0 deletions
openedx/core/lib/xblock_builtin/xblock_discussion/xblock_discussion/__init__.py
+
4
−
0
View file @
37ce4676
...
...
@@ -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
"
),
...
...
This diff is collapsed.
Click to expand it.
openedx/tests/completion_integration/test_handlers.py
+
10
−
0
View file @
37ce4676
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment