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
83cbc5b9
Commit
83cbc5b9
authored
Mar 01, 2016
by
Jacek Bzdak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unneccessary code
parent
e0fb68ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
problem_builder/tests/integration/test_mentoring.py
+18
-15
No files found.
problem_builder/tests/integration/test_mentoring.py
View file @
83cbc5b9
...
...
@@ -263,10 +263,10 @@ class ProblemBuilderQuestionnaireBlockTest(ProblemBuilderBaseTest):
self
.
click_choice
(
mrq
,
"Its elegance"
)
self
.
assertTrue
(
submit
.
is_enabled
())
def
test_does_not_persist_mcq_feedback_on_page_reload_if_disabled
(
self
,
scenario
):
def
test_does_not_persist_mcq_feedback_on_page_reload_if_disabled
(
self
):
with
mock
.
patch
(
"problem_builder.mentoring.MentoringBlock.get_options"
)
as
patched_options
:
patched_options
.
return_value
=
{
'pb_mcq_hide_previous_answer'
:
True
}
mentoring
=
self
.
load_scenario
(
scenario
)
mentoring
=
self
.
load_scenario
(
"feedback_persistence.xml"
)
answer
,
mcq
,
mrq
,
rating
=
self
.
_get_controls
(
mentoring
)
messages
=
self
.
_get_messages_element
(
mentoring
)
...
...
@@ -376,19 +376,22 @@ class ProblemBuilderQuestionnaireBlockTest(ProblemBuilderBaseTest):
@ddt.data
(
# MCQ with tips
(
"feedback_persistence_mcq_tips.xml"
,
'.choice-tips'
),
# Like
feedback_persistenc
e but instead of tips in MCQ
# Like
the abov
e but instead of tips in MCQ
# has a question level feedback. This feedback should also be suppressed.
(
"feedback_persistence_mcq_no_tips.xml"
,
'.feedback'
)
)
def
testFeedbackPersistenceTips
(
self
,
scenario
,
tips_selector
):
mentoring
=
self
.
load_scenario
(
scenario
)
mcq
=
self
.
_get_xblock
(
mentoring
,
"feedback_mcq_2"
)
messages
=
mentoring
.
find_element_by_css_selector
(
tips_selector
)
self
.
assertFalse
(
messages
.
is_displayed
())
self
.
click_choice
(
mcq
,
"Yes"
)
self
.
click_submit
(
mentoring
)
self
.
assertTrue
(
messages
.
is_displayed
())
self
.
reload_student_view
()
mentoring
=
self
.
load_scenario
(
scenario
)
messages
=
mentoring
.
find_element_by_css_selector
(
tips_selector
)
self
.
assertFalse
(
messages
.
is_displayed
())
def
test_feedback_persistence_tips
(
self
,
scenario
,
tips_selector
):
# Tests whether feedback is hidden on reload.
with
mock
.
patch
(
"problem_builder.mentoring.MentoringBlock.get_options"
)
as
patched_options
:
patched_options
.
return_value
=
{
'pb_mcq_hide_previous_answer'
:
True
}
mentoring
=
self
.
load_scenario
(
scenario
)
mcq
=
self
.
_get_xblock
(
mentoring
,
"feedback_mcq_2"
)
messages
=
mentoring
.
find_element_by_css_selector
(
tips_selector
)
self
.
assertFalse
(
messages
.
is_displayed
())
self
.
click_choice
(
mcq
,
"Yes"
)
self
.
click_submit
(
mentoring
)
self
.
assertTrue
(
messages
.
is_displayed
())
self
.
reload_student_view
()
mentoring
=
self
.
load_scenario
(
scenario
)
messages
=
mentoring
.
find_element_by_css_selector
(
tips_selector
)
self
.
assertFalse
(
messages
.
is_displayed
())
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