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
cc5c2727
Commit
cc5c2727
authored
Mar 01, 2016
by
Jacek Bzdak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for suppressing question level feedback
parent
e612181c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
problem_builder/tests/integration/base_test.py
+1
-1
problem_builder/tests/integration/test_mentoring.py
+10
-2
problem_builder/tests/integration/xml_templates/feedback_persistence_no_tips_in_mcq.xml
+34
-0
No files found.
problem_builder/tests/integration/base_test.py
View file @
cc5c2727
...
...
@@ -63,7 +63,7 @@ class PopupCheckMixin(object):
self
.
assertFalse
(
item_feedback_popup
.
is_displayed
())
class
ProblemBuilderBaseTest
(
SeleniumXBlockTest
,
PopupCheckMixin
):
class
ProblemBuilderBaseTest
(
SeleniumXBlockTest
,
PopupCheckMixin
,
ScrollToMixin
):
"""
The new base class for integration tests.
Scenarios can be loaded and edited on the fly.
...
...
problem_builder/tests/integration/test_mentoring.py
View file @
cc5c2727
...
...
@@ -249,10 +249,18 @@ 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
):
@ddt.unpack
@ddt.data
(
# Standard scenario
(
"feedback_persistence.xml"
,
),
# Like feedback_persistence but instead of tips in MCQ
# has a question level feedback. This feedback should also be suppressed.
(
"feedback_persistence_no_tips_in_mcq.xml"
,
)
)
def
test_does_not_persist_mcq_feedback_on_page_reload_if_disabled
(
self
,
scenario
):
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
(
"feedback_persistence.xml"
)
mentoring
=
self
.
load_scenario
(
scenario
)
answer
,
mcq
,
mrq
,
rating
=
self
.
_get_controls
(
mentoring
)
messages
=
self
.
_get_messages_element
(
mentoring
)
...
...
problem_builder/tests/integration/xml_templates/feedback_persistence_no_tips_in_mcq.xml
0 → 100644
View file @
cc5c2727
<vertical_demo>
<problem-builder
url_name=
"feedback"
enforce_dependency=
"false"
>
<pb-answer
name=
"feedback_answer_1"
/>
<pb-mcq
name=
"feedback_mcq_2"
question=
"Do you like this MCQ?"
correct_choices=
'["yes"]'
message=
"Question level Feedback"
>
<pb-choice
value=
"yes"
>
Yes
</pb-choice>
<pb-choice
value=
"maybenot"
>
Maybe not
</pb-choice>
<pb-choice
value=
"understand"
>
I don't understand
</pb-choice>
</pb-mcq>
<pb-mrq
name=
"feedback_mrq_3"
question=
"What do you like in this MRQ?"
required_choices=
'["elegance","gracefulness","beauty"]'
>
<pb-choice
value=
"elegance"
>
Its elegance
</pb-choice>
<pb-choice
value=
"beauty"
>
Its beauty
</pb-choice>
<pb-choice
value=
"gracefulness"
>
Its gracefulness
</pb-choice>
<pb-choice
value=
"bugs"
>
Its bugs
</pb-choice>
<pb-tip
values=
'["elegance"]'
>
This is something everyone has to like about this MRQ
</pb-tip>
<pb-tip
values=
'["beauty"]'
>
This is something everyone has to like about beauty
</pb-tip>
<pb-tip
values=
'["gracefulness"]'
>
This MRQ is indeed very graceful
</pb-tip>
<pb-tip
values=
'["bugs"]'
>
Nah, there aren't any!
</pb-tip>
</pb-mrq>
<pb-rating
name=
"feedback_rating_4"
low=
"Not good at all"
high=
"Extremely good"
question=
"How do you rate this MCQ?"
correct_choices=
'["4","5"]'
>
<pb-choice
value=
"notwant"
>
I don't want to rate it
</pb-choice>
<pb-tip
values=
'["4","5"]'
>
I love good grades.
</pb-tip>
<pb-tip
values=
'["1","2","3"]'
>
Will do better next time...
</pb-tip>
<pb-tip
values=
'["notwant"]'
>
Your loss!
</pb-tip>
</pb-rating>
<pb-message
type=
"completed"
>
All Good
</pb-message>
<pb-message
type=
"incomplete"
>
Not done yet
</pb-message>
</problem-builder>
</vertical_demo>
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