Commit d44b2e62 by Vik Paruchuri

Proper partial credit checks

parent f59045c3
...@@ -282,6 +282,13 @@ div.combined-rubric-container { ...@@ -282,6 +282,13 @@ div.combined-rubric-container {
} }
} }
label.choicegroup_partialcorrect {
&:before {
margin-right: 15px;
content: url('../images/partially-correct-icon.png');
}
}
label.choicegroup_incorrect { label.choicegroup_incorrect {
&:before { &:before {
margin-right: 15px; margin-right: 15px;
......
...@@ -224,7 +224,14 @@ class CombinedOpenEndedRubric(object): ...@@ -224,7 +224,14 @@ class CombinedOpenEndedRubric(object):
actual_scores[i] += [j] actual_scores[i] += [j]
actual_scores = [sum(i)/len(i) for i in actual_scores] actual_scores = [sum(i)/len(i) for i in actual_scores]
correct = [int(a>.66) for a in actual_scores] correct = []
for (i,a) in enumerate(actual_scores):
if int(a)/max_scores[i]==1:
correct.append(1)
elif int(a)==0:
correct.append(0)
else:
correct.append(.5)
html = self.system.render_template('{0}/open_ended_combined_rubric.html'.format(self.TEMPLATE_DIR), html = self.system.render_template('{0}/open_ended_combined_rubric.html'.format(self.TEMPLATE_DIR),
{'categories': rubric_categories, {'categories': rubric_categories,
......
...@@ -697,7 +697,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild): ...@@ -697,7 +697,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
else: else:
post_assessment = "" post_assessment = ""
correct = "" correct = ""
previous_answer = self.initial_display previous_answer = ""
context = { context = {
'prompt': self.child_prompt, 'prompt': self.child_prompt,
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
%if len(category['options'][j]['grader_types'])>0: %if len(category['options'][j]['grader_types'])>0:
%if correct[i]==1: %if correct[i]==1:
<label class="choicegroup_correct wrapper-score-selection"></label> <label class="choicegroup_correct wrapper-score-selection"></label>
%elif correct[i]==.5:
<label class="choicegroup_partialcorrect wrapper-score-selection"></label>
%else: %else:
<label class="choicegroup_incorrect wrapper-score-selection"></label> <label class="choicegroup_incorrect wrapper-score-selection"></label>
%endif %endif
......
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