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
95151ad3
Commit
95151ad3
authored
Nov 27, 2012
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests updates for imageresponse
parent
896e9228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
common/lib/capa/capa/tests/test_files/imageresponse.xml
+2
-2
common/lib/capa/capa/tests/test_responsetypes.py
+10
-8
No files found.
common/lib/capa/capa/tests/test_files/imageresponse.xml
View file @
95151ad3
...
@@ -22,14 +22,14 @@ Hello</p></text>
...
@@ -22,14 +22,14 @@ Hello</p></text>
<imageresponse
max=
"1"
loncapaid=
"12"
>
<imageresponse
max=
"1"
loncapaid=
"12"
>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
rectangle=
"(490,11)-(556,98)"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
rectangle=
"(490,11)-(556,98)"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
rectangle=
"(490,11)-(556,98)"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
rectangle=
"(490,11)-(556,98)"
regions=
'[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]'
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"
/>
<text>
Click on either of the two positions as discussed previously.
</text>
<text>
Click on either of the two positions as discussed previously.
</text>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[[10,10], [20,10], [20, 30]]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[[10,10], [20,10], [20, 30]]]"
/>
<text>
Click on either of the two positions as discussed previously.
</text>
<text>
Click on either of the two positions as discussed previously.
</text>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[10,10], [30,30], [15, 15]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[10,10], [30,30], [15, 15]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[10,10], [30,30], [
30, 15], [15, 3
0]]"
/>
<imageinput
src=
"/static/Physics801/Figures/Skier-conservation of energy.jpg"
width=
"560"
height=
"388"
regions=
"[[10,10], [30,30], [
10, 30], [30, 1
0]]"
/>
<text>
Click on either of the two positions as discussed previously.
</text>
<text>
Click on either of the two positions as discussed previously.
</text>
<hintgroup
showoncorrect=
"no"
>
<hintgroup
showoncorrect=
"no"
>
<text><p>
Use conservation of energy.
</p></text>
<text><p>
Use conservation of energy.
</p></text>
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
95151ad3
...
@@ -54,18 +54,20 @@ class ImageResponseTest(unittest.TestCase):
...
@@ -54,18 +54,20 @@ class ImageResponseTest(unittest.TestCase):
test_lcp
=
lcp
.
LoncapaProblem
(
open
(
imageresponse_file
)
.
read
(),
'1'
,
system
=
test_system
)
test_lcp
=
lcp
.
LoncapaProblem
(
open
(
imageresponse_file
)
.
read
(),
'1'
,
system
=
test_system
)
# testing regions only
# testing regions only
correct_answers
=
{
correct_answers
=
{
#regions
#regions
'1_2_1'
:
'(490,11)-(556,98)'
,
'1_2_1'
:
'(490,11)-(556,98)'
,
'1_2_2'
:
'(242,202)-(296,276)'
,
'1_2_2'
:
'(242,202)-(296,276)'
,
'1_2_3'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_2_3'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_2_4'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_2_4'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_2_5'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_2_5'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
#testing regions and rectanges
#testing regions and rectanges
'1_3_1'
:
'(490,11)-(556,98)'
,
'1_3_1'
:
'rectangle="(490,11)-(556,98)" regions="[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"'
,
'1_3_2'
:
'(242,202)-(296,276)'
,
'1_3_2'
:
'rectangle="(490,11)-(556,98)" regions="[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"'
,
'1_3_3'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_3_3'
:
'regions="[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"'
,
'1_3_4'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_3_4'
:
'regions="[[[10,10], [20,10], [20, 30]], [[100,100], [120,100], [120,150]]]"'
,
'1_3_5'
:
'(490,11)-(556,98);(242,202)-(296,276)'
,
'1_3_5'
:
'regions="[[[10,10], [20,10], [20, 30]]]"'
,
'1_3_6'
:
'regions="[[10,10], [30,30], [15, 15]]"'
,
'1_3_7'
:
'regions="[[10,10], [30,30], [10, 30], [30, 10]]"'
,
}
}
test_answers
=
{
'1_2_1'
:
'[500,20]'
,
test_answers
=
{
'1_2_1'
:
'[500,20]'
,
'1_2_2'
:
'[250,300]'
,
'1_2_2'
:
'[250,300]'
,
...
@@ -79,7 +81,7 @@ class ImageResponseTest(unittest.TestCase):
...
@@ -79,7 +81,7 @@ class ImageResponseTest(unittest.TestCase):
'1_3_4'
:
'[115,115]'
,
'1_3_4'
:
'[115,115]'
,
'1_3_5'
:
'[15,15]'
,
'1_3_5'
:
'[15,15]'
,
'1_3_6'
:
'[20,20]'
,
'1_3_6'
:
'[20,20]'
,
'1_3_7'
:
'[20,
20
]'
,
'1_3_7'
:
'[20,
15
]'
,
}
}
# regions
# regions
...
...
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