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
7e79b6bc
Commit
7e79b6bc
authored
Dec 29, 2014
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring the code for grade overriding and tests.
TNL-900
parent
71312efa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
15 deletions
+24
-15
openassessment/assessment/api/peer.py
+12
-11
openassessment/assessment/models/peer.py
+1
-1
openassessment/assessment/test/test_peer.py
+9
-1
openassessment/xblock/peer_assessment_mixin.py
+1
-1
openassessment/xblock/test/test_staff_info.py
+1
-1
No files found.
openassessment/assessment/api/peer.py
View file @
7e79b6bc
...
@@ -1018,20 +1018,20 @@ def get_submission_cancellation(submission_uuid):
...
@@ -1018,20 +1018,20 @@ def get_submission_cancellation(submission_uuid):
raise
PeerAssessmentInternalError
(
error_message
)
raise
PeerAssessmentInternalError
(
error_message
)
def
is_
peer_
workflow_submission_cancelled
(
submission_uuid
):
def
is_workflow_submission_cancelled
(
submission_uuid
):
"""
"""
Check if
peer
workflow submission is cancelled?
Check if workflow submission is cancelled?
Args:
Args:
submission_uuid (str): The UUID of the peer workflow's submission.
submission_uuid (str): The UUID of the workflow's submission.
Returns:
True/False
"""
"""
# Users must submit a response before they can peer-assess.
if
submission_uuid
is
None
:
if
submission_uuid
is
None
:
return
False
return
False
try
:
workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
submission_uuid
)
workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
submission_uuid
)
if
workflow
:
return
workflow
.
is_cancelled
if
workflow
else
False
return
workflow
.
is_cancelled
except
PeerAssessmentWorkflowError
:
return
False
return
False
\ No newline at end of file
openassessment/assessment/models/peer.py
View file @
7e79b6bc
...
@@ -127,7 +127,7 @@ class PeerWorkflow(models.Model):
...
@@ -127,7 +127,7 @@ class PeerWorkflow(models.Model):
Returns:
Returns:
True/False
True/False
"""
"""
return
bool
(
self
.
cancellations
.
exists
()
)
return
self
.
cancellations
.
exists
(
)
@classmethod
@classmethod
def
get_by_submission_uuid
(
cls
,
submission_uuid
):
def
get_by_submission_uuid
(
cls
,
submission_uuid
):
...
...
openassessment/assessment/test/test_peer.py
View file @
7e79b6bc
...
@@ -952,7 +952,7 @@ class TestPeerApi(CacheResetTest):
...
@@ -952,7 +952,7 @@ class TestPeerApi(CacheResetTest):
workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
buffy_sub
[
"uuid"
])
workflow
=
PeerWorkflow
.
get_by_submission_uuid
(
buffy_sub
[
"uuid"
])
self
.
assertTrue
(
workflow
.
is_cancelled
)
self
.
assertTrue
(
workflow
.
is_cancelled
)
def
test_cancelled_submission_peerworkflow_score
(
self
):
def
test_cancelled_submission_peerworkflow_
final_
score
(
self
):
tim_sub
,
tim
=
self
.
_create_student_and_submission
(
"Tim"
,
"Tim's answer"
)
tim_sub
,
tim
=
self
.
_create_student_and_submission
(
"Tim"
,
"Tim's answer"
)
bob_sub
,
bob
=
self
.
_create_student_and_submission
(
"Bob"
,
"Bob's answer"
)
bob_sub
,
bob
=
self
.
_create_student_and_submission
(
"Bob"
,
"Bob's answer"
)
...
@@ -981,12 +981,20 @@ class TestPeerApi(CacheResetTest):
...
@@ -981,12 +981,20 @@ class TestPeerApi(CacheResetTest):
'must_be_graded_by'
:
1
'must_be_graded_by'
:
1
}
}
# Check the final score it should be 6.
score
=
peer_api
.
get_score
(
bob_sub
[
"uuid"
],
requirements
)
self
.
assertEqual
(
score
[
'points_earned'
],
6
)
# Cancel the workflow for bob submission.
peer_api
.
cancel_submission_peer_workflow
(
peer_api
.
cancel_submission_peer_workflow
(
submission_uuid
=
bob_sub
[
"uuid"
],
submission_uuid
=
bob_sub
[
"uuid"
],
comments
=
"Inappropriate language"
,
comments
=
"Inappropriate language"
,
cancelled_by_id
=
bob
[
'student_id'
]
cancelled_by_id
=
bob
[
'student_id'
]
)
)
# Check if the submission cancelled successfully.
self
.
assertTrue
(
peer_api
.
is_workflow_submission_cancelled
(
bob_sub
[
"uuid"
]))
# After cancellation the score should be 0.
score
=
peer_api
.
get_score
(
bob_sub
[
"uuid"
],
requirements
)
score
=
peer_api
.
get_score
(
bob_sub
[
"uuid"
],
requirements
)
self
.
assertEqual
(
score
[
'points_earned'
],
0
)
self
.
assertEqual
(
score
[
'points_earned'
],
0
)
...
...
openassessment/xblock/peer_assessment_mixin.py
View file @
7e79b6bc
...
@@ -214,7 +214,7 @@ class PeerAssessmentMixin(object):
...
@@ -214,7 +214,7 @@ class PeerAssessmentMixin(object):
"Submit your assessment & move to response #{response_number}"
"Submit your assessment & move to response #{response_number}"
)
.
format
(
response_number
=
(
count
+
2
))
)
.
format
(
response_number
=
(
count
+
2
))
if
peer_api
.
is_
peer_
workflow_submission_cancelled
(
self
.
submission_uuid
):
if
peer_api
.
is_workflow_submission_cancelled
(
self
.
submission_uuid
):
path
=
'openassessmentblock/peer/oa_peer_waiting.html'
path
=
'openassessmentblock/peer/oa_peer_waiting.html'
# Sets the XBlock boolean to signal to Message that it WAS able to grab a submission
# Sets the XBlock boolean to signal to Message that it WAS able to grab a submission
self
.
no_peers
=
True
self
.
no_peers
=
True
...
...
openassessment/xblock/test/test_staff_info.py
View file @
7e79b6bc
...
@@ -250,7 +250,7 @@ class TestCourseStaff(XBlockHandlerTestCase):
...
@@ -250,7 +250,7 @@ class TestCourseStaff(XBlockHandlerTestCase):
self
.
assertEquals
(
"openassessmentblock/staff_debug/student_info.html"
,
path
)
self
.
assertEquals
(
"openassessmentblock/staff_debug/student_info.html"
,
path
)
@scenario
(
'data/basic_scenario.xml'
,
user_id
=
'Bob'
)
@scenario
(
'data/basic_scenario.xml'
,
user_id
=
'Bob'
)
def
test_cancelled_submission_peer_as
esee
ment_render_path
(
self
,
xblock
):
def
test_cancelled_submission_peer_as
sess
ment_render_path
(
self
,
xblock
):
"""
"""
Test that peer assessment path should be oa_peer_waiting.html for a cancelled submission.
Test that peer assessment path should be oa_peer_waiting.html for a cancelled submission.
"""
"""
...
...
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