Commit 085f008f by Xavier Antoviaque

Merge pull request #53 from aboudreault/assessment-fixes

Fix feedback message display
parents 5b8531f0 8d3352d2
...@@ -104,7 +104,7 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -104,7 +104,7 @@ class MentoringBlock(XBlockWithLightChildren):
"""Compute the student score taking into account the light child weight.""" """Compute the student score taking into account the light child weight."""
total_child_weight = sum(float(step.weight) for step in self.steps) total_child_weight = sum(float(step.weight) for step in self.steps)
if total_child_weight == 0: if total_child_weight == 0:
return (0, 0, 0) return (0, 0, 0, 0)
score = sum(r[1]['score']*r[1]['weight'] \ score = sum(r[1]['score']*r[1]['weight'] \
for r in self.student_results) / total_child_weight for r in self.student_results) / total_child_weight
correct = sum(1 for r in self.student_results if r[1]['completed'] == True) correct = sum(1 for r in self.student_results if r[1]['completed'] == True)
......
...@@ -23,6 +23,10 @@ function MentoringStandardView(runtime, element, mentoring) { ...@@ -23,6 +23,10 @@ function MentoringStandardView(runtime, element, mentoring) {
// Messages should only be displayed upon hitting 'submit', not on page reload // Messages should only be displayed upon hitting 'submit', not on page reload
messagesDOM.append(results.message); messagesDOM.append(results.message);
var template = $('#light-child-template', messagesDOM).html();
if (template) {
messagesDOM.append(template);
}
if (messagesDOM.html().trim()) { if (messagesDOM.html().trim()) {
messagesDOM.prepend('<div class="title1">Feedback</div>'); messagesDOM.prepend('<div class="title1">Feedback</div>');
messagesDOM.show(); messagesDOM.show();
......
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