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

Enhance exercise progression flow after successful completion #181

Open
wamimi opened this issue Oct 19, 2024 · 3 comments
Open

Enhance exercise progression flow after successful completion #181

wamimi opened this issue Oct 19, 2024 · 3 comments

Comments

@wamimi
Copy link

wamimi commented Oct 19, 2024

Currently, after solving an exercise, users need to:

  1. Run wr again to compile the exercise and execute its tests
  2. Manually confirm if they want to proceed to the next exercise

Suggestion:
Improve the progression system to:

  1. Detect when all tests for an exercise have passed
  2. Automatically switch the focus to the next exercise in the terminal, showing its errors/tasks
  3. Allow the user to navigate to the new exercise file at their own pace

Proposed behavior:

  • When wr detects all tests have passed for the current exercise:
    • Display a success message for the current exercise
    • Automatically show the next exercise's errors/tasks in the terminal
    • Provide the file path of the next exercise for easy navigation
  • The user can then open the new exercise file in their editor when ready

Benefits:

  • Streamlines the learning process by reducing manual steps
  • Maintains user control over file navigation
  • Provides immediate feedback and direction for the next challenge
  • Keeps users engaged and focused on problem-solving

Example terminal output after completing an exercise:

`Congratulations! All tests passed for exercise [01_intro/00_welcome
Next exercise: 02_basic_calculator/01_addition
File path: exercises/02_basic_calculator/01_addition/src/lib.rs
Current errors for 02_basic_calculator/01_addition:
error[E0425]: cannot find function add in this scope
--> exercises/02_basic_calculator/01_addition/src/lib.rs:3:5
|
3 | add(a, b)
| ^^^ not found in this scope

Navigate to the file and start working on the next exercise!`

Implementation considerations:

  • Modify the wr command to automatically switch focus after successful completion
  • Ensure clear instructions are provided for navigating to the next file
  • Consider adding a configuration option for users who prefer the current manual confirmation

This enhancement would significantly improve the user experience while maintaining the workshop's structure and allowing users to progress at their own pace.

@c-git
Copy link
Contributor

c-git commented Nov 12, 2024

Unless I misunderstood what you're suggesting, this new flow will not allow you to try multiple solutions to the same problem after you try a correct solution. Am I mistaken?

@wamimi
Copy link
Author

wamimi commented Nov 12, 2024

You raise a valid concern. Let me clarify the proposal:

The idea isn't to force automatic progression but rather to streamline the current flow while preserving user control. Here's how it would work:

When tests pass, instead of requiring a "y/n" confirmation, the terminal would:

  1. Show the success message for current exercise
  2. Display the next exercise's errors/tasks
  3. Keep accepting and testing modifications to the current exercise file

This means:

  • You can continue experimenting with different solutions for the current exercise
  • The next exercise's context is ready whenever you choose to move on
  • No manual confirmation needed to see what's next

The key is that we're only automating the information display, not forcing progression. You maintain full control over when you actually move to the next exercise.

@c-git
Copy link
Contributor

c-git commented Nov 12, 2024

So to clarify my understanding. It is the same as now including the y/n question except it shows the next exercise as well if the tests pass?

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

No branches or pull requests

2 participants