Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
problem-builder
Commits
94a88c57
Commit
94a88c57
authored
Jul 27, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Unhelpful tooltips shown in sequential accordion in the LMS
parent
21fc19e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
problem_builder/mentoring.py
+8
-2
problem_builder/tests/unit/test_mentoring.py
+16
-0
No files found.
problem_builder/mentoring.py
View file @
94a88c57
...
...
@@ -759,10 +759,16 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
"""
By default, each Sequential block in a course ("Subsection" in Studio parlance) will
display the display_name of each descendant in a tooltip above the content. We don't
want that - we only want to display
the mentoring block as a whole as one item
.
want that - we only want to display
one title for this mentoring block as a whole
.
Otherwise things like "Choice (yes) (Correct)" will appear in the tooltip.
If this block has no title set, don't display any title. Then, if this is the only block
in the unit, the unit's title will be used. (Why isn't it always just used?)
"""
return
[
self
.
display_name
]
has_explicitly_set_title
=
self
.
fields
[
'display_name'
]
.
is_set_on
(
self
)
if
has_explicitly_set_title
:
return
[
self
.
display_name
]
return
[]
@staticmethod
def
workbench_scenarios
():
...
...
problem_builder/tests/unit/test_mentoring.py
View file @
94a88c57
...
...
@@ -6,6 +6,7 @@ from problem_builder import MentoringBlock
from
problem_builder.mentoring
import
_default_theme_config
@ddt.ddt
class
TestMentoringBlock
(
unittest
.
TestCase
):
def
test_sends_progress_event_when_rendered_student_view_with_display_submit_false
(
self
):
block
=
MentoringBlock
(
MagicMock
(),
DictFieldData
({
...
...
@@ -31,6 +32,21 @@ class TestMentoringBlock(unittest.TestCase):
self
.
assertFalse
(
patched_runtime
.
publish
.
called
)
@ddt.data
(
True
,
False
)
def
test_get_content_titles
(
self
,
has_title_set
):
"""
Test that we don't send a title to the LMS for the sequential's tooltips when no title
is set
"""
if
has_title_set
:
data
=
{
'display_name'
:
'Custom Title'
}
expected
=
[
'Custom Title'
]
else
:
data
=
{}
expected
=
[]
block
=
MentoringBlock
(
MagicMock
(),
DictFieldData
(
data
),
Mock
())
self
.
assertEqual
(
block
.
get_content_titles
(),
expected
)
@ddt.ddt
class
TestMentoringBlockTheming
(
unittest
.
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment