Commit 4817f9d9 by Braden MacDonald

Merge pull request #9 from open-craft/hotfix

Hotfix: Four minor issues to address before release
parents ea2875fb dc4a43a7
...@@ -133,9 +133,7 @@ class MCQBlock(SubmittingXBlockMixin, QuestionnaireAbstractBlock): ...@@ -133,9 +133,7 @@ class MCQBlock(SubmittingXBlockMixin, QuestionnaireAbstractBlock):
all_values = set(self.all_choice_values) all_values = set(self.all_choice_values)
correct = set(data.correct_choices) correct = set(data.correct_choices)
if not all_values: if all_values and not correct:
add_error(self._(u"No choices set yet."))
elif not correct:
add_error( add_error(
self._(u"You must indicate the correct answer[s], or the student will always get this question wrong.") self._(u"You must indicate the correct answer[s], or the student will always get this question wrong.")
) )
......
...@@ -505,15 +505,6 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC ...@@ -505,15 +505,6 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
html += child.render('mentoring_view', {}).content # TODO: frament_text_rewriting ? html += child.render('mentoring_view', {}).content # TODO: frament_text_rewriting ?
return html return html
def clean_studio_edits(self, data):
"""
Given POST data dictionary 'data', clean the data before validating it.
e.g. fix capitalization, remove trailing spaces, etc.
"""
if data.get('mode') == 'assessment' and 'max_attempts' not in data:
# assessment has a default of 2 max_attempts
data['max_attempts'] = 2
def validate(self): def validate(self):
""" """
Validates the state of this XBlock except for individual field values. Validates the state of this XBlock except for individual field values.
......
...@@ -40,12 +40,13 @@ ...@@ -40,12 +40,13 @@
font-style: italic; font-style: italic;
} }
.mentoring h4 { .mentoring fieldset {
margin-bottom: 20px; margin-top: 10px;
} }
.mentoring h4 { .mentoring h3 {
margin-top: 25px; margin-top: 0px;
margin-bottom: 7px;
} }
.mentoring .submit { .mentoring .submit {
...@@ -62,6 +63,10 @@ ...@@ -62,6 +63,10 @@
display: table; /* Enable line-wrapping in IE8 */ display: table; /* Enable line-wrapping in IE8 */
} }
.mentoring .choices legend.question p:last-child { /* Selector must be more specific than 'div.course-wrapper section.course-content p' */
margin-bottom: 0;
}
.mentoring .attempts { .mentoring .attempts {
margin-left: 10px; margin-left: 10px;
display: inline-block; display: inline-block;
......
...@@ -33,10 +33,9 @@ function MentoringAssessmentView(runtime, element, mentoring) { ...@@ -33,10 +33,9 @@ function MentoringAssessmentView(runtime, element, mentoring) {
tryAgainDOM.show(); tryAgainDOM.show();
var attempts_data = $('.attempts', element).data(); var attempts_data = $('.attempts', element).data();
if (attempts_data.num_attempts >= attempts_data.max_attempts) { if (attempts_data.max_attempts > 0 && attempts_data.num_attempts >= attempts_data.max_attempts) {
tryAgainDOM.attr("disabled", "disabled"); tryAgainDOM.attr("disabled", "disabled");
} } else {
else {
tryAgainDOM.removeAttr("disabled"); tryAgainDOM.removeAttr("disabled");
} }
......
...@@ -93,7 +93,7 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc ...@@ -93,7 +93,7 @@ class QuestionnaireAbstractBlock(StudioEditableXBlockMixin, StudioContainerXBloc
template_path = 'templates/html/{}.html'.format(name.lower()) template_path = 'templates/html/{}.html'.format(name.lower())
context = context or {} context = context.copy() if context else {}
context['self'] = self context['self'] = self
context['custom_choices'] = self.custom_choices context['custom_choices'] = self.custom_choices
context['hide_header'] = context.get('hide_header', False) or not self.show_title context['hide_header'] = context.get('hide_header', False) or not self.show_title
......
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