Commit 7e345ce5 by Diana Huang

Add scores to the top of the rubric, remove from individual cells

parent 69d5c005
...@@ -25,10 +25,13 @@ class CombinedOpenEndedRubric(object): ...@@ -25,10 +25,13 @@ class CombinedOpenEndedRubric(object):
''' '''
try: try:
rubric_categories = self.extract_categories(rubric_xml) 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', html = self.system.render_template('open_ended_rubric.html',
{'categories' : rubric_categories, {'categories' : rubric_categories,
'has_score': self.has_score, 'has_score': self.has_score,
'view_only': self.view_only}) 'view_only': self.view_only,
'max_score': max_score})
except: except:
raise RubricParsingError("[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml)) raise RubricParsingError("[render_rubric] Could not parse the rubric with xml: {0}".format(rubric_xml))
return html return html
......
...@@ -8,6 +8,14 @@ ...@@ -8,6 +8,14 @@
<p>Select the criteria you feel best represents this submission in each category.</p> <p>Select the criteria you feel best represents this submission in each category.</p>
% endif % endif
<table class="rubric"> <table class="rubric">
<tr class="points-header">
<th></th>
% for i in range(max_score + 1):
<th>
${i} points
</th>
% endfor
</tr>
% for i in range(len(categories)): % for i in range(len(categories)):
<% category = categories[i] %> <% category = categories[i] %>
<tr> <tr>
...@@ -23,7 +31,6 @@ ...@@ -23,7 +31,6 @@
<div class="view-only"> <div class="view-only">
% endif % endif
${option['text']} ${option['text']}
<div class="grade">[${option['points']} points]</div>
</div> </div>
% else: % else:
<input type="radio" class="score-selection" name="score-selection-${i}" id="score-${i}-${j}" value="${option['points']}"/> <input type="radio" class="score-selection" name="score-selection-${i}" id="score-${i}-${j}" value="${option['points']}"/>
......
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