diff --git a/problem_builder/public/js/mentoring_with_steps.js b/problem_builder/public/js/mentoring_with_steps.js index ba5d1235..cc64b15d 100644 --- a/problem_builder/public/js/mentoring_with_steps.js +++ b/problem_builder/public/js/mentoring_with_steps.js @@ -175,8 +175,14 @@ function MentoringWithStepsBlock(runtime, element) { reviewTipsDOM.empty().hide(); } + function updateNextLabel() { + var step = steps[activeStep]; + nextDOM.attr('value', step.getStepLabel()); + } + function updateDisplay() { cleanAll(); + if (atReviewStep()) { // Tell supporting runtimes to enable navigation between units; // user is currently not in the middle of an attempt @@ -188,6 +194,7 @@ function MentoringWithStepsBlock(runtime, element) { } else { showActiveStep(); validateXBlock(); + updateNextLabel(); nextDOM.attr('disabled', 'disabled'); if (isLastStep() && reviewStep) { reviewDOM.attr('disabled', 'disabled'); @@ -243,6 +250,7 @@ function MentoringWithStepsBlock(runtime, element) { activeStep = stepIndex; cleanAll(); showActiveStep(); + updateNextLabel(); if (isLastStep()) { reviewDOM.show(); diff --git a/problem_builder/public/js/step.js b/problem_builder/public/js/step.js index 0c9eb9b6..3751393e 100644 --- a/problem_builder/public/js/step.js +++ b/problem_builder/public/js/step.js @@ -81,6 +81,10 @@ function MentoringStepBlock(runtime, element) { callIfExists(child, 'handleReview', result); } } + }, + + getStepLabel: function() { + return $('.sb-step', element).data('next-button-label'); } }; diff --git a/problem_builder/step.py b/problem_builder/step.py index 85030617..77b1bd8c 100644 --- a/problem_builder/step.py +++ b/problem_builder/step.py @@ -99,7 +99,13 @@ class MentoringStepBlock( scope=Scope.user_state ) - editable_fields = ('display_name', 'show_title',) + next_button_label = String( + display_name=_("Next Button Label"), + help=_("Customize the text of the 'Next' button."), + default=_("Next Step") + ) + + editable_fields = ('display_name', 'show_title', 'next_button_label') @lazy def siblings(self): diff --git a/problem_builder/templates/html/step.html b/problem_builder/templates/html/step.html index 1cb86b08..8fd325d4 100644 --- a/problem_builder/templates/html/step.html +++ b/problem_builder/templates/html/step.html @@ -1,4 +1,4 @@ -