Add an interactive exercise with solution to an existing lesson. Creates properly formatted exercise and solution admonition blocks. Use when a lesson needs hands-on practice.
Add an exercise with solution to an existing training lesson.
See ../shared/repo-conventions.md for directory structure and file conventions.
Follow these steps:
Ask the user:
Read the lesson file to understand context
Create the exercise using the ??? exercise admonition:
??? exercise "Exercise: [Title]"
Brief description of what to do.
1. First step
2. Second step
3. Expected outcome
!!! tip
Helpful hint if needed
Create the corresponding solution using ??? solution or ??? result:
??? solution "Solution"
Explanation of the solution approach.
```groovy title="filename.nf" linenums="1"
[solution code]
```
Expected output:
```console title="Output"
[expected output]
```
If the exercise requires a solution file:
[module]/solutions/Insert the exercise at an appropriate point in the lesson:
Test the exercise:
Remind the user to: