Skip to content

Generate a .mov or .gif from wokwi-cli test #983

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

Open
rafaelcorsi opened this issue Mar 26, 2025 · 3 comments
Open

Generate a .mov or .gif from wokwi-cli test #983

rafaelcorsi opened this issue Mar 26, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@rafaelcorsi
Copy link

Hi,

It would be nice if we were able to generate a video animation from a given test scenario, similar to the --screenshot-time option.

This would open new possibility to use wokwi-cli with students:

  • better debug test
  • integration in other platforms as prairielearn

all the best,

@rafaelcorsi rafaelcorsi added the enhancement New feature or request label Mar 26, 2025
@urish
Copy link
Contributor

urish commented Mar 27, 2025

Hi Rafael!

You mean generate an animation of the content of an LCD screen, or of the entire diagram?

What's prairielearn?

@rafaelcorsi
Copy link
Author

I mean the entire diagram simulation (with bnt pressed and release, ...).

The problem is that when a student is validating an exercise, they find it very difficult to understand the test scenario (through the log), and to know at what exact moment their program does not respond as expected.

The way I have been doing it here with my students is that I do not allow them to run the local test (wokwi-cli), so they need to validate the program themselves (which is part of the learning objective of knowing how to debug and verify behavior).

But to receive the grade, they submit the code to github and there I configure wokwi-cli in the action, and for each exercise there is an associated test. But many times what the student thinks is correct is not and the test fails, but the log is not clear to the students.

Then I started thinking that if I were able to generate the complete animation of the simulation, it could help students understand where the error is and fix it more easily, especially because the whole process of testing in action takes some time (which in a way is good because they don't have to do trial and error), which is sometimes frustrating for the student, because the error is in something stupid that they didn't realize.

@rafaelcorsi
Copy link
Author

prairielearn is a platform that we use in some disciplines in which each exercise is generated by a code, so we can have "infinite" variations of the same exercise. This is used in the context of mastery learning, where the student can only move on to the next stage when he has mastered the current one.

And I have been thinking about how to use wokwi with this resource. Imagine the exercise in which the student needs to blink an LED, for each time he tries to solve the exercise the system generates a new one, in which I vary in the diagram.json the pin to which the LED is connected.

So every time the student tries to solve the exercise the LED will change pin, and he will have to check which GPIO again and change the code. This makes it easier to fix basic concepts that cause problems later on.

In the case of the LED, it's fine to generate a pass/fail result or provide the wokwi-cli log, but for more complex cases, this result alone won't be enough, and so I thought about providing the simulation animation to the students, as a test result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants