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
93ef7906
Commit
93ef7906
authored
Apr 24, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #298 from edx/will/peer-rendering-test-cleanup
Will/peer rendering test cleanup
parents
3ae16f20
00a6943f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
18 deletions
+56
-18
apps/openassessment/xblock/self_assessment_mixin.py
+0
-1
apps/openassessment/xblock/test/data/peer_closed_scenario.xml
+1
-1
apps/openassessment/xblock/test/data/peer_future_scenario.xml
+46
-0
apps/openassessment/xblock/test/test_peer.py
+0
-0
apps/openassessment/xblock/test/test_self.py
+9
-16
No files found.
apps/openassessment/xblock/self_assessment_mixin.py
View file @
93ef7906
...
...
@@ -92,7 +92,6 @@ class SelfAssessmentMixin(object):
Args:
data (dict): Must have the following keys:
submission_uuid (string): The unique identifier of the submission being assessed.
options_selected (dict): Dictionary mapping criterion names to option values.
Returns:
...
...
apps/openassessment/xblock/test/data/peer_closed_scenario.xml
View file @
93ef7906
...
...
@@ -40,7 +40,7 @@
</criterion>
</rubric>
<assessments>
<assessment
name=
"peer-assessment"
must_grade=
"
5"
must_be_graded_by=
"3
"
due=
"2000-01-01T00:00:00"
/>
<assessment
name=
"peer-assessment"
must_grade=
"
1"
must_be_graded_by=
"1
"
due=
"2000-01-01T00:00:00"
/>
<assessment
name=
"self-assessment"
/>
</assessments>
</openassessment>
apps/openassessment/xblock/test/data/peer_future_scenario.xml
0 → 100644
View file @
93ef7906
<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>
<rubric>
<prompt>
Read for conciseness, clarity of thought, and form.
</prompt>
<criterion>
<name>
𝓒𝓸𝓷𝓬𝓲𝓼𝓮
</name>
<prompt>
How concise is it?
</prompt>
<option
points=
"3"
>
<name>
ﻉซƈﻉɭɭﻉกՇ
</name>
<explanation>
Extremely concise
</explanation>
</option>
<option
points=
"2"
>
<name>
Ġööḋ
</name>
<explanation>
Concise
</explanation>
</option>
<option
points=
"1"
>
<name>
ק๏๏г
</name>
<explanation>
Wordy
</explanation>
</option>
</criterion>
<criterion>
<name>
Form
</name>
<prompt>
How well-formed is it?
</prompt>
<option
points=
"3"
>
<name>
Good
</name>
<explanation>
Good
</explanation>
</option>
<option
points=
"2"
>
<name>
Fair
</name>
<explanation>
Fair
</explanation>
</option>
<option
points=
"1"
>
<name>
Poor
</name>
<explanation>
Poor
</explanation>
</option>
</criterion>
</rubric>
<assessments>
<assessment
name=
"peer-assessment"
must_grade=
"5"
must_be_graded_by=
"3"
start=
"2999-01-01T00:00:00"
/>
<assessment
name=
"self-assessment"
/>
</assessments>
</openassessment>
apps/openassessment/xblock/test/test_peer.py
View file @
93ef7906
This diff is collapsed.
Click to expand it.
apps/openassessment/xblock/test/test_self.py
View file @
93ef7906
...
...
@@ -13,13 +13,15 @@ from .base import XBlockHandlerTestCase, scenario
class
TestSelfAssessment
(
XBlockHandlerTestCase
):
"""
Tests for the self-assessment XBlock handler.
"""
maxDiff
=
None
SUBMISSION
=
u'ՇﻉรՇ รપ๒๓ٱรรٱѻก'
ASSESSMENT
=
{
'submission_uuid'
:
None
,
'options_selected'
:
{
u'𝓒𝓸𝓷𝓬𝓲𝓼𝓮'
:
u'ﻉซƈﻉɭɭﻉกՇ'
,
u'Form'
:
u'Fair'
},
}
...
...
@@ -31,9 +33,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
self
.
assertTrue
(
resp
[
'success'
])
# Expect that a self-assessment was created
...
...
@@ -62,9 +62,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
with
mock
.
patch
(
'openassessment.xblock.workflow_mixin.workflow_api'
)
as
mock_api
:
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
# Verify that the workflow is updated when we submit a self-assessment
self
.
assertTrue
(
resp
[
'success'
])
...
...
@@ -77,7 +75,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
def
test_self_assess_workflow_error
(
self
,
xblock
):
# Create a submission for the student
student_item
=
xblock
.
get_student_item_dict
()
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
with
mock
.
patch
(
'openassessment.xblock.workflow_mixin.workflow_api'
)
as
mock_api
:
...
...
@@ -85,9 +83,7 @@ class TestSelfAssessment(XBlockHandlerTestCase):
mock_api
.
update_from_assessments
.
side_effect
=
workflow_api
.
AssessmentWorkflowError
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
# Verify that the we get an error response
self
.
assertFalse
(
resp
[
'success'
])
...
...
@@ -106,17 +102,14 @@ class TestSelfAssessment(XBlockHandlerTestCase):
def
test_self_assess_api_error
(
self
,
xblock
):
# Create a submission for the student
student_item
=
xblock
.
get_student_item_dict
()
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
# Submit a self-assessment
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
[
'submission_uuid'
]
=
submission
[
'uuid'
]
# Simulate an error and expect a failure response
with
mock
.
patch
(
'openassessment.xblock.self_assessment_mixin.self_api'
)
as
mock_api
:
mock_api
.
SelfAssessmentRequestError
=
self_api
.
SelfAssessmentRequestError
mock_api
.
create_assessment
.
side_effect
=
self_api
.
SelfAssessmentRequestError
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
self
.
assertFalse
(
resp
[
'success'
])
...
...
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