100-exercises-to-learn-rust icon indicating copy to clipboard operation
100-exercises-to-learn-rust copied to clipboard

Enhance exercise progression flow after successful completion

Open wamimi opened this issue 1 year ago • 3 comments
trafficstars

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.

wamimi avatar Oct 19 '24 22:10 wamimi

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?

c-git avatar Nov 12 '24 16:11 c-git

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.

wamimi avatar Nov 12 '24 17:11 wamimi

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?

c-git avatar Nov 12 '24 17:11 c-git