Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions problem_builder/mentoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def review_tips(self):
# The student got this wrong. Check if there is a review tip to show.
tip_html = child.get_review_tip()
if tip_html:
if hasattr(self.runtime, 'replace_jump_to_id_urls'):
if getattr(self.runtime, 'replace_jump_to_id_urls', None) is not None:
tip_html = self.runtime.replace_jump_to_id_urls(tip_html)
review_tips.append(tip_html)
return review_tips
Expand Down Expand Up @@ -1124,10 +1124,6 @@ def author_edit_view(self, context):
"""
Add some HTML to the author view that allows authors to add child blocks.
"""
context['wrap_children'] = {
'head': u'<div class="mentoring">',
'tail': u'</div>'
}
fragment = super(MentoringWithExplicitStepsBlock, self).author_edit_view(context)
fragment.add_content(loader.render_template('templates/html/mentoring_url_name.html', {
"url_name": self.url_name
Expand Down
2 changes: 1 addition & 1 deletion problem_builder/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_message_content(self, message_type, or_default=False):
child = self.runtime.get_block(child_id)
if child.type == message_type:
content = child.content
if hasattr(self.runtime, 'replace_jump_to_id_urls'):
if getattr(self.runtime, 'replace_jump_to_id_urls', None) is not None:
content = self.runtime.replace_jump_to_id_urls(content)
return content
if or_default:
Expand Down
4 changes: 0 additions & 4 deletions problem_builder/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,6 @@ def author_edit_view(self, context):
"""
Add some HTML to the author view that allows authors to add child blocks.
"""
context['wrap_children'] = {
'head': u'<div class="mentoring">',
'tail': u'</div>'
}
fragment = super(PlotBlock, self).author_edit_view(context)
fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/problem-builder-edit.css'))
fragment.add_javascript_url(self.runtime.local_resource_url(self, 'public/js/util.js'))
Expand Down
11 changes: 6 additions & 5 deletions problem_builder/public/css/problem-builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
list-style: none;
padding-left: 0 !important;
margin-left: 0;
margin-bottom: 0.4em;
}
.mentoring .review-list li {
display: inline;
Expand All @@ -184,7 +185,7 @@
}

.mentoring .results-section {
margin-left: 40px;
margin-left: 50px;
}

.mentoring .results-section p {
Expand All @@ -202,21 +203,21 @@
display: none;
}

.mentoring .assessment-review-tips p.review-tips-intro {
.mentoring p.review-tips-intro {
margin-top: 1.2em;
margin-bottom: 0;
font-weight: bold;
}

.mentoring .assessment-review-tips .review-tips-list {
.mentoring .review-tips-list {
margin-top: 0;
padding-top: 0;
}
.mentoring .assessment-review-tips .review-tips-list li {
.mentoring .review-tips-list li {
margin-left: 0.5em;
padding-left: 0;
}
.mentoring .assessment-review-tips .review-tips-list li p {
.mentoring .review-tips-list li p {
display: inline;
margin: 0;
}
Expand Down
5 changes: 5 additions & 0 deletions problem_builder/public/js/container_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ function ProblemBuilderContainerEdit(runtime, element) {
if (window.ProblemBuilderUtil) {
ProblemBuilderUtil.transformClarifications(element);
}

// Add a "mentoring" class to the root XBlock so we can use it as a
// selector. We cannot just add a div.mentoring wrapper around our children
// since it breaks jQuery drag-and-drop re-ordering of children.
$(".wrapper-xblock.level-page > .xblock-render > .xblock").addClass("mentoring");
}
7 changes: 6 additions & 1 deletion problem_builder/public/themes/apros.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
text-transform: uppercase;
}

.themed-xblock.mentoring .assessment-review-tips .review-tips-list li {
.themed-xblock.mentoring .sb-review-score {
margin-left: 40px;
margin-top: 15px;
}

.themed-xblock.mentoring .review-tips-list li {
margin-left: 1.8em;
padding-left: 0;
}
4 changes: 0 additions & 4 deletions problem_builder/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ def author_edit_view(self, context):
Add some HTML to the author view that allows authors to add child blocks.
"""
local_context = dict(context)
local_context['wrap_children'] = {
'head': u'<div class="mentoring">',
'tail': u'</div>'
}
local_context['author_edit_view'] = True
fragment = super(MentoringStepBlock, self).author_edit_view(local_context)
fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/problem-builder.css'))
Expand Down
4 changes: 0 additions & 4 deletions problem_builder/step_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ def author_edit_view(self, context):
"""
Add some HTML to the author view that allows authors to add child blocks.
"""
context['wrap_children'] = {
'head': u'<div class="mentoring">',
'tail': u'</div>'
}
fragment = super(ReviewStepBlock, self).author_edit_view(context)
fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/problem-builder.css'))
fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/problem-builder-edit.css'))
Expand Down
2 changes: 1 addition & 1 deletion problem_builder/templates/html/mentoring_with_steps.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>{{ title }}</h2>
{% endfor %}

<div class="submit">
<span class="step-overall-checkmark fa icon-2x"></span>
<span class="step-overall-checkmark fa icon-2x fa-fw"></span>
<input type="button" class="input-main" value="Submit" disabled="disabled" />
<input type="button" class="input-next" value="Next Step" disabled="disabled" />
<input type="button" class="input-review" value="Review grade" disabled="disabled" />
Expand Down
6 changes: 3 additions & 3 deletions problem_builder/templates/html/sb-review-score.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h2>{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %
<hr/>


<span class="assessment-checkmark icon-2x checkmark-correct icon-ok fa fa-check"></span>
<span class="assessment-checkmark icon-2x checkmark-correct icon-ok fa fa-check fa-fw"></span>
<div class="results-section">
<p>
{% blocktrans count correct_answers=correct_answers %}
Expand All @@ -32,7 +32,7 @@ <h2>{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %
<div class="clear"></div>


<span class="assessment-checkmark icon-2x checkmark-partially-correct icon-ok fa fa-check"></span>
<span class="assessment-checkmark icon-2x checkmark-partially-correct icon-ok fa fa-check fa-fw"></span>
<div class="results-section">
<p>
{% blocktrans count partially_correct_answers=partially_correct_answers %}
Expand All @@ -55,7 +55,7 @@ <h2>{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %
<div class="clear"></div>


<span class="assessment-checkmark icon-2x checkmark-incorrect icon-exclamation fa fa-exclamation"></span>
<span class="assessment-checkmark icon-2x checkmark-incorrect icon-exclamation fa fa-exclamation fa-fw"></span>
<div class="results-section">
<p>
{% blocktrans count incorrect_answers=incorrect_answers %}
Expand Down