Skip to content

Make 'next' button text customizable in Mentoring Steps. - #74

Merged
Kelketek merged 1 commit into
masterfrom
custom_next_text
Oct 15, 2015
Merged

Make 'next' button text customizable in Mentoring Steps.#74
Kelketek merged 1 commit into
masterfrom
custom_next_text

Conversation

@Kelketek

Copy link
Copy Markdown
Member

@itsjeyd Ready for your review.

You should be able to test this by:

  1. Adding 'step-builder' to the advanced modules.
  2. Creating a step-builder block.
  3. Adding a Mentoring step block to the step-builder block
  4. Adding a question and review to the Mentoring step block
  5. Editing the mentoring step block to change the next button label text.
  6. Publishing
  7. Trying the step in the LMS to see if the next button has your customized text

Heads up @e-kolpakov , this should be coming down the pipe soon, and needs to be included in the release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kelketek When testing your changes I found that if there are multiple Mentoring Step blocks, setting different "Next step" labels doesn't work the way it's supposed to: The label doesn't change from step to step; it's always set to the next-button-label of the first step on the page.

One way of addressing this would be to add a function to MentoringStepBlock (in step.js) that returns the label of the current step, something like:

        getStepLabel: function() {
            return $('.sb-step', element).data('next-button-label');
        }

... and then update via:

        var step = steps[activeStep];
        nextDOM.attr('value', step.getStepLabel());

Also, I think you'll need to update the label not just from updateDisplay but also from jumpToReview (this is called from reviewNextStep, which acts as a click handler for nextDOM while reviewing individual steps). To test this (I didn't), set max_attempts and extended_feedback on the Step Builder block and complete the block in the LMS until you have no attempts left, then use one of the links to jump back to a specific question/step.

@Kelketek
Kelketek force-pushed the custom_next_text branch 2 times, most recently from 6b251b6 to 0a306f3 Compare October 15, 2015 15:28

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kelketek Nit: I think it would be good to rename this to something a little less generic, like updateNextLabel or even updateNextButtonLabel.

@itsjeyd

itsjeyd commented Oct 15, 2015

Copy link
Copy Markdown
Member

@Kelketek Looks good, 👍 once the tests pass.

Kelketek added a commit that referenced this pull request Oct 15, 2015
Make 'next' button text customizable in Mentoring Steps.
@Kelketek
Kelketek merged commit c6e6060 into master Oct 15, 2015
@Kelketek
Kelketek deleted the custom_next_text branch October 15, 2015 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants