From 45072bbc661d9306fa751295e276827ab5fef3b7 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Thu, 9 Apr 2015 21:03:55 -0700 Subject: [PATCH 1/5] Fix: Question titles were not visible in the LMS --- problem_builder/questionnaire.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problem_builder/questionnaire.py b/problem_builder/questionnaire.py index 513fa1b0..77bd7f97 100644 --- a/problem_builder/questionnaire.py +++ b/problem_builder/questionnaire.py @@ -93,7 +93,7 @@ def student_view(self, context=None): template_path = 'templates/html/{}.html'.format(name.lower()) - context = context or {} + context = context.copy() if context else {} context['self'] = self context['custom_choices'] = self.custom_choices context['hide_header'] = context.get('hide_header', False) or not self.show_title From 3d4bf295bd760526a97735102fb448ccb28889a9 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Thu, 9 Apr 2015 21:10:56 -0700 Subject: [PATCH 2/5] Fix: MCQ question text should be editable even if there are no choices defined yet --- problem_builder/mcq.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/problem_builder/mcq.py b/problem_builder/mcq.py index 8782744a..9ba34775 100644 --- a/problem_builder/mcq.py +++ b/problem_builder/mcq.py @@ -133,9 +133,7 @@ def choice_name(choice_value): all_values = set(self.all_choice_values) correct = set(data.correct_choices) - if not all_values: - add_error(self._(u"No choices set yet.")) - elif not correct: + if all_values and not correct: add_error( self._(u"You must indicate the correct answer[s], or the student will always get this question wrong.") ) From 8bf362dd1edd7359393a812014213bbb8f079e95 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Thu, 9 Apr 2015 22:09:25 -0700 Subject: [PATCH 3/5] Fix: Can't retry if max_attempts set to zero after answering while it was nonzero --- problem_builder/public/js/mentoring_assessment_view.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/problem_builder/public/js/mentoring_assessment_view.js b/problem_builder/public/js/mentoring_assessment_view.js index b6f9f0c6..7cc15ba7 100644 --- a/problem_builder/public/js/mentoring_assessment_view.js +++ b/problem_builder/public/js/mentoring_assessment_view.js @@ -33,10 +33,9 @@ function MentoringAssessmentView(runtime, element, mentoring) { tryAgainDOM.show(); 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"); - } - else { + } else { tryAgainDOM.removeAttr("disabled"); } From 0d85a3fe174ab063aedeaa68b0d9a5b0e00e1ec4 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Thu, 9 Apr 2015 21:21:02 -0700 Subject: [PATCH 4/5] Fix: confusing behaviour of max_attempts when changing mode --- problem_builder/mentoring.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/problem_builder/mentoring.py b/problem_builder/mentoring.py index 5a72d0a1..78b1b103 100644 --- a/problem_builder/mentoring.py +++ b/problem_builder/mentoring.py @@ -505,15 +505,6 @@ def get_message_html(self, message_type): html += child.render('mentoring_view', {}).content # TODO: frament_text_rewriting ? 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): """ Validates the state of this XBlock except for individual field values. From dc4a43a71935fb727e0e001aebe656f1d1e5715e Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Fri, 10 Apr 2015 13:00:38 -0700 Subject: [PATCH 5/5] Fix: spacing around question titles/text in Firefox --- problem_builder/public/css/mentoring.css | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/problem_builder/public/css/mentoring.css b/problem_builder/public/css/mentoring.css index c8a63bba..4b97c44a 100644 --- a/problem_builder/public/css/mentoring.css +++ b/problem_builder/public/css/mentoring.css @@ -40,12 +40,13 @@ font-style: italic; } -.mentoring h4 { - margin-bottom: 20px; +.mentoring fieldset { + margin-top: 10px; } -.mentoring h4 { - margin-top: 25px; +.mentoring h3 { + margin-top: 0px; + margin-bottom: 7px; } .mentoring .submit { @@ -62,6 +63,10 @@ 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 { margin-left: 10px; display: inline-block;