diff --git a/problem_builder/mentoring.py b/problem_builder/mentoring.py index 55d69a2f..3c11826b 100644 --- a/problem_builder/mentoring.py +++ b/problem_builder/mentoring.py @@ -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 @@ -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'
', - 'tail': u'
' - } 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 diff --git a/problem_builder/mixins.py b/problem_builder/mixins.py index d82c5866..79df1df1 100644 --- a/problem_builder/mixins.py +++ b/problem_builder/mixins.py @@ -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: diff --git a/problem_builder/plot.py b/problem_builder/plot.py index 6f4322a5..69df555e 100644 --- a/problem_builder/plot.py +++ b/problem_builder/plot.py @@ -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'
', - 'tail': u'
' - } 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')) diff --git a/problem_builder/public/css/problem-builder.css b/problem_builder/public/css/problem-builder.css index 80090c63..6a7c269e 100644 --- a/problem_builder/public/css/problem-builder.css +++ b/problem_builder/public/css/problem-builder.css @@ -174,6 +174,7 @@ list-style: none; padding-left: 0 !important; margin-left: 0; + margin-bottom: 0.4em; } .mentoring .review-list li { display: inline; @@ -184,7 +185,7 @@ } .mentoring .results-section { - margin-left: 40px; + margin-left: 50px; } .mentoring .results-section p { @@ -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; } diff --git a/problem_builder/public/js/container_edit.js b/problem_builder/public/js/container_edit.js index 48d37c5e..7814f7e7 100644 --- a/problem_builder/public/js/container_edit.js +++ b/problem_builder/public/js/container_edit.js @@ -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"); } diff --git a/problem_builder/public/themes/apros.css b/problem_builder/public/themes/apros.css index f75d0660..5fb78ee7 100644 --- a/problem_builder/public/themes/apros.css +++ b/problem_builder/public/themes/apros.css @@ -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; } diff --git a/problem_builder/step.py b/problem_builder/step.py index 7c11b8a7..5817f9f4 100644 --- a/problem_builder/step.py +++ b/problem_builder/step.py @@ -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'
', - 'tail': u'
' - } 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')) diff --git a/problem_builder/step_review.py b/problem_builder/step_review.py index c74b33d1..f3987050 100644 --- a/problem_builder/step_review.py +++ b/problem_builder/step_review.py @@ -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'
', - 'tail': u'
' - } 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')) diff --git a/problem_builder/templates/html/mentoring_with_steps.html b/problem_builder/templates/html/mentoring_with_steps.html index 26e280d0..c356f258 100644 --- a/problem_builder/templates/html/mentoring_with_steps.html +++ b/problem_builder/templates/html/mentoring_with_steps.html @@ -14,7 +14,7 @@

{{ title }}

{% endfor %}
- + diff --git a/problem_builder/templates/html/sb-review-score.html b/problem_builder/templates/html/sb-review-score.html index 21281710..a685c505 100644 --- a/problem_builder/templates/html/sb-review-score.html +++ b/problem_builder/templates/html/sb-review-score.html @@ -9,7 +9,7 @@

{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %
- +

{% blocktrans count correct_answers=correct_answers %} @@ -32,7 +32,7 @@

{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %
- +

{% blocktrans count partially_correct_answers=partially_correct_answers %} @@ -55,7 +55,7 @@

{% blocktrans %}You scored {{score}}% on this assessment. {% endblocktrans %
- +

{% blocktrans count incorrect_answers=incorrect_answers %}