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
484beef9
Commit
484beef9
authored
Dec 30, 2014
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding test and test code.
TNL-900
parent
2c4d4efd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
openassessment/workflow/models.py
+13
-0
openassessment/xblock/test/test_peer.py
+28
-0
No files found.
openassessment/workflow/models.py
View file @
484beef9
...
@@ -244,6 +244,19 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
...
@@ -244,6 +244,19 @@ class AssessmentWorkflow(TimeStampedModel, StatusModel):
if
self
.
status
==
self
.
STATUS
.
done
:
if
self
.
status
==
self
.
STATUS
.
done
:
return
return
# # If we submission workflow is cancelled then set the score to 0 and status to DONE.
# if False is not None:
# self.set_score(0)
# new_status = self.STATUS.done
#
# # Finally save our changes if the status has changed
# if self.status != new_status:
# self.status = new_status
# self.save()
# logger.info((
# u"Workflow for submission UUID {uuid} has updated status to {status}"
# ).format(uuid=self.submission_uuid, status=new_status))
# Update our AssessmentWorkflowStep models with the latest from our APIs
# Update our AssessmentWorkflowStep models with the latest from our APIs
steps
=
self
.
_get_steps
()
steps
=
self
.
_get_steps
()
step_for_name
=
{
step
.
name
:
step
for
step
in
steps
}
step_for_name
=
{
step
.
name
:
step
for
step
in
steps
}
...
...
openassessment/xblock/test/test_peer.py
View file @
484beef9
...
@@ -103,6 +103,34 @@ class TestPeerAssessment(XBlockHandlerTestCase):
...
@@ -103,6 +103,34 @@ class TestPeerAssessment(XBlockHandlerTestCase):
self
.
assertGreater
(
len
(
resp
[
'msg'
]),
0
)
self
.
assertGreater
(
len
(
resp
[
'msg'
]),
0
)
@scenario
(
'data/peer_assessment_scenario.xml'
,
user_id
=
'Bob'
)
@scenario
(
'data/peer_assessment_scenario.xml'
,
user_id
=
'Bob'
)
def
test_peer_assess_for_already_cancelled_submission
(
self
,
xblock
):
# Create a submission for this problem from another user
student_item
=
xblock
.
get_student_item_dict
()
submission
=
xblock
.
create_submission
(
student_item
,
self
.
SUBMISSION
)
# Create a submission for the scorer (required before assessing another student)
another_student
=
copy
.
deepcopy
(
student_item
)
another_submission
=
xblock
.
create_submission
(
another_student
,
self
.
SUBMISSION
)
assessment
=
self
.
ASSESSMENT
assessment
[
'submission_uuid'
]
=
assessment
.
get
(
'submission_uuid'
,
submission
.
get
(
'uuid'
,
None
))
# Pull the submission to assess
peer_api
.
get_submission_to_assess
(
another_submission
[
'uuid'
],
3
)
peer_api
.
cancel_submission_peer_workflow
(
submission_uuid
=
submission
[
'uuid'
],
comments
=
"Inappropriate Language."
,
cancelled_by_id
=
another_student
[
'student_id'
]
)
# Submit an assessment and expect a failure
resp
=
self
.
request
(
xblock
,
'peer_assess'
,
json
.
dumps
(
assessment
),
response_format
=
'json'
)
self
.
assertEqual
(
resp
[
'success'
],
False
)
self
.
assertGreater
(
len
(
resp
[
'msg'
]),
0
)
@scenario
(
'data/peer_assessment_scenario.xml'
,
user_id
=
'Bob'
)
def
test_missing_keys_in_request
(
self
,
xblock
):
def
test_missing_keys_in_request
(
self
,
xblock
):
for
missing
in
[
'criterion_feedback'
,
'overall_feedback'
,
'options_selected'
]:
for
missing
in
[
'criterion_feedback'
,
'overall_feedback'
,
'options_selected'
]:
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
assessment
=
copy
.
deepcopy
(
self
.
ASSESSMENT
)
...
...
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