From 4dc0859fbd0105d6e81175b4a425307e9d570d62 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 00:30:25 -0500 Subject: [PATCH] Finish refactor of rubric templates, redo some margins --- .../xmodule/combined_open_ended_rubric.py | 40 +++++++++---------- .../css/combinedopenended/display.scss | 15 +++++++ .../open_ended_view_only_rubric.html | 1 + 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py index 7c8aea60be..cf0c91c3d1 100644 --- a/common/lib/xmodule/xmodule/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/combined_open_ended_rubric.py @@ -48,26 +48,26 @@ class CombinedOpenEndedRubric(object): html: the html that corresponds to the xml given ''' success = False - try: - rubric_categories = self.extract_categories(rubric_xml) - rubric_scores = [cat['score'] for cat in rubric_categories] - max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) - max_score = max(max_scores) - rubric_template = 'open_ended_rubric.html' - if self.view_only: - rubric_template = 'open_ended_view_only_rubric.html' - html = self.system.render_template(rubric_template, - {'categories': rubric_categories, - 'has_score': self.has_score, - 'view_only': self.view_only, - 'max_score': max_score, - 'combined_rubric' : False - }) - success = True - except: - error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) - log.error(error_message) - raise RubricParsingError(error_message) + #try: + rubric_categories = self.extract_categories(rubric_xml) + rubric_scores = [cat['score'] for cat in rubric_categories] + max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories) + max_score = max(max_scores) + rubric_template = 'open_ended_rubric.html' + if self.view_only: + rubric_template = 'open_ended_view_only_rubric.html' + html = self.system.render_template(rubric_template, + {'categories': rubric_categories, + 'has_score': self.has_score, + 'view_only': self.view_only, + 'max_score': max_score, + 'combined_rubric' : False + }) + success = True + #except: + # error_message = "[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml) + # log.error(error_message) + # raise RubricParsingError(error_message) return {'success' : success, 'html' : html, 'rubric_scores' : rubric_scores} def check_if_rubric_is_parseable(self, rubric_string, location, max_score_allowed, max_score): diff --git a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss index 6a9e9ad2a5..119b8b044a 100644 --- a/common/lib/xmodule/xmodule/css/combinedopenended/display.scss +++ b/common/lib/xmodule/xmodule/css/combinedopenended/display.scss @@ -51,6 +51,7 @@ section.legend-container { display: inline; width: 20%; } + margin-bottom: 5px; } section.combined-open-ended-status { @@ -106,6 +107,20 @@ section.combined-open-ended-status { } } +div.combined-rubric-container { + ul.rubric-list{ + list-style-type: none; + padding:0; + margin:0; + li { + &.rubric-list-item{ + margin-bottom: 2px; + padding: 0px; + } + } + } +} + div.result-container { .evaluation { diff --git a/lms/templates/open_ended_view_only_rubric.html b/lms/templates/open_ended_view_only_rubric.html index 55bf5338cf..d8e1fb778b 100644 --- a/lms/templates/open_ended_view_only_rubric.html +++ b/lms/templates/open_ended_view_only_rubric.html @@ -6,6 +6,7 @@ <% option = category['options'][j] %> % if option['selected']: ${category['description']} : ${option['points']} points + % endif % endfor % endfor