Commit 606e8b1d by Jason Bau

Merge pull request #697 from edx/fix/jbau/openendmodule-round-score-up

small change in aggregating peer eval grades (rounds up)
parents 73ad057e fa3bd7a1
...@@ -527,7 +527,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): ...@@ -527,7 +527,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
feedback = "".join(feedback_items) feedback = "".join(feedback_items)
else: else:
feedback = feedback_items feedback = feedback_items
score = int(median(score_result['score'])) score = int(round(median(score_result['score'])))
else: else:
# This is for instructor and ML grading # This is for instructor and ML grading
feedback, rubric_score = self._format_feedback(score_result, system) feedback, rubric_score = self._format_feedback(score_result, system)
......
...@@ -291,6 +291,30 @@ class OpenEndedModuleTest(unittest.TestCase): ...@@ -291,6 +291,30 @@ class OpenEndedModuleTest(unittest.TestCase):
'xqueue_body': json.dumps(score_msg)} 'xqueue_body': json.dumps(score_msg)}
self.openendedmodule.update_score(get, self.test_system) self.openendedmodule.update_score(get, self.test_system)
def update_score_multiple(self):
self.openendedmodule.new_history_entry("New Entry")
feedback = {
"success": True,
"feedback": "Grader Feedback"
}
score_msg = {
'correct': True,
'score': [0, 1],
'msg': 'Grader Message',
'feedback': [json.dumps(feedback), json.dumps(feedback)],
'grader_type': 'PE',
'grader_id': ['1', '2'],
'submission_id': '1',
'success': True,
'rubric_scores': [[0], [0]],
'rubric_scores_complete': [True, True],
'rubric_xml': [etree.tostring(self.rubric), etree.tostring(self.rubric)]
}
get = {'queuekey': "abcd",
'xqueue_body': json.dumps(score_msg)}
self.openendedmodule.update_score(get, self.test_system)
def test_latest_post_assessment(self): def test_latest_post_assessment(self):
self.update_score_single() self.update_score_single()
assessment = self.openendedmodule.latest_post_assessment(self.test_system) assessment = self.openendedmodule.latest_post_assessment(self.test_system)
...@@ -298,11 +322,19 @@ class OpenEndedModuleTest(unittest.TestCase): ...@@ -298,11 +322,19 @@ class OpenEndedModuleTest(unittest.TestCase):
# check for errors # check for errors
self.assertFalse('errors' in assessment) self.assertFalse('errors' in assessment)
def test_update_score(self): def test_update_score_single(self):
self.update_score_single() self.update_score_single()
score = self.openendedmodule.latest_score() score = self.openendedmodule.latest_score()
self.assertEqual(score, 4) self.assertEqual(score, 4)
def test_update_score_multiple(self):
"""
Tests that a score of [0, 1] gets aggregated to 1. A change in behavior added by @jbau
"""
self.update_score_multiple()
score = self.openendedmodule.latest_score()
self.assertEquals(score, 1)
class CombinedOpenEndedModuleTest(unittest.TestCase): class CombinedOpenEndedModuleTest(unittest.TestCase):
""" """
......
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