Commit 1ae6aab7 by Xavier Antoviaque

Merge pull request #3 from aboudreault/mrq-mistake-mark

Mrq mistake mark
parents 6d576e07 2e212b5c
......@@ -49,7 +49,7 @@ class MentoringBlock(XBlockWithLightChildren):
"""
An XBlock providing mentoring capabilities
Composed of text, answers input fields, and a set of MRQ/MCQ with advices.
Composed of text, answers input fields, and a set of MRQ/MCQ with advices.
A set of conditions on the provided answers and MCQ/MRQ choices will determine if the
student is a) provided mentoring advices and asked to alter his answer, or b) is given the
ok to continue.
......@@ -74,8 +74,6 @@ class MentoringBlock(XBlockWithLightChildren):
fragment, named_children = self.get_children_fragment(context, view_name='mentoring_view',
not_instance_of=MentoringMessageBlock)
correct_icon_url = self.runtime.local_resource_url(self, 'public/img/correct-icon.png')
fragment.add_content(render_template('templates/html/mentoring.html', {
'self': self,
'named_children': named_children,
......@@ -85,9 +83,7 @@ class MentoringBlock(XBlockWithLightChildren):
fragment.add_javascript_url(
self.runtime.local_resource_url(self, 'public/js/vendor/underscore-min.js'))
fragment.add_javascript_url(self.runtime.local_resource_url(self, 'public/js/mentoring.js'))
fragment.add_resource(load_resource('templates/html/mentoring_progress.html').format(
completed=correct_icon_url),
"text/html")
fragment.add_resource(load_resource('templates/html/mentoring_progress.html'), "text/html")
fragment.initialize_js('MentoringBlock')
......
......@@ -50,5 +50,5 @@
}
.mentoring .progress .indicator .checkmark {
margin-top: 25px;
color: #006600;
}
......@@ -12,18 +12,21 @@
}
.mentoring .choices .choice-result {
padding-right: 40px;
background-position: center;
background-repeat: no-repeat;
padding-right: 10px;
vertical-align: middle;
}
.mentoring .choices .choice-result.correct {
background-image: url({{ correct_icon_url }});
cursor: pointer;
color: #006600;
position: relative;
top: -3px;
}
.mentoring .choices .choice-result.incorrect {
background-image: url({{ incorrect_icon_url }});
cursor: pointer;
margin-right: 10px;
padding-left: 10px;
padding-right: 10px;
color: #ff0000;
}
.mentoring .choices .choice-tips,
......
......@@ -53,7 +53,7 @@ function MRQBlock(runtime, element) {
};
if (result.message) {
messageDOM.html('<div class="message-content"><div class="close"></div>' +
messageDOM.html('<div class="message-content"><div class="close"></div>' +
result.message + '</div>');
showPopup(messageDOM);
}
......@@ -66,9 +66,9 @@ function MRQBlock(runtime, element) {
choiceTipsCloseDOM;
if (choice.completed) {
choiceResultDOM.removeClass('incorrect').addClass('correct');
choiceResultDOM.removeClass('incorrect icon-exclamation').addClass('correct icon-ok');
} else {
choiceResultDOM.removeClass('correct').addClass('incorrect');
choiceResultDOM.removeClass('correct icon-ok').addClass('incorrect icon-exclamation');
}
choiceTipsDOM.html(choice.tips);
......
......@@ -85,10 +85,6 @@ class QuestionnaireAbstractBlock(LightChild):
fragment = Fragment(html)
fragment.add_css(render_template('public/css/questionnaire.css', {
'self': self,
'correct_icon_url': self.runtime.local_resource_url(self.xblock_container,
'public/img/correct-icon.png'),
'incorrect_icon_url': self.runtime.local_resource_url(self.xblock_container,
'public/img/incorrect-icon.png'),
'close_icon_url': self.runtime.local_resource_url(self.xblock_container,
'public/img/close.png'),
}))
......
......@@ -7,10 +7,12 @@
{{c.body_html|safe}}
{% endfor %}
{% if self.display_submit %}
<input type="button" value="Submit" class="submit"></input>
<span class="progress" data-completed="{{ self.completed }}">
<span class='indicator'></span>
</span>
<div class="submit">
<input type="button" value="Submit"></input>
<span class="progress" data-completed="{{ self.completed }}">
<span class='indicator'></span>
</span>
</div>
{% endif %}
<div class="messages"></div>
</div>
<script type="text/template" id="xblock-progress-template">
<% if (completed === "True") {{ %>
<img src="{completed}" class="checkmark" alt="Completed">
<i class="icon-ok icon-2x checkmark"></i>
<% }} %>
</script>
......@@ -4,7 +4,7 @@
<div class="choices-list">
{% for choice in custom_choices %}
<div class="choice">
<span class="choice-result"></span>
<span class="choice-result icon-2x"></span>
<label class="choice-label">
<input class="choice-selector" type="checkbox" name="{{ self.name }}" value="{{ choice.value }}"{% if choice.value in self.student_choices %} checked{% endif %}> {{ choice.content }}
</label>
......
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