Commit 9b066045 by Will Daly

Merge pull request #317 from edx/will/remove-overgrading-option

Remove option to disable over-grading
parents e7126bfd cfd0a751
...@@ -401,7 +401,7 @@ def get_assessments(submission_uuid, scored_only=True, limit=None): ...@@ -401,7 +401,7 @@ def get_assessments(submission_uuid, scored_only=True, limit=None):
raise PeerAssessmentInternalError(error_message) raise PeerAssessmentInternalError(error_message)
def get_submission_to_assess(submission_uuid, graded_by, over_grading=False): def get_submission_to_assess(submission_uuid, graded_by):
"""Get a submission to peer evaluate. """Get a submission to peer evaluate.
Retrieves a submission for assessment for the given student. This will Retrieves a submission for assessment for the given student. This will
...@@ -419,10 +419,6 @@ def get_submission_to_assess(submission_uuid, graded_by, over_grading=False): ...@@ -419,10 +419,6 @@ def get_submission_to_assess(submission_uuid, graded_by, over_grading=False):
associated Peer Workflow. associated Peer Workflow.
graded_by (int): The number of assessments a submission graded_by (int): The number of assessments a submission
requires before it has completed the peer assessment process. requires before it has completed the peer assessment process.
over_grading (bool): Allows over grading to be performed if no submission
requires assessments. Over grading should only occur if the deadline
for submissions has passed, but there is still a window for peer
assessment. Defaults to False.
Returns: Returns:
dict: A peer submission for assessment. This contains a 'student_item', dict: A peer submission for assessment. This contains a 'student_item',
...@@ -456,17 +452,17 @@ def get_submission_to_assess(submission_uuid, graded_by, over_grading=False): ...@@ -456,17 +452,17 @@ def get_submission_to_assess(submission_uuid, graded_by, over_grading=False):
u"student.")) u"student."))
peer_submission_uuid = workflow.find_active_assessments() peer_submission_uuid = workflow.find_active_assessments()
# If there is an active assessment for this user, get that submission, # If there is an active assessment for this user, get that submission,
# otherwise, get the first assessment for review, otherwise, if over grading # otherwise, get the first assessment for review, otherwise,
# is turned on, get the first submission available for over grading. # get the first submission available for over grading ("over-grading").
if peer_submission_uuid is None: if peer_submission_uuid is None:
peer_submission_uuid = workflow.get_submission_for_review(graded_by) peer_submission_uuid = workflow.get_submission_for_review(graded_by)
if peer_submission_uuid is None and over_grading: if peer_submission_uuid is None:
peer_submission_uuid = workflow.get_submission_for_over_grading() peer_submission_uuid = workflow.get_submission_for_over_grading()
if peer_submission_uuid: if peer_submission_uuid:
try: try:
submission_data = sub_api.get_submission(peer_submission_uuid) submission_data = sub_api.get_submission(peer_submission_uuid)
PeerWorkflow.create_item(workflow, peer_submission_uuid) PeerWorkflow.create_item(workflow, peer_submission_uuid)
_log_workflow(peer_submission_uuid, workflow, over_grading) _log_workflow(peer_submission_uuid, workflow)
return submission_data return submission_data
except sub_api.SubmissionNotFoundError: except sub_api.SubmissionNotFoundError:
error_message = _( error_message = _(
...@@ -701,7 +697,7 @@ def _log_assessment(assessment, scorer_workflow): ...@@ -701,7 +697,7 @@ def _log_assessment(assessment, scorer_workflow):
dog_stats_api.increment('openassessment.assessment.count', tags=tags) dog_stats_api.increment('openassessment.assessment.count', tags=tags)
def _log_workflow(submission_uuid, workflow, over_grading): def _log_workflow(submission_uuid, workflow):
""" """
Log the creation of a peer-assessment workflow. Log the creation of a peer-assessment workflow.
...@@ -709,7 +705,6 @@ def _log_workflow(submission_uuid, workflow, over_grading): ...@@ -709,7 +705,6 @@ def _log_workflow(submission_uuid, workflow, over_grading):
submission_uuid (str): The UUID of the submission being assessed. submission_uuid (str): The UUID of the submission being assessed.
workflow (PeerWorkflow): The Peer Workflow of the student making the workflow (PeerWorkflow): The Peer Workflow of the student making the
assessment. assessment.
over_grading (bool): Whether over-grading is enabled.
""" """
logger.info( logger.info(
u"Retrieved submission {} ({}, {}) to be assessed by {}" u"Retrieved submission {} ({}, {}) to be assessed by {}"
...@@ -727,7 +722,8 @@ def _log_workflow(submission_uuid, workflow, over_grading): ...@@ -727,7 +722,8 @@ def _log_workflow(submission_uuid, workflow, over_grading):
u"type:peer" u"type:peer"
] ]
if over_grading: # Over-grading is always turned on
tags.append(u"overgrading") # Keep this tag for backwards-compatibility
tags.append(u"overgrading")
dog_stats_api.increment('openassessment.assessment.peer_workflow.count', tags=tags) dog_stats_api.increment('openassessment.assessment.peer_workflow.count', tags=tags)
...@@ -637,8 +637,6 @@ class TestPeerApi(CacheResetTest): ...@@ -637,8 +637,6 @@ class TestPeerApi(CacheResetTest):
RUBRIC_DICT, RUBRIC_DICT,
REQUIRED_GRADED_BY, REQUIRED_GRADED_BY,
) )
sub = peer_api.get_submission_to_assess(buffy_sub['uuid'], REQUIRED_GRADED_BY)
self.assertIsNone(sub)
# 11) Xander comes along and submits. # 11) Xander comes along and submits.
xander_sub, xander = self._create_student_and_submission("Xander", "Xander's answer") xander_sub, xander = self._create_student_and_submission("Xander", "Xander's answer")
......
...@@ -224,8 +224,7 @@ class PeerAssessmentMixin(object): ...@@ -224,8 +224,7 @@ class PeerAssessmentMixin(object):
try: try:
peer_submission = peer_api.get_submission_to_assess( peer_submission = peer_api.get_submission_to_assess(
self.submission_uuid, self.submission_uuid,
assessment["must_be_graded_by"], assessment["must_be_graded_by"]
True
) )
self.runtime.publish( self.runtime.publish(
self, self,
......
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