Commit a72c2836 by Jillian Vogel

Shows the "on-assessment-review" and "on-assessment-review-question" buttons in…

Shows the "on-assessment-review" and "on-assessment-review-question" buttons in Problem Builder only if (deprecated) assessment mode is enabled.

* Always shows the "on-assessment-review-question" button in Step Builder Questionnaire problems.
* Fixes button styles to prevent long button names from overflowing the buttons.
parent 1ba71260
...@@ -820,7 +820,11 @@ class MentoringBlock(BaseMentoringBlock, StudioContainerXBlockMixin, StepParentM ...@@ -820,7 +820,11 @@ class MentoringBlock(BaseMentoringBlock, StudioContainerXBlockMixin, StepParentM
fragment = Fragment(u'<div class="mentoring">') # This DIV is needed for CSS to apply to the previews fragment = Fragment(u'<div class="mentoring">') # This DIV is needed for CSS to apply to the previews
self.render_children(context, fragment, can_reorder=True, can_add=False) self.render_children(context, fragment, can_reorder=True, can_add=False)
fragment.add_content(u'</div>') fragment.add_content(u'</div>')
fragment.add_content(loader.render_template('templates/html/mentoring_add_buttons.html', {}))
# Show buttons to add review-related child blocks only in assessment mode.
fragment.add_content(loader.render_template('templates/html/mentoring_add_buttons.html', {
"show_review": self.is_assessment,
}))
fragment.add_content(loader.render_template('templates/html/mentoring_url_name.html', { fragment.add_content(loader.render_template('templates/html/mentoring_url_name.html', {
"url_name": self.url_name "url_name": self.url_name
})) }))
......
...@@ -88,16 +88,14 @@ class MentoringMessageBlock(XBlock, StudioEditableXBlockMixin, XBlockWithTransla ...@@ -88,16 +88,14 @@ class MentoringMessageBlock(XBlock, StudioEditableXBlockMixin, XBlockWithTransla
}, },
"on-assessment-review-question": { "on-assessment-review-question": {
"display_name": _(u"Study tips if this question was wrong"), "display_name": _(u"Study tips if this question was wrong"),
"long_display_name": _(u"Study tips shown during assessment review if wrong"), "long_display_name": _(u"Study tips shown if question was answered incorrectly"),
"default": _( "default": _(
u"Review ____." u"Review ____."
), ),
"description": _( "description": _(
u"In assessment mode, this message will be shown when the student is reviewing " u"This message will be shown when the student is reviewing "
"their answers to the assessment, if the student got this specific question " "their answers to the assessment, if the student got this specific question "
"wrong and is allowed to try again. " "wrong and is allowed to try again."
"This message is ignored in standard mode and is not shown if the student has "
"used up all of their allowed attempts."
), ),
}, },
} }
......
...@@ -28,9 +28,11 @@ ...@@ -28,9 +28,11 @@
.xblock[data-block-type=step-builder] .add-xblock-component .new-component .new-component-type .add-xblock-component-button, .xblock[data-block-type=step-builder] .add-xblock-component .new-component .new-component-type .add-xblock-component-button,
.xblock[data-block-type=problem-builder] .add-xblock-component .new-component .new-component-type .add-xblock-component-button, .xblock[data-block-type=problem-builder] .add-xblock-component .new-component .new-component-type .add-xblock-component-button,
.xblock[data-block-type=mentoring] .add-xblock-component .new-component .new-component-type .add-xblock-component-button { .xblock[data-block-type=mentoring] .add-xblock-component .new-component .new-component-type .add-xblock-component-button {
width: 200px; width: auto;
height: 30px; height: auto;
line-height: 30px; line-height: 30px;
padding-left: 1em;
padding-right: 1em;
} }
.xblock[data-block-type=sb-plot] .add-xblock-component .new-component .new-component-type .add-xblock-component-button.disabled, .xblock[data-block-type=sb-plot] .add-xblock-component .new-component .new-component-type .add-xblock-component-button.disabled,
......
/* Custom appearance for our "Add" buttons */ /* Custom appearance for our "Add" buttons */
.xblock .add-xblock-component .new-component .new-component-type .add-xblock-component-button { .xblock .add-xblock-component .new-component .new-component-type .add-xblock-component-button {
width: 200px; width: auto;
height: 30px; height: auto;
line-height: 30px; line-height: 30px;
padding-left: 1em;
padding-right: 1em;
} }
.xblock .add-xblock-component .new-component .new-component-type .add-xblock-component-button.disabled, .xblock .add-xblock-component .new-component .new-component-type .add-xblock-component-button.disabled,
......
...@@ -158,7 +158,14 @@ class QuestionnaireAbstractBlock( ...@@ -158,7 +158,14 @@ class QuestionnaireAbstractBlock(
Add some HTML to the author view that allows authors to add choices and tips. Add some HTML to the author view that allows authors to add choices and tips.
""" """
fragment = self.get_author_edit_view_fragment(context) fragment = self.get_author_edit_view_fragment(context)
fragment.add_content(loader.render_template('templates/html/questionnaire_add_buttons.html', {}))
# Let the parent block determine whether to display buttons to add review-related child blocks.
# * Problem Builder units use MentoringBlock parent components, which define an 'is_assessment' property,
# indicating whether the (deprecated) assessment mode is enabled.
# * Step Builder units can show review components in the Review Step.
fragment.add_content(loader.render_template('templates/html/questionnaire_add_buttons.html', {
'show_review': getattr(self.get_parent(), 'is_assessment', True),
}))
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.css'))
fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/questionnaire-edit.css')) fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/questionnaire-edit.css'))
fragment.add_javascript_url(self.runtime.local_resource_url(self, 'public/js/util.js')) fragment.add_javascript_url(self.runtime.local_resource_url(self, 'public/js/util.js'))
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="completed">{% trans "Message (Complete)" %}</a></li> <li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="completed">{% trans "Message (Complete)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="incomplete">{% trans "Message (Incomplete)" %}</a></li> <li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="incomplete">{% trans "Message (Incomplete)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="max_attempts_reached">{% trans "Message (Max # Attempts)" %}</a></li> <li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="max_attempts_reached">{% trans "Message (Max # Attempts)" %}</a></li>
{% if show_review %}
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="on-assessment-review">{% trans "Message (Assessment Review)" %}</a></li> <li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="on-assessment-review">{% trans "Message (Assessment Review)" %}</a></li>
{% endif %}
</ul> </ul>
</div> </div>
</div> </div>
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<ul class="new-component-type"> <ul class="new-component-type">
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-choice" data-boilerplate="studio_default">{% trans "Add Custom Choice" %}</a></li> <li><a href="#" class="single-template add-xblock-component-button" data-category="pb-choice" data-boilerplate="studio_default">{% trans "Add Custom Choice" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-tip">{% trans "Add Tip" %}</a></li> <li><a href="#" class="single-template add-xblock-component-button" data-category="pb-tip">{% trans "Add Tip" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="on-assessment-review-question">{% trans "Message (Assessment Review)" %}</a></li> {% if show_review %}
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="on-assessment-review-question">{% trans "Message (Review)" %}</a></li>
{% endif %}
</ul> </ul>
</div> </div>
</div> </div>
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