Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
6324eeee
Commit
6324eeee
authored
Oct 27, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add note about mysterious -15 in the code
parent
cc8f0a16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletions
+3
-1
common/lib/capa/capa/inputtypes.py
+2
-1
common/lib/capa/capa/tests/test_inputtypes.py
+1
-0
No files found.
common/lib/capa/capa/inputtypes.py
View file @
6324eeee
...
...
@@ -510,7 +510,8 @@ class ImageInput(InputTypeBase):
# if value is of the form [x,y] then parse it and send along coordinates of previous answer
m
=
re
.
match
(
'
\
[([0-9]+),([0-9]+)]'
,
self
.
value
.
strip
()
.
replace
(
' '
,
''
))
if
m
:
# TODO (vshnayder): why is there a "-15" here??
# Note: we subtract 15 to compensate for the size of the dot on the screen.
# (which supposedly has size 30).
(
self
.
gx
,
self
.
gy
)
=
[
int
(
x
)
-
15
for
x
in
m
.
groups
()]
else
:
(
self
.
gx
,
self
.
gy
)
=
(
0
,
0
)
...
...
common/lib/capa/capa/tests/test_inputtypes.py
View file @
6324eeee
...
...
@@ -400,6 +400,7 @@ class ImageInputTest(unittest.TestCase):
self
.
assertEqual
(
context
,
expected
)
def
test_with_value
(
self
):
# Check that compensating for the dot size works properly.
self
.
check
(
'[50,40]'
,
35
,
25
)
def
test_without_value
(
self
):
...
...
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