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
63a0d9ee
Commit
63a0d9ee
authored
Oct 28, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure tooltips for plot points work across different browsers.
parent
9f967274
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
problem_builder/public/js/plot.js
+1
-1
problem_builder/tests/integration/test_step_builder.py
+13
-13
No files found.
problem_builder/public/js/plot.js
View file @
63a0d9ee
...
...
@@ -125,7 +125,7 @@ function PlotBlock(runtime, element) {
.
enter
()
.
append
(
"circle"
)
.
attr
(
"class"
,
klass
)
.
attr
(
"
title
"
,
function
(
d
)
{
.
attr
(
"
data-tooltip
"
,
function
(
d
)
{
return
d
[
0
]
+
": "
+
d
[
1
]
+
", "
+
d
[
2
];
})
.
attr
(
"cx"
,
function
(
d
)
{
...
...
problem_builder/tests/integration/test_step_builder.py
View file @
63a0d9ee
...
...
@@ -763,11 +763,11 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
point
.
value_of_css_property
(
'fill'
)
for
point
in
points
]
self
.
assertTrue
(
all
(
pc
==
overlay
[
'point_color'
]
for
pc
in
point_colors
))
# Check
point title
s
point_title
s
=
set
([
point
.
get_attribute
(
'
title
'
)
for
point
in
points
# Check
tooltips for point
s
tooltip
s
=
set
([
point
.
get_attribute
(
'
data-tooltip
'
)
for
point
in
points
])
self
.
assertEquals
(
point_titles
,
set
(
overlay
[
'title
s'
]))
self
.
assertEquals
(
tooltips
,
set
(
overlay
[
'tooltip
s'
]))
# Check positions
point_positions
=
set
([
(
point
.
get_attribute
(
'cx'
),
point
.
get_attribute
(
'cy'
))
for
point
in
points
...
...
@@ -804,7 +804,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.claim-default'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
ORANGE
,
't
itle
s'
:
[
'2 + 2 = 5: 1, 5'
,
'The answer to everything is 42: 5, 1'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 1, 5'
,
'The answer to everything is 42: 5, 1'
],
'positions'
:
[
(
'4'
,
'380'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'20'
,
'396'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -814,7 +814,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.claim-average'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
PURPLE
,
't
itle
s'
:
[
'2 + 2 = 5: 1, 5'
,
'The answer to everything is 42: 5, 1'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 1, 5'
,
'The answer to everything is 42: 5, 1'
],
'positions'
:
[
(
'4'
,
'380'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'20'
,
'396'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -881,7 +881,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.claim-default'
,
'num_points'
:
2
,
'point_color'
:
'rgb(255, 165, 0)'
,
# orange
't
itle
s'
:
[
'2 + 2 = 5: 17, 83'
,
'The answer to everything is 42: 5, 1'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 17, 83'
,
'The answer to everything is 42: 5, 1'
],
'positions'
:
[
(
'68'
,
'68'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'20'
,
'396'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -891,7 +891,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.claim-average'
,
'num_points'
:
2
,
'point_color'
:
'rgb(128, 0, 128)'
,
# purple
't
itle
s'
:
[
'2 + 2 = 5: 17, 83'
,
'The answer to everything is 42: 5, 1'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 17, 83'
,
'The answer to everything is 42: 5, 1'
],
'positions'
:
[
(
'68'
,
'68'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'20'
,
'396'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -993,7 +993,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.claim-default'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
ORANGE
,
't
itle
s'
:
[
'2 + 2 = 5: 1, 5'
,
'The answer to everything is 42: 5, 1'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 1, 5'
,
'The answer to everything is 42: 5, 1'
],
'positions'
:
[
(
'4'
,
'380'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'20'
,
'396'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -1003,7 +1003,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.plot-overlay.plot-overlay-0'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
CORAL
,
't
itle
s'
:
[
'2 + 2 = 5: 2, 3'
,
'The answer to everything is 42: 4, 2'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 2, 3'
,
'The answer to everything is 42: 4, 2'
],
'positions'
:
[
(
'8'
,
'388'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'16'
,
'392'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -1017,7 +1017,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.plot-overlay.plot-overlay-1'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
CORNFLOWERBLUE
,
't
itle
s'
:
[
'2 + 2 = 5: 4, 4'
,
'The answer to everything is 42: 1, 5'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 4, 4'
,
'The answer to everything is 42: 1, 5'
],
'positions'
:
[
(
'16'
,
'384'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'4'
,
'380'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -1031,7 +1031,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.plot-overlay.plot-overlay-2'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
OLIVE
,
't
itle
s'
:
[
'2 + 2 = 5: 3, 5'
,
'The answer to everything is 42: 2, 4'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 3, 5'
,
'The answer to everything is 42: 2, 4'
],
'positions'
:
[
(
'12'
,
'380'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'8'
,
'384'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
@@ -1045,7 +1045,7 @@ class StepBuilderTest(MentoringAssessmentBaseTest, MultipleSliderBlocksTestMixin
'selector'
:
'.plot-overlay.plot-overlay-3'
,
'num_points'
:
2
,
'point_color'
:
PointColors
.
CRIMSON
,
't
itle
s'
:
[
'2 + 2 = 5: 1, 2'
,
'The answer to everything is 42: 3, 3'
],
't
ooltip
s'
:
[
'2 + 2 = 5: 1, 2'
,
'The answer to everything is 42: 3, 3'
],
'positions'
:
[
(
'4'
,
'392'
),
# Values computed according to xScale and yScale (cf. plot.js)
(
'12'
,
'388'
),
# Values computed according to xScale and yScale (cf. plot.js)
...
...
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