Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle editor preview state for Lesson Actions block #3821

Closed
donnapep opened this issue Dec 2, 2020 · 5 comments
Closed

Handle editor preview state for Lesson Actions block #3821

donnapep opened this issue Dec 2, 2020 · 5 comments

Comments

@donnapep
Copy link
Collaborator

donnapep commented Dec 2, 2020

Describe the solution you'd like

Create a block that handles the Complete Lesson, Reset Lesson and Next Lesson functionality. Each button block should support configuration of the following settings:

  • Styles
    • Fill (default for Complete Lesson, Reset Lesson)
    • Outline (default for Next Lesson)
  • Color settings
    • Text Color
    • Background Color
  • Border settings
    • Border radius

The parent block should support the following Visibility Available Actions settings:

  • Reset Lesson button (toggle, default true)
    - Next Lesson button (toggle, default true)

The Complete Lesson button is always displayed.
The Complete Lesson button is always displayed for an enrolled user who has met the necessary conditions.

The Next Lesson button is always displayed, regardless of whether or not the user is enrolled.

Functionality

  • Clicking the Complete Lesson button should set the status of the lesson to Completed. The Reset Lesson and Next Lesson button should be displayed, and the Complete Lesson button should be hidden.
  • Clicking the Reset Lesson button should set the status of the lesson to In Progress. The Complete Lesson button should be displayed, and the Reset Lesson and Next Lesson button should be hidden.
  • Clicking the Next Lesson button should navigate to the next module or lesson in the course. If the current lesson is the last lesson in the course, the button is not displayed.

Visibility

The logic for determining the visibility of the buttons on the frontend should be the same as it is for the legacy buttons. If more than one button is displayed (e.g. Reset Lesson, Next Lesson), they should be beside each other.

Although the visibility of the existing Reset Lesson button is tied to the Allow user to retake the quiz setting, this seems like a nonsensical association that we should not carry over to this block.

Notices

Notices displayed as part of the button functionality (for example, Congratulations! You have passed this lesson. displaying after clicking on Complete Lesson) should not be part of the block and will be handled separately. This is so that notices aren't displayed at potentially odd locations on the page.

Context

The block replaces these buttons:
Screen Shot 2020-12-03 at 11 08 02 AM
Screen Shot 2020-12-03 at 10 32 42 AM
no-quiz

Editor Considerations

As per a design discussion, the block toolbar should enable switching between the different views. If either the Reset Lesson button or Next Lesson button settings are disabled, the toolbar updates appropriately. If both are disabled, then the toolbar switcher should be hidden.

Text

Lesson Actions Block Description

Enable an enrolled user to perform specific actions for a lesson.

Complete Lesson Block Description

Enable an enrolled user to mark the lesson as complete.

Next Lesson Block Description

Enable a user to move to the next lesson.

Reset Lesson Block Description

Enable an enrolled user to reset their progress in the lesson.

@donnapep donnapep added this to the 3.8.0 milestone Dec 2, 2020
@donnapep donnapep added the [Status] Needs Design Requires design feedback label Dec 3, 2020
@donnapep donnapep changed the title Add Complete Lesson block Add Lesson Actions block Dec 3, 2020
@donnapep donnapep changed the title Add Lesson Actions block Add Lesson Actions(?) block Dec 3, 2020
@yscik
Copy link
Contributor

yscik commented Dec 14, 2020

Editor Design

  • Lesson Actions container block with fixed inner blocks and a lesson preview status (In Progress, Completed)
  • Each button is a block, selectable separately to style
  • Non-active buttons are grayed out with 10% opacity. Clicking them changes the lesson preview state.
    • This makes it easy for the user to select and customize the button(s) for this lesson state.
    • Clicking them again selects the inner button block.
  • Clicking outside an active button block, including clicking on the non-active buttons, first selects the container block.
    • This makes it more clear that the preview state has changed.
  • Preview state can also be changed in a block toolbar dropdown. This also serves as a clarification on what state is active.

QuickTime movie

Lesson Actions parent block:
image

Inner button block selected:
image

Clickable prototype in Figma

Some changes:

  • In a completed state, the Next lesson should be the primary action (filled style, first button) and the Reset lesson secondary (Outline style).
    • Resetting the lesson progress feels like a marginal action, wanting to navigate to the next lesson is likely the more common thing here.
  • Visibility settings panel could be called something like Completed Lesson Actions

@donnapep donnapep changed the title Add Lesson Actions(?) block Add Lesson Actions block Dec 16, 2020
@donnapep
Copy link
Collaborator Author

donnapep commented Jan 4, 2021

As per a design review, the following changes should be made to the current design:

  • Don't include an icon in the toolbar dropdown.
  • Preview Lesson State is renamed to Lesson Status.
  • Padding for Next Lesson and Reset Lesson blocks should be the same.
  • Ensure all buttons have Filled, Outline and Link styles.
  • Visibility is renamed to Additional Actions.
  • The Next Lesson button should always be visible and not be a setting. Note that this is a departure from current functionality, but it would be simple to add behind a toggle setting if needed in future.
  • The Additional Actions panel does not need helper text as its purpose is self-explanatory.
  • The block descriptions are as per the original issue description.

@donnapep donnapep removed the [Status] Needs Design Requires design feedback label Jan 5, 2021
@matticbot matticbot changed the title Add Lesson Actions block Preview state in the editor (handle view state and highlight selected one) Jan 5, 2021
@matticbot matticbot changed the title Preview state in the editor (handle view state and highlight selected one) Handle editor preview state for Lesson Actions block Jan 5, 2021
@matticbot
Copy link
Collaborator

➤ donnapep commented:

This card is responsible for handling the view state and highlighting the buttons in the selected state.

@renatho
Copy link
Contributor

renatho commented Jan 14, 2021

@donnapep, could you explain the following item?

Padding for Next Lesson and Reset Lesson blocks should be the same.

@yscik
Copy link
Contributor

yscik commented Jan 14, 2021

@donnapep, could you explain the following item?

Padding for Next Lesson and Reset Lesson blocks should be the same.

This was just an issue with the design images, should be all good with using the button blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants