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
709006f9
Commit
709006f9
authored
Mar 29, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fwd port fixes for popup heights
parent
18243ce2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
0 deletions
+51
-0
problem_builder/public/css/questionnaire.css
+2
-0
problem_builder/public/js/questionnaire.js
+1
-0
problem_builder/tests/integration/test_mcq.py
+35
-0
problem_builder/tests/integration/xml/mcq_with_fixed_height_tips.xml
+13
-0
No files found.
problem_builder/public/css/questionnaire.css
View file @
709006f9
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
opacity
:
0.9
;
opacity
:
0.9
;
padding
:
22px
10px
;
padding
:
22px
10px
;
width
:
300px
;
width
:
300px
;
min-height
:
40px
;
z-index
:
10000
;
}
}
.mentoring
.questionnaire
.choice-tips
.title
{
.mentoring
.questionnaire
.choice-tips
.title
{
...
...
problem_builder/public/js/questionnaire.js
View file @
709006f9
...
@@ -28,6 +28,7 @@ function MessageView(element, mentoring) {
...
@@ -28,6 +28,7 @@ function MessageView(element, mentoring) {
if
(
data
&&
data
.
height
)
{
if
(
data
&&
data
.
height
)
{
popupDOM
.
css
(
'height'
,
data
.
height
);
popupDOM
.
css
(
'height'
,
data
.
height
);
popupDOM
.
css
(
'maxHeight'
,
data
.
height
);
}
else
{
}
else
{
popupDOM
.
css
(
'height'
,
''
);
popupDOM
.
css
(
'height'
,
''
);
popupDOM
.
css
(
'maxHeight'
,
''
);
popupDOM
.
css
(
'maxHeight'
,
''
);
...
...
problem_builder/tests/integration/test_mcq.py
View file @
709006f9
...
@@ -261,6 +261,41 @@ class MCQBlockTest(MentoringBaseTest):
...
@@ -261,6 +261,41 @@ class MCQBlockTest(MentoringBaseTest):
self
.
assertIn
(
'Congratulations!'
,
messages
.
text
)
self
.
assertIn
(
'Congratulations!'
,
messages
.
text
)
def
_get_inner_height
(
self
,
elem
):
return
elem
.
size
[
'height'
]
-
\
int
(
elem
.
value_of_css_property
(
"padding-top"
)
.
replace
(
u'px'
,
u''
))
-
\
int
(
elem
.
value_of_css_property
(
"padding-bottom"
)
.
replace
(
u'px'
,
u''
))
@ddt.unpack
@ddt.data
(
(
'yes'
,
40
),
(
'maybenot'
,
60
),
(
'understand'
,
600
)
)
def
test_tip_height
(
self
,
choice_value
,
expected_height
):
mentoring
=
self
.
go_to_page
(
"Mcq With Fixed Height Tips"
)
choices_list
=
mentoring
.
find_element_by_css_selector
(
".choices-list"
)
submit
=
mentoring
.
find_element_by_css_selector
(
'.submit input.input-main'
)
choice_input_css_selector
=
".choice input[value={}]"
.
format
(
choice_value
)
choice_input
=
choices_list
.
find_element_by_css_selector
(
choice_input_css_selector
)
choice_wrapper
=
choice_input
.
find_element_by_xpath
(
"./ancestor::div[@class='choice']"
)
choice_input
.
click
()
self
.
wait_until_clickable
(
submit
)
submit
.
click
()
self
.
wait_until_disabled
(
submit
)
item_feedback_popup
=
choice_wrapper
.
find_element_by_css_selector
(
".choice-tips"
)
self
.
assertTrue
(
item_feedback_popup
.
is_displayed
())
feedback_height
=
self
.
_get_inner_height
(
item_feedback_popup
)
self
.
assertEqual
(
feedback_height
,
expected_height
)
choice_wrapper
.
find_element_by_css_selector
(
".choice-result"
)
.
click
()
item_feedback_popup
=
choice_wrapper
.
find_element_by_css_selector
(
".choice-tips"
)
item_feedback_height
=
self
.
_get_inner_height
(
item_feedback_popup
)
self
.
assertEqual
(
item_feedback_height
,
expected_height
)
@patch.object
(
MentoringBlock
,
'get_theme'
,
Mock
(
return_value
=
{
'package'
:
'problem_builder'
,
@patch.object
(
MentoringBlock
,
'get_theme'
,
Mock
(
return_value
=
{
'package'
:
'problem_builder'
,
'locations'
:
[
'public/themes/lms.css'
]}))
'locations'
:
[
'public/themes/lms.css'
]}))
...
...
problem_builder/tests/integration/xml/mcq_with_fixed_height_tips.xml
0 → 100644
View file @
709006f9
<vertical_demo>
<problem-builder
url_name=
"mcq_1"
enforce_dependency=
"false"
>
<pb-mcq
name=
"mcq_1_1"
question=
"Do you like this MCQ?"
correct_choices=
"yes"
>
<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-tip
values=
"yes"
height=
"10"
>
Great!
</pb-tip>
<!--should be no less than 40 -->
<pb-tip
values=
"maybenot"
height=
"60"
>
Ah, damn.
</pb-tip>
<pb-tip
values=
"understand"
height=
"600"
>
Really?
</pb-tip>
<!-- should override max-height -->
</pb-mcq>
</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