From 683976d7adf4eebedd84894d79b13572072f8dfb Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Thu, 31 Jan 2013 13:28:19 -0500 Subject: [PATCH] Add scores to the top of the rubric, remove from individual cells --- common/lib/xmodule/xmodule/combined_open_ended_rubric.py | 5 ++++- lms/templates/open_ended_rubric.html | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 4380e32d5b..50ec22f033 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -25,10 +25,13 @@ class CombinedOpenEndedRubric(object): ''' try: rubric_categories = self.extract_categories(rubric_xml) + max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) + max_score = max(max_scores) html = self.system.render_template('open_ended_rubric.html', {'categories' : rubric_categories, 'has_score': self.has_score, - 'view_only': self.view_only}) + 'view_only': self.view_only, + 'max_score': max_score}) except: raise RubricParsingError("[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml)) return html diff --git a/lms/templates/open_ended_rubric.html b/lms/templates/open_ended_rubric.html index 8d40c7d2b8..b92ad04bde 100644 --- a/lms/templates/open_ended_rubric.html +++ b/lms/templates/open_ended_rubric.html @@ -8,6 +8,14 @@

Select the criteria you feel best represents this submission in each category.

% endif + + + % for i in range(max_score + 1): + + % endfor + % for i in range(len(categories)): <% category = categories[i] %> @@ -23,7 +31,6 @@
% endif ${option['text']} -
[${option['points']} points]
% else:
+ ${i} points +