Commit 95151ad3 by Alexander Kryklia

tests updates for imageresponse

parent 896e9228
...@@ -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, 30]]"/> <imageinput src="/static/Physics801/Figures/Skier-conservation of energy.jpg" width="560" height="388" regions="[[10,10], [30,30], [10, 30], [30, 10]]"/>
<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>
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment