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
4 changes: 1 addition & 3 deletions problem_builder/mcq.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,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.")
)
Expand Down
9 changes: 0 additions & 9 deletions problem_builder/mentoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,15 +621,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.
Expand Down
13 changes: 9 additions & 4 deletions problem_builder/public/css/mentoring.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,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 {
Expand All @@ -64,6 +65,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;
Expand Down
5 changes: 2 additions & 3 deletions problem_builder/public/js/mentoring_assessment_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,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");
}

Expand Down
2 changes: 1 addition & 1 deletion problem_builder/questionnaire.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,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
Expand Down