Commit f9d4d6a2 by J. Cliff Dyer

Make get_scores return serialized ScoreSummary objects.

parent 7deafc6d
......@@ -33,7 +33,7 @@ def load_requirements(*requirements_paths):
setup(
name='edx-submissions',
version='1.2.0',
version='2.0.0',
author='edX',
description='An API for creating submissions and scores.',
url='http://github.com/edx/edx-submissions.git',
......
......@@ -626,7 +626,8 @@ def get_score(student_item):
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
student in a given course.
......@@ -662,10 +663,8 @@ def get_scores(course_id, student_id):
logger.exception(msg)
raise SubmissionInternalError(msg)
scores = {
summary.student_item.item_id:
(summary.latest.points_earned, summary.latest.points_possible)
for summary in score_summaries
if not summary.latest.is_hidden()
summary.student_item.item_id: ScoreSerializer(summary.latest).data
for summary in score_summaries if not summary.latest.is_hidden()
}
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