Commit f9d4d6a2 by J. Cliff Dyer

Make get_scores return serialized ScoreSummary objects.

parent 7deafc6d
...@@ -33,7 +33,7 @@ def load_requirements(*requirements_paths): ...@@ -33,7 +33,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edx-submissions', name='edx-submissions',
version='1.2.0', version='2.0.0',
author='edX', author='edX',
description='An API for creating submissions and scores.', description='An API for creating submissions and scores.',
url='http://github.com/edx/edx-submissions.git', url='http://github.com/edx/edx-submissions.git',
......
...@@ -626,7 +626,8 @@ def get_score(student_item): ...@@ -626,7 +626,8 @@ def get_score(student_item):
def get_scores(course_id, student_id): def get_scores(course_id, student_id):
"""Return a dict mapping item_ids -> (points_earned, points_possible). """
Return a dict mapping item_ids -> [ScoreSerializer(ScoreSummary)].
This method would be used by an LMS to find all the scores for a given This method would be used by an LMS to find all the scores for a given
student in a given course. student in a given course.
...@@ -662,10 +663,8 @@ def get_scores(course_id, student_id): ...@@ -662,10 +663,8 @@ def get_scores(course_id, student_id):
logger.exception(msg) logger.exception(msg)
raise SubmissionInternalError(msg) raise SubmissionInternalError(msg)
scores = { scores = {
summary.student_item.item_id: summary.student_item.item_id: ScoreSerializer(summary.latest).data
(summary.latest.points_earned, summary.latest.points_possible) for summary in score_summaries if not summary.latest.is_hidden()
for summary in score_summaries
if not summary.latest.is_hidden()
} }
return scores return scores
......
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