diff --git a/.travis.yml b/.travis.yml index 3dfd81e6..6c0587c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,5 @@ script: - python run_tests.py --with-coverage --cover-package=problem_builder notifications: email: false +addons: + firefox: "36.0" diff --git a/problem_builder/dashboard.py b/problem_builder/dashboard.py index a4494303..3c69e9db 100644 --- a/problem_builder/dashboard.py +++ b/problem_builder/dashboard.py @@ -30,6 +30,7 @@ import json import logging import operator as op +from django.template.defaultfilters import floatformat from .dashboard_visual import DashboardVisualData from .mcq import MCQBlock @@ -402,6 +403,7 @@ def student_view(self, context=None): # pylint: disable=unused-argument block['mcqs'].append({ "display_name": mcq_block.display_name_with_default, "value": value, + "accessible_value": _("Score: {score}").format(score=value) if value else _("No value yet"), "color": self.color_for_value(value) if value is not None else None, }) # If the values are numeric, display an average: @@ -412,6 +414,10 @@ def student_view(self, context=None): # pylint: disable=unused-argument if numeric_values: average_value = sum(numeric_values) / len(numeric_values) block['average'] = average_value + # average block is shown only if average value exists, so accessible text for no data is not required + block['accessible_average'] = _("Score: {score}").format( + score=floatformat(average_value) + ) block['average_label'] = self.average_labels.get(mentoring_block.url_name, _("Average")) block['has_average'] = True block['average_color'] = self.color_for_value(average_value) diff --git a/problem_builder/mentoring.py b/problem_builder/mentoring.py index 78b1b103..3b3022f6 100644 --- a/problem_builder/mentoring.py +++ b/problem_builder/mentoring.py @@ -131,6 +131,12 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC default=_("Mentoring Questions"), scope=Scope.settings ) + feedback_label = String( + display_name=_("Feedback Header"), + help=_("Header for feedback messages"), + default=_("Feedback"), + scope=Scope.content + ) # User state attempted = Boolean( @@ -170,7 +176,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC editable_fields = ( 'display_name', 'mode', 'followed_by', 'max_attempts', 'enforce_dependency', - 'display_submit', 'weight', + 'display_submit', 'feedback_label', 'weight', ) icon_class = 'problem' has_score = True diff --git a/problem_builder/public/css/dashboard.css b/problem_builder/public/css/dashboard.css index 249b5355..1e202d3c 100644 --- a/problem_builder/public/css/dashboard.css +++ b/problem_builder/public/css/dashboard.css @@ -1,6 +1,10 @@ .pb-dashboard table { max-width: 800px; + width: 700px; + table-layout: auto; border-collapse: collapse; + margin-left: auto; + margin-right: auto; margin-bottom: 15px; } @@ -9,6 +13,10 @@ font-weight: bold; } +.pb-dashboard .avg-row .desc { + font-weight: 600; +} + .pb-dashboard table td, .pb-dashboard table tbody th { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; @@ -24,7 +32,7 @@ min-width: 4em; text-align: right; padding-right: 5px; - border-right: 0.6em solid transparent; + border-right: 2em solid transparent; } .pb-dashboard table .avg-row td.desc { diff --git a/problem_builder/public/js/mentoring.js b/problem_builder/public/js/mentoring.js index 760beb32..dbbd345e 100644 --- a/problem_builder/public/js/mentoring.js +++ b/problem_builder/public/js/mentoring.js @@ -22,7 +22,8 @@ function MentoringBlock(runtime, element) { hideAllSteps: hideAllSteps, step: step, steps: steps, - publish_event: publish_event + publish_event: publish_event, + data: data }; function publish_event(data) { diff --git a/problem_builder/public/js/mentoring_standard_view.js b/problem_builder/public/js/mentoring_standard_view.js index ac45f0c2..50452c61 100644 --- a/problem_builder/public/js/mentoring_standard_view.js +++ b/problem_builder/public/js/mentoring_standard_view.js @@ -25,7 +25,7 @@ function MentoringStandardView(runtime, element, mentoring) { // Messages should only be displayed upon hitting 'submit', not on page reload mentoring.setContent(messagesDOM, results.message); if (messagesDOM.html().trim()) { - messagesDOM.prepend('