Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
ba7eaa1c
Commit
ba7eaa1c
authored
Jan 17, 2015
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests.
TNL-708.
parent
4cd55f53
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
144 additions
and
71 deletions
+144
-71
openassessment/xblock/test/data/example_based_assessment.xml
+8
-2
openassessment/xblock/test/data/example_based_only.xml
+8
-2
openassessment/xblock/test/data/feedback_only_criterion_ai.xml
+8
-2
openassessment/xblock/test/data/feedback_only_criterion_grade.xml
+8
-2
openassessment/xblock/test/data/feedback_only_criterion_peer.xml
+8
-2
openassessment/xblock/test/data/feedback_only_criterion_self.xml
+8
-2
openassessment/xblock/test/data/feedback_only_criterion_student_training.xml
+8
-2
openassessment/xblock/test/data/feedback_per_criterion.xml
+8
-5
openassessment/xblock/test/data/grade_incomplete_scenario.xml
+8
-4
openassessment/xblock/test/data/grade_scenario.xml
+8
-5
openassessment/xblock/test/data/grade_scenario_ai_only.xml
+8
-5
openassessment/xblock/test/data/grade_scenario_self_only.xml
+8
-5
openassessment/xblock/test/data/grade_waiting_scenario.xml
+8
-5
openassessment/xblock/test/data/save_responses.json
+6
-3
openassessment/xblock/test/data/save_scenario.xml
+8
-4
openassessment/xblock/test/test_ai_grade.py
+1
-1
openassessment/xblock/test/test_grade.py
+2
-3
openassessment/xblock/test/test_openassessment.py
+4
-7
openassessment/xblock/test/test_save_response.py
+12
-10
openassessment/xblock/test/test_submission.py
+7
-0
No files found.
openassessment/xblock/test/data/example_based_assessment.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Example-based assessment
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
Ideas
</name>
<prompt>
How good are the ideas?
</prompt>
...
...
openassessment/xblock/test/data/example_based_only.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Example-based assessment
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
Ideas
</name>
<prompt>
How good are the ideas?
</prompt>
...
...
openassessment/xblock/test/data/feedback_only_criterion_ai.xml
View file @
ba7eaa1c
<openassessment>
<title>
Feedback only criterion
</title>
<prompt>
Test prompt
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Test rubric prompt
</prompt>
<criterion>
<name>
vocabulary
</name>
<prompt>
How good is the vocabulary?
</prompt>
...
...
openassessment/xblock/test/data/feedback_only_criterion_grade.xml
View file @
ba7eaa1c
<openassessment>
<title>
Feedback only criterion
</title>
<prompt>
Test prompt
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Test rubric prompt
</prompt>
<criterion>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
...
...
openassessment/xblock/test/data/feedback_only_criterion_peer.xml
View file @
ba7eaa1c
<openassessment>
<title>
Feedback only criterion
</title>
<prompt>
Test prompt
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Test rubric prompt
</prompt>
<criterion>
<name>
vocabulary
</name>
<prompt>
How good is the vocabulary?
</prompt>
...
...
openassessment/xblock/test/data/feedback_only_criterion_self.xml
View file @
ba7eaa1c
<openassessment>
<title>
Feedback only criterion
</title>
<prompt>
Test prompt
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Test rubric prompt
</prompt>
<criterion>
<name>
vocabulary
</name>
<prompt>
How good is the vocabulary?
</prompt>
...
...
openassessment/xblock/test/data/feedback_only_criterion_student_training.xml
View file @
ba7eaa1c
<openassessment>
<title>
Feedback only criterion
</title>
<prompt>
Test prompt
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Test rubric prompt
</prompt>
<criterion>
<name>
vocabulary
</name>
<prompt>
How good is the vocabulary?
</prompt>
...
...
openassessment/xblock/test/data/feedback_per_criterion.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion
feedback=
"optional"
>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
...
...
openassessment/xblock/test/data/grade_incomplete_scenario.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
...
...
openassessment/xblock/test/data/grade_scenario.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
...
...
openassessment/xblock/test/data/grade_scenario_ai_only.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
...
...
openassessment/xblock/test/data/grade_scenario_self_only.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
...
...
openassessment/xblock/test/data/grade_waiting_scenario.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
...
...
openassessment/xblock/test/data/save_responses.json
View file @
ba7eaa1c
{
"empty"
:
[
""
],
"unicode"
:
[
"Ѕраѓтаиѕ! ГоиіБЂт, Щэ ↁіиэ іи Нэll!"
],
"empty"
:
[
[
""
],
[
""
]
],
"unicode"
:
[
[
"Ѕраѓтаиѕ! ГоиіБЂт, Щэ ↁіиэ іи Нэll!"
],
[
"Ѕраѓтаиѕ! ГоиіБЂт, Щэ ↁіиэ іи Нэll!"
]
],
"long"
:
[
"Lorem ipsum dolor sit amet,"
,
[
"Lorem ipsum dolor sit amet,"
],
[
"consectetur adipiscing elit. Etiam luctus dapibus ante, vel luctus nibh bibendum et."
,
"Praesent in commodo quam. Morbi lobortis at felis ac mollis."
,
"Maecenas placerat nisl sed imperdiet posuere."
,
...
...
@@ -50,5 +51,6 @@
"nascetur ridiculus mus. Mauris at dapibus mauris, sed pharetra tortor."
,
"Pellentesque purus sem, congue sed elementum non, pretium in mi. Cras cursus gravida commodo."
,
"Aenean eu massa rhoncus, faucibus tortor id, sollicitudin tortor."
]
]
}
\ No newline at end of file
openassessment/xblock/test/data/save_scenario.xml
View file @
ba7eaa1c
<openassessment>
<title>
Open Assessment Test
</title>
<prompt>
Given the state of the world today, what do you think should be done to
combat poverty? Please answer in a short essay of 200-300 words.
</prompt>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty?
</description>
</prompt>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat pollution?
</description>
</prompt>
</prompts>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
...
...
openassessment/xblock/test/test_ai_grade.py
View file @
ba7eaa1c
...
...
@@ -13,7 +13,7 @@ class AIAssessmentIntegrationTest(XBlockHandlerTestCase):
"""
Integration test for example-based assessment (AI).
"""
SUBMISSION
=
json
.
dumps
({
'submission'
:
'This is a submission!'
})
SUBMISSION
=
json
.
dumps
({
'submission'
:
(
'This is submission part 1!'
,
'This is submission part 2!'
)
})
AI_ALGORITHMS
=
{
'fake'
:
'openassessment.assessment.worker.algorithm.FakeAIAlgorithm'
}
...
...
openassessment/xblock/test/test_grade.py
View file @
ba7eaa1c
...
...
@@ -41,7 +41,7 @@ class TestGrade(XBlockHandlerTestCase):
},
]
SUBMISSION
=
u'ՇﻉรՇ รપ๒๓ٱรรٱѻก'
SUBMISSION
=
(
u'ՇﻉรՇ'
,
u'รપ๒๓ٱรรٱѻก'
)
STEPS
=
[
'peer'
,
'self'
]
...
...
@@ -148,10 +148,9 @@ class TestGrade(XBlockHandlerTestCase):
xblock
,
self
.
SUBMISSION
,
[],
[],
None
,
waiting_for_peer
=
True
)
resp
=
self
.
request
(
xblock
,
'render_grade'
,
json
.
dumps
(
dict
()))
# Verify that feedback from each scorer appears in the view
self
.
assertNotIn
(
u'єאςєɭɭєภՇ'
,
resp
.
decode
(
'utf-8'
))
self
.
assertIn
(
u'
Poor
'
,
resp
.
decode
(
'utf-8'
))
self
.
assertIn
(
u'
Good
'
,
resp
.
decode
(
'utf-8'
))
# Verify that the submission and peer steps show that we're graded
# This isn't strictly speaking part of the grade step rendering,
...
...
openassessment/xblock/test/test_openassessment.py
View file @
ba7eaa1c
...
...
@@ -48,13 +48,6 @@ class TestOpenAssessment(XBlockHandlerTestCase):
self
.
assertIsNotNone
(
grade_response
)
self
.
assertTrue
(
grade_response
.
body
.
find
(
"openassessment__grade"
))
@scenario
(
'data/line_breaks.xml'
)
def
test_prompt_line_breaks
(
self
,
xblock
):
# Verify that prompts with multiple lines retain line breaks.
xblock_fragment
=
self
.
runtime
.
render
(
xblock
,
"student_view"
)
expected_prompt
=
u"<p><br />Line 1</p><p>Line 2</p><p>Line 3<br /></p>"
self
.
assertIn
(
expected_prompt
,
xblock_fragment
.
body_html
())
@scenario
(
'data/empty_prompt.xml'
)
def
test_prompt_intentionally_empty
(
self
,
xblock
):
# Verify that prompts intentionally left empty don't create DOM elements
...
...
@@ -177,6 +170,10 @@ class TestOpenAssessment(XBlockHandlerTestCase):
{
'description'
:
(
u'Given the state of the world today, what do you think should be done to '
u'combat poverty? Please answer in a short essay of 200-300 words.'
)
},
{
'description'
:
(
u'Given the state of the world today, what do you think should be done to '
u'combat pollution?'
)
}
])
...
...
openassessment/xblock/test/test_save_response.py
View file @
ba7eaa1c
...
...
@@ -4,6 +4,8 @@ Test that the student can save a response.
"""
import
json
import
ddt
from
openassessment.xblock.data_conversion
import
prepare_submission_for_serialization
from
.base
import
XBlockHandlerTestCase
,
scenario
...
...
@@ -19,35 +21,35 @@ class SaveResponseTest(XBlockHandlerTestCase):
@scenario
(
'data/save_scenario.xml'
,
user_id
=
"Perleman"
)
def
test_save_response
(
self
,
xblock
,
data
):
# Save the response
submission
_text
=
" "
.
join
(
data
)
payload
=
json
.
dumps
({
'submission'
:
submission
_text
})
submission
=
[
" "
.
join
(
data
[
0
]),
" "
.
join
(
data
[
1
])]
payload
=
json
.
dumps
({
'submission'
:
submission
})
resp
=
self
.
request
(
xblock
,
'save_submission'
,
payload
,
response_format
=
"json"
)
self
.
assertTrue
(
resp
[
'success'
])
self
.
assertEqual
(
resp
[
'msg'
],
u''
)
# Reload the submission UI
resp
=
self
.
request
(
xblock
,
'render_submission'
,
json
.
dumps
({}))
self
.
assertIn
(
submission_text
,
resp
.
decode
(
'utf-8'
))
self
.
assertIn
(
submission
[
0
],
resp
.
decode
(
'utf-8'
))
self
.
assertIn
(
submission
[
1
],
resp
.
decode
(
'utf-8'
))
self
.
assertIn
(
'saved but not submitted'
,
resp
.
lower
())
@scenario
(
'data/save_scenario.xml'
,
user_id
=
"Valchek"
)
def
test_overwrite_saved_response
(
self
,
xblock
):
# XBlock has a saved response already
xblock
.
saved_response
=
(
u"THAT'ꙅ likɘ A 40-bɘgᴙɘɘ bAY."
xblock
.
saved_response
=
prepare_submission_for_serialization
([
u"THAT'ꙅ likɘ A 40-bɘgᴙɘɘ bAY."
,
u"Aiᴎ'T ᴎodobY goT ᴎoTHiᴎg To ꙅAY AdoUT A 40-bɘgᴙɘɘ bAY."
u"ꟻiꟻTY. dᴙiᴎg A ꙅmilɘ To YoUᴙ ꟻAↄɘ."
)
])
# Save another response
submission
_text
=
u"ГЂіи lіиэ ъэтшээи Ђэаvэи аиↁ Ђэѓэ."
payload
=
json
.
dumps
({
'submission'
:
submission
_text
})
submission
=
[
u"ГЂіи lіиэ ъэтшээи"
,
u"Ђэаvэи аиↁ Ђэѓэ."
]
payload
=
json
.
dumps
({
'submission'
:
submission
})
resp
=
self
.
request
(
xblock
,
'save_submission'
,
payload
,
response_format
=
"json"
)
self
.
assertTrue
(
resp
[
'success'
])
# Verify that the saved response was overwritten
self
.
assertEqual
(
xblock
.
saved_response
,
submission_text
)
self
.
assertEqual
(
xblock
.
saved_response
,
json
.
dumps
(
prepare_submission_for_serialization
(
submission
))
)
@scenario
(
'data/save_scenario.xml'
,
user_id
=
"Bubbles"
)
def
test_missing_submission_key
(
self
,
xblock
):
...
...
openassessment/xblock/test/test_submission.py
View file @
ba7eaa1c
...
...
@@ -90,6 +90,13 @@ class SubmissionTest(XBlockHandlerTestCase):
resp
=
self
.
request
(
xblock
,
'render_submission'
,
json
.
dumps
(
dict
()))
self
.
assertIn
(
"Incomplete"
,
resp
)
@scenario
(
'data/line_breaks.xml'
)
def
test_prompt_line_breaks
(
self
,
xblock
):
# Verify that prompts with multiple lines retain line breaks
resp
=
self
.
request
(
xblock
,
'render_submission'
,
json
.
dumps
(
dict
()))
expected_prompt
=
u"<p><br />Line 1</p><p>Line 2</p><p>Line 3<br /></p>"
self
.
assertIn
(
expected_prompt
,
resp
)
class
SubmissionRenderTest
(
XBlockHandlerTestCase
):
"""
...
...
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