From 833aa01bd4f6daf5ec1351337d34651dba212ce6 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 13 Feb 2013 11:38:43 -0500 Subject: [PATCH] Add in documentation on tuple matching --- .../xmodule/xmodule/combined_open_ended_rubric.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index fa7f83ec69..7c00c5f029 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -231,6 +231,14 @@ class CombinedOpenEndedRubric(object): @staticmethod def reformat_scores_for_rendering(scores, score_types, feedback_types): + """ + Takes in a list of rubric scores, the types of those scores, and feedback associated with them + Outputs a reformatted list of score tuples (count, rubric category, rubric score, [graders that gave this score], [feedback types]) + @param scores: + @param score_types: + @param feedback_types: + @return: + """ success = False if len(scores)==0: log.error("Score length is 0.") @@ -271,6 +279,13 @@ class CombinedOpenEndedRubric(object): @staticmethod def check_for_tuple_matches(tuples, tuple): + """ + Checks to see if a tuple in a list of tuples is a match for tuple. + If not match, creates a new tuple matching tuple. + @param tuples: list of tuples + @param tuple: tuples to match + @return: a new list of tuples, and the index of the tuple that matches tuple + """ category = tuple[1] score = tuple[2] tup_ind = -1