Commit 7d794f08 by Xavier Antoviaque

Merge pull request #4 from aboudreault/incomplete-mark

Added an incomplete mark indicator
parents 1ae6aab7 fcb41c42
......@@ -139,6 +139,7 @@ class MentoringBlock(XBlockWithLightChildren):
return {
'submitResults': submit_results,
'completed': self.completed,
'attempted': self.attempted,
'message': message,
}
......
......@@ -49,6 +49,15 @@
margin-top: 20px;
}
.mentoring .progress .indicator .checkmark {
.mentoring .progress .indicator {
display: inline-block;
margin-top: 5px;
}
.mentoring .progress .indicator .checkmark-correct {
color: #006600;
}
.mentoring .progress .indicator .checkmark-incorrect {
color: #ff0000;
}
......@@ -34,7 +34,8 @@ function MentoringBlock(runtime, element) {
callIfExists(child, 'handleSubmit', result);
});
$('.progress', element).data('completed', results.completed ? 'True' : 'False')
$('.progress', element).data('completed', results.completed ? 'True' : 'False');
$('.progress', element).data('attempted', results.attempted ? 'True' : 'False');
renderProgress();
// Messages should only be displayed upon hitting 'submit', not on page reload
......
......@@ -9,7 +9,7 @@
{% if self.display_submit %}
<div class="submit">
<input type="button" value="Submit"></input>
<span class="progress" data-completed="{{ self.completed }}">
<span class="progress" data-completed="{{ self.completed }}" data-attempted="{{ self.attempted }}">
<span class='indicator'></span>
</span>
</div>
......
<script type="text/template" id="xblock-progress-template">
<% if (completed === "True") {{ %>
<i class="icon-ok icon-2x checkmark"></i>
<i class="icon-ok icon-2x checkmark-correct"></i>
<% }} else if (attempted === "True") {{ %>
<i class="icon-exclamation icon-2x checkmark-incorrect"></i>
<% }} %>
</script>
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